mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 01:41:31 +00:00
Remove Explorer Stub and ViewModel.Explorer (#101)
This commit is contained in:
@@ -57,8 +57,8 @@ export function decryptJWTToken(token: string) {
|
||||
}
|
||||
|
||||
export function displayTokenRenewalPromptForStatus(httpStatusCode: number): void {
|
||||
const platformType: PlatformType = window.dataExplorerPlatform;
|
||||
const explorer: ViewModels.Explorer = window.dataExplorer;
|
||||
const platformType = window.dataExplorerPlatform;
|
||||
const explorer = window.dataExplorer;
|
||||
|
||||
if (
|
||||
httpStatusCode == null ||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as GalleryUtils from "./GalleryUtils";
|
||||
import { JunoClient, IGalleryItem } from "../Juno/JunoClient";
|
||||
import { ExplorerStub } from "../Explorer/OpenActionsStubs";
|
||||
import { HttpStatusCodes } from "../Common/Constants";
|
||||
import { GalleryTab, SortBy } from "../Explorer/Controls/NotebookGallery/GalleryViewerComponent";
|
||||
import Explorer from "../Explorer/Explorer";
|
||||
|
||||
const galleryItem: IGalleryItem = {
|
||||
id: "id",
|
||||
@@ -25,7 +25,7 @@ describe("GalleryUtils", () => {
|
||||
});
|
||||
|
||||
it("downloadItem shows dialog in data explorer", () => {
|
||||
const container = new ExplorerStub();
|
||||
const container = {} as Explorer;
|
||||
container.showOkCancelModalDialog = jest.fn().mockImplementation();
|
||||
|
||||
GalleryUtils.downloadItem(container, undefined, galleryItem, undefined);
|
||||
@@ -34,7 +34,7 @@ describe("GalleryUtils", () => {
|
||||
});
|
||||
|
||||
it("favoriteItem favorites item", async () => {
|
||||
const container = new ExplorerStub();
|
||||
const container = {} as Explorer;
|
||||
const junoClient = new JunoClient();
|
||||
junoClient.favoriteNotebook = jest
|
||||
.fn()
|
||||
@@ -48,7 +48,7 @@ describe("GalleryUtils", () => {
|
||||
});
|
||||
|
||||
it("unfavoriteItem unfavorites item", async () => {
|
||||
const container = new ExplorerStub();
|
||||
const container = {} as Explorer;
|
||||
const junoClient = new JunoClient();
|
||||
junoClient.unfavoriteNotebook = jest
|
||||
.fn()
|
||||
@@ -62,7 +62,7 @@ describe("GalleryUtils", () => {
|
||||
});
|
||||
|
||||
it("deleteItem shows dialog in data explorer", () => {
|
||||
const container = new ExplorerStub();
|
||||
const container = {} as Explorer;
|
||||
container.showOkCancelModalDialog = jest.fn().mockImplementation();
|
||||
|
||||
GalleryUtils.deleteItem(container, undefined, galleryItem, undefined);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { IGalleryItem, JunoClient } from "../Juno/JunoClient";
|
||||
import * as ViewModels from "../Contracts/ViewModels";
|
||||
import { NotificationConsoleUtils } from "./NotificationConsoleUtils";
|
||||
import { ConsoleDataType } from "../Explorer/Menus/NotificationConsole/NotificationConsoleComponent";
|
||||
import * as Logger from "../Common/Logger";
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
SortBy,
|
||||
GalleryViewerComponent
|
||||
} from "../Explorer/Controls/NotebookGallery/GalleryViewerComponent";
|
||||
import Explorer from "../Explorer/Explorer";
|
||||
|
||||
export enum NotebookViewerParams {
|
||||
NotebookUrl = "notebookUrl",
|
||||
@@ -34,7 +34,7 @@ export interface GalleryViewerProps {
|
||||
}
|
||||
|
||||
export function downloadItem(
|
||||
container: ViewModels.Explorer,
|
||||
container: Explorer,
|
||||
junoClient: JunoClient,
|
||||
data: IGalleryItem,
|
||||
onComplete: (item: IGalleryItem) => void
|
||||
@@ -80,7 +80,7 @@ export function downloadItem(
|
||||
}
|
||||
|
||||
export async function favoriteItem(
|
||||
container: ViewModels.Explorer,
|
||||
container: Explorer,
|
||||
junoClient: JunoClient,
|
||||
data: IGalleryItem,
|
||||
onComplete: (item: IGalleryItem) => void
|
||||
@@ -102,7 +102,7 @@ export async function favoriteItem(
|
||||
}
|
||||
|
||||
export async function unfavoriteItem(
|
||||
container: ViewModels.Explorer,
|
||||
container: Explorer,
|
||||
junoClient: JunoClient,
|
||||
data: IGalleryItem,
|
||||
onComplete: (item: IGalleryItem) => void
|
||||
@@ -124,7 +124,7 @@ export async function unfavoriteItem(
|
||||
}
|
||||
|
||||
export function deleteItem(
|
||||
container: ViewModels.Explorer,
|
||||
container: Explorer,
|
||||
junoClient: JunoClient,
|
||||
data: IGalleryItem,
|
||||
onComplete: (item: IGalleryItem) => void
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as DataModels from "../Contracts/DataModels";
|
||||
import { Explorer, KernelConnectionMetadata } from "../Contracts/ViewModels";
|
||||
import { KernelConnectionMetadata } from "../Contracts/ViewModels";
|
||||
import * as Logger from "../Common/Logger";
|
||||
|
||||
export class NotebookConfigurationUtils {
|
||||
@@ -27,7 +27,7 @@ export class NotebookConfigurationUtils {
|
||||
return Promise.reject("Invalid or missing cluster connection info");
|
||||
}
|
||||
|
||||
const dataExplorer = window.dataExplorer as Explorer;
|
||||
const dataExplorer = window.dataExplorer;
|
||||
const notebookEndpointInfo: DataModels.NotebookConfigurationEndpointInfo[] = clusterConnectionInfo.endpoints.map(
|
||||
clusterEndpoint => ({
|
||||
type: clusterEndpoint.kind.toLowerCase(),
|
||||
|
||||
Reference in New Issue
Block a user