diff --git a/.eslintignore b/.eslintignore index 4e26bfc06..331c2a7e0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -126,7 +126,6 @@ src/Explorer/Panes/GraphStylingPane.ts src/Explorer/Panes/NewVertexPane.ts src/Explorer/Panes/PaneComponents.ts src/Explorer/Panes/RenewAdHocAccessPane.ts -src/Explorer/Panes/SetupNotebooksPane.ts src/Explorer/Panes/StringInputPane.ts src/Explorer/Panes/SwitchDirectoryPane.ts src/Explorer/Panes/Tables/AddTableEntityPane.ts diff --git a/src/Explorer/ComponentRegisterer.test.ts b/src/Explorer/ComponentRegisterer.test.ts index 78e08fad1..626be3735 100644 --- a/src/Explorer/ComponentRegisterer.test.ts +++ b/src/Explorer/ComponentRegisterer.test.ts @@ -85,10 +85,6 @@ describe("Component Registerer", () => { expect(ko.components.isRegistered("string-input-pane")).toBe(true); }); - it("should register setup-notebooks-pane component", () => { - expect(ko.components.isRegistered("setup-notebooks-pane")).toBe(true); - }); - it("should register dynamic-list component", () => { expect(ko.components.isRegistered("dynamic-list")).toBe(true); }); diff --git a/src/Explorer/ComponentRegisterer.ts b/src/Explorer/ComponentRegisterer.ts index e3311cb3f..a39a2ad33 100644 --- a/src/Explorer/ComponentRegisterer.ts +++ b/src/Explorer/ComponentRegisterer.ts @@ -62,5 +62,4 @@ ko.components.register("table-add-entity-pane", new PaneComponents.TableAddEntit ko.components.register("table-edit-entity-pane", new PaneComponents.TableEditEntityPaneComponent()); ko.components.register("cassandra-add-collection-pane", new PaneComponents.CassandraAddCollectionPaneComponent()); ko.components.register("string-input-pane", new PaneComponents.StringInputPaneComponent()); -ko.components.register("setup-notebooks-pane", new PaneComponents.SetupNotebooksPaneComponent()); ko.components.register("github-repos-pane", new PaneComponents.GitHubReposPaneComponent()); diff --git a/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap b/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap index db1ece0ab..af32c25a4 100644 --- a/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap +++ b/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap @@ -324,20 +324,6 @@ exports[`SettingsComponent renders 1`] = ` "title": [Function], "visible": [Function], }, - SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, ], "_refreshSparkEnabledStateForAccount": [Function], "_resetNotebookWorkspace": [Function], @@ -722,20 +708,6 @@ exports[`SettingsComponent renders 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "setupNotebooksPane": SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { @@ -1086,20 +1058,6 @@ exports[`SettingsComponent renders 1`] = ` "title": [Function], "visible": [Function], }, - SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, ], "_refreshSparkEnabledStateForAccount": [Function], "_resetNotebookWorkspace": [Function], @@ -1484,20 +1442,6 @@ exports[`SettingsComponent renders 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "setupNotebooksPane": SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { @@ -1861,20 +1805,6 @@ exports[`SettingsComponent renders 1`] = ` "title": [Function], "visible": [Function], }, - SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, ], "_refreshSparkEnabledStateForAccount": [Function], "_resetNotebookWorkspace": [Function], @@ -2259,20 +2189,6 @@ exports[`SettingsComponent renders 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "setupNotebooksPane": SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { @@ -2623,20 +2539,6 @@ exports[`SettingsComponent renders 1`] = ` "title": [Function], "visible": [Function], }, - SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, ], "_refreshSparkEnabledStateForAccount": [Function], "_resetNotebookWorkspace": [Function], @@ -3021,20 +2923,6 @@ exports[`SettingsComponent renders 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "setupNotebooksPane": SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index 19a559458..a9d538df2 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -61,7 +61,7 @@ import { LoadQueryPanel } from "./Panes/LoadQueryPanel"; import NewVertexPane from "./Panes/NewVertexPane"; import { SaveQueryPanel } from "./Panes/SaveQueryPanel"; import { SettingsPane } from "./Panes/SettingsPane"; -import { SetupNotebooksPane } from "./Panes/SetupNotebooksPane"; +import { SetupNoteBooksPanel } from "./Panes/SetupNotebooksPanel/SetupNotebooksPanel"; import { StringInputPane } from "./Panes/StringInputPane"; import AddTableEntityPane from "./Panes/Tables/AddTableEntityPane"; import EditTableEntityPane from "./Panes/Tables/EditTableEntityPane"; @@ -182,7 +182,6 @@ export default class Explorer { public newVertexPane: NewVertexPane; public cassandraAddCollectionPane: CassandraAddCollectionPane; public stringInputPane: StringInputPane; - public setupNotebooksPane: SetupNotebooksPane; public gitHubReposPane: ContextualPaneBase; public publishNotebookPaneAdapter: ReactAdapter; public copyNotebookPaneAdapter: ReactAdapter; @@ -288,7 +287,6 @@ export default class Explorer { ((await this._containsDefaultNotebookWorkspace(this.databaseAccount())) || userContext.features.enableNotebooks) ); - TelemetryProcessor.trace(Action.NotebookEnabled, ActionModifiers.Mark, { isNotebookEnabled: this.isNotebookEnabled(), dataExplorerArea: Constants.Areas.Notebook, @@ -551,13 +549,6 @@ export default class Explorer { container: this, }); - this.setupNotebooksPane = new SetupNotebooksPane({ - id: "setupnotebookspane", - visible: ko.observable(false), - - container: this, - }); - this.tabsManager = params?.tabsManager ?? new TabsManager(); this.tabsManager.openedTabs.subscribe((tabs) => { if (tabs.length === 0) { @@ -575,7 +566,6 @@ export default class Explorer { this.newVertexPane, this.cassandraAddCollectionPane, this.stringInputPane, - this.setupNotebooksPane, ]; this.addDatabaseText.subscribe((addDatabaseText: string) => this.addDatabasePane.title(addDatabaseText)); this.isTabsContentExpanded = ko.observable(false); @@ -2133,7 +2123,7 @@ export default class Explorer { const description = "You have not yet created a notebooks workspace for this account. To proceed and start using notebooks, we'll need to create a default notebooks workspace in this account."; - this.setupNotebooksPane.openWithTitleAndDescription(title, description); + this.openSetupNotebooksPanel(title, description); } public async handleOpenFileAction(path: string): Promise { @@ -2273,6 +2263,19 @@ export default class Explorer { ); } + public openSetupNotebooksPanel(title: string, description: string): void { + this.openSidePanel( + title, + this.expandConsole()} + panelTitle={title} + panelDescription={description} + /> + ); + } + public openTableSelectQueryPanel(queryViewModal: QueryViewModel): void { this.openSidePanel( "Select Column", diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx index 5bf8c5885..b59e0f526 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx +++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx @@ -445,7 +445,7 @@ function createEnableNotebooksButton(container: Explorer): CommandButtonComponen return { iconSrc: EnableNotebooksIcon, iconAlt: label, - onCommandClick: () => container.setupNotebooksPane.openWithTitleAndDescription(label, description), + onCommandClick: () => container.openSetupNotebooksPanel(label, description), commandButtonLabel: label, hasPopup: false, disabled: !container.isNotebooksEnabledForAccount(), @@ -482,7 +482,7 @@ function createOpenMongoTerminalButton(container: Explorer): CommandButtonCompon if (container.isNotebookEnabled()) { container.openNotebookTerminal(ViewModels.TerminalKind.Mongo); } else { - container.setupNotebooksPane.openWithTitleAndDescription(title, description); + container.openSetupNotebooksPanel(title, description); } }, commandButtonLabel: label, @@ -508,7 +508,7 @@ function createOpenCassandraTerminalButton(container: Explorer): CommandButtonCo if (container.isNotebookEnabled()) { container.openNotebookTerminal(ViewModels.TerminalKind.Cassandra); } else { - container.setupNotebooksPane.openWithTitleAndDescription(title, description); + container.openSetupNotebooksPanel(title, description); } }, commandButtonLabel: label, diff --git a/src/Explorer/Panes/BrowseQueriesPanel/index.test.tsx b/src/Explorer/Panes/BrowseQueriesPanel/index.test.tsx index 6bab81037..195aac75c 100644 --- a/src/Explorer/Panes/BrowseQueriesPanel/index.test.tsx +++ b/src/Explorer/Panes/BrowseQueriesPanel/index.test.tsx @@ -10,7 +10,7 @@ describe("Browse queries panel", () => { const fakeExplorer = {} as Explorer; fakeExplorer.canSaveQueries = ko.computed(() => true); const fakeClientQuery = {} as QueriesClient; - const fakeQueryData = {} as Query[]; + const fakeQueryData = [] as Query[]; fakeClientQuery.getQueries = async () => fakeQueryData; fakeExplorer.queriesClient = fakeClientQuery; const props = { diff --git a/src/Explorer/Panes/PaneComponents.ts b/src/Explorer/Panes/PaneComponents.ts index 107bc46dd..d9da4a530 100644 --- a/src/Explorer/Panes/PaneComponents.ts +++ b/src/Explorer/Panes/PaneComponents.ts @@ -4,7 +4,6 @@ import CassandraAddCollectionPaneTemplate from "./CassandraAddCollectionPane.htm import GitHubReposPaneTemplate from "./GitHubReposPane.html"; import GraphNewVertexPaneTemplate from "./GraphNewVertexPane.html"; import GraphStylingPaneTemplate from "./GraphStylingPane.html"; -import SetupNotebooksPaneTemplate from "./SetupNotebooksPane.html"; import StringInputPaneTemplate from "./StringInputPane.html"; import TableAddEntityPaneTemplate from "./Tables/TableAddEntityPane.html"; import TableEditEntityPaneTemplate from "./Tables/TableEditEntityPane.html"; @@ -86,15 +85,6 @@ export class StringInputPaneComponent { } } -export class SetupNotebooksPaneComponent { - constructor() { - return { - viewModel: PaneComponent, - template: SetupNotebooksPaneTemplate, - }; - } -} - export class GitHubReposPaneComponent { constructor() { return { diff --git a/src/Explorer/Panes/SettingsPane/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/SettingsPane/__snapshots__/index.test.tsx.snap index 0cf982b10..31fb1aa7c 100644 --- a/src/Explorer/Panes/SettingsPane/__snapshots__/index.test.tsx.snap +++ b/src/Explorer/Panes/SettingsPane/__snapshots__/index.test.tsx.snap @@ -300,20 +300,6 @@ exports[`Settings Pane should render Default properly 1`] = ` "title": [Function], "visible": [Function], }, - SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, ], "_refreshSparkEnabledStateForAccount": [Function], "_resetNotebookWorkspace": [Function], @@ -698,20 +684,6 @@ exports[`Settings Pane should render Default properly 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "setupNotebooksPane": SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { @@ -1185,20 +1157,6 @@ exports[`Settings Pane should render Gremlin properly 1`] = ` "title": [Function], "visible": [Function], }, - SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, ], "_refreshSparkEnabledStateForAccount": [Function], "_resetNotebookWorkspace": [Function], @@ -1583,20 +1541,6 @@ exports[`Settings Pane should render Gremlin properly 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "setupNotebooksPane": SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { diff --git a/src/Explorer/Panes/SetupNotebooksPane.html b/src/Explorer/Panes/SetupNotebooksPane.html deleted file mode 100644 index 20fbc53b2..000000000 --- a/src/Explorer/Panes/SetupNotebooksPane.html +++ /dev/null @@ -1,45 +0,0 @@ -
-
-
- -
-
- -
- -
- Close -
-
- - -
-
-
- -
-
-
-
- - -
- loading indicator image -
- -
-
diff --git a/src/Explorer/Panes/SetupNotebooksPane.ts b/src/Explorer/Panes/SetupNotebooksPane.ts deleted file mode 100644 index d19fe6e52..000000000 --- a/src/Explorer/Panes/SetupNotebooksPane.ts +++ /dev/null @@ -1,107 +0,0 @@ -import * as ViewModels from "../../Contracts/ViewModels"; -import { Action } from "../../Shared/Telemetry/TelemetryConstants"; -import { Areas, KeyCodes } from "../../Common/Constants"; -import { ConsoleDataType } from "../Menus/NotificationConsole/NotificationConsoleComponent"; -import { ContextualPaneBase } from "./ContextualPaneBase"; -import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; -import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; -import * as ko from "knockout"; -import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; - -export class SetupNotebooksPane extends ContextualPaneBase { - private description: ko.Observable; - - constructor(options: ViewModels.PaneOptions) { - super(options); - - this.description = ko.observable(); - this.resetData(); - } - - public openWithTitleAndDescription(title: string, description: string) { - this.title(title); - this.description(description); - - this.open(); - } - - public open() { - super.open(); - const completeSetupBtn = document.getElementById("completeSetupBtn"); - completeSetupBtn && completeSetupBtn.focus(); - } - - public submit() { - // override default behavior because this is not a form - } - - public onCompleteSetupClick = async (src: any, event: MouseEvent) => { - await this.setupNotebookWorkspace(); - }; - - public onCompleteSetupKeyPress = async (src: any, event: KeyboardEvent) => { - if (event.keyCode === KeyCodes.Space || event.keyCode === KeyCodes.Enter) { - await this.setupNotebookWorkspace(); - event.stopPropagation(); - return false; - } - return true; - }; - - public async setupNotebookWorkspace(): Promise { - if (!this.container) { - return; - } - - const startKey: number = TelemetryProcessor.traceStart(Action.CreateNotebookWorkspace, { - dataExplorerArea: Areas.ContextualPane, - paneTitle: this.title(), - }); - const id = NotificationConsoleUtils.logConsoleMessage( - ConsoleDataType.InProgress, - "Creating a new default notebook workspace" - ); - try { - this.isExecuting(true); - await this.container.notebookWorkspaceManager.createNotebookWorkspaceAsync( - this.container.databaseAccount() && this.container.databaseAccount().id, - "default" - ); - this.container.isAccountReady.valueHasMutated(); // re-trigger init notebooks - this.close(); - TelemetryProcessor.traceSuccess( - Action.CreateNotebookWorkspace, - { - dataExplorerArea: Areas.ContextualPane, - paneTitle: this.title(), - }, - startKey - ); - NotificationConsoleUtils.logConsoleMessage( - ConsoleDataType.Info, - "Successfully created a default notebook workspace for the account" - ); - } catch (error) { - const errorMessage = getErrorMessage(error); - TelemetryProcessor.traceFailure( - Action.CreateNotebookWorkspace, - { - dataExplorerArea: Areas.ContextualPane, - paneTitle: this.title(), - error: errorMessage, - errorStack: getErrorStack(error), - }, - startKey - ); - this.formErrors("Failed to setup a default notebook workspace"); - this.formErrorsDetails(`Failed to setup a default notebook workspace: ${errorMessage}`); - NotificationConsoleUtils.logConsoleMessage( - ConsoleDataType.Error, - `Failed to create a default notebook workspace: ${errorMessage}` - ); - } finally { - this.isExecuting(false); - NotificationConsoleUtils.clearInProgressMessageWithId(id); - } - } -} diff --git a/src/Explorer/Panes/SetupNotebooksPanel/SetupNotebooksPanel.test.tsx b/src/Explorer/Panes/SetupNotebooksPanel/SetupNotebooksPanel.test.tsx new file mode 100644 index 000000000..63e76a38e --- /dev/null +++ b/src/Explorer/Panes/SetupNotebooksPanel/SetupNotebooksPanel.test.tsx @@ -0,0 +1,50 @@ +import { mount } from "enzyme"; +import { PrimaryButton } from "office-ui-fabric-react"; +import React from "react"; +import Explorer from "../../Explorer"; +import { SetupNoteBooksPanel } from "./SetupNotebooksPanel"; + +describe("Setup Notebooks Panel", () => { + it("should render Default properly", () => { + const fakeExplorer = {} as Explorer; + const props = { + explorer: fakeExplorer, + closePanel: (): void => undefined, + openNotificationConsole: (): void => undefined, + panelTitle: "", + panelDescription: "", + }; + const wrapper = mount(); + expect(wrapper).toMatchSnapshot(); + }); + + it("should render button", () => { + const fakeExplorer = {} as Explorer; + const props = { + explorer: fakeExplorer, + closePanel: (): void => undefined, + openNotificationConsole: (): void => undefined, + panelTitle: "", + panelDescription: "", + }; + const wrapper = mount(); + const button = wrapper.find("PrimaryButton").first(); + expect(button).toBeDefined(); + }); + + it("Button onClick should call onCompleteSetup", () => { + const onCompleteSetupClick = jest.fn(); + const wrapper = mount(); + wrapper.find("button").simulate("click"); + + expect(onCompleteSetupClick).toHaveBeenCalled(); + }); + + it("Button onKeyPress should call onCompleteSetupKeyPress", () => { + const onCompleteSetupKeyPress = jest.fn(); + const wrapper = mount(); + wrapper.find("button").simulate("keypress"); + + expect(onCompleteSetupKeyPress).toHaveBeenCalled(); + }); +}); diff --git a/src/Explorer/Panes/SetupNotebooksPanel/SetupNotebooksPanel.tsx b/src/Explorer/Panes/SetupNotebooksPanel/SetupNotebooksPanel.tsx new file mode 100644 index 000000000..48a98a2d3 --- /dev/null +++ b/src/Explorer/Panes/SetupNotebooksPanel/SetupNotebooksPanel.tsx @@ -0,0 +1,125 @@ +import { useBoolean } from "@uifabric/react-hooks"; +import { PrimaryButton } from "office-ui-fabric-react"; +import React, { FunctionComponent, KeyboardEvent, useState } from "react"; +import { Areas, NormalizedEventKey } from "../../../Common/Constants"; +import { getErrorMessage, getErrorStack } from "../../../Common/ErrorHandlingUtils"; +import { Action } from "../../../Shared/Telemetry/TelemetryConstants"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import { userContext } from "../../../UserContext"; +import * as NotificationConsoleUtils from "../../../Utils/NotificationConsoleUtils"; +import Explorer from "../../Explorer"; +import { PanelInfoErrorComponent } from "../PanelInfoErrorComponent"; +import { PanelLoadingScreen } from "../PanelLoadingScreen"; +interface SetupNoteBooksPanelProps { + explorer: Explorer; + closePanel: () => void; + openNotificationConsole: () => void; + panelTitle: string; + panelDescription: string; +} + +export const SetupNoteBooksPanel: FunctionComponent = ({ + explorer, + closePanel, + openNotificationConsole, + panelTitle, + panelDescription, +}: SetupNoteBooksPanelProps): JSX.Element => { + const title = panelTitle; + const description = panelDescription; + const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false); + const [errorMessage, setErrorMessage] = useState(""); + const [showErrorDetails, setShowErrorDetails] = useState(false); + + const onCompleteSetupClick = async () => { + await setupNotebookWorkspace(); + }; + + const onCompleteSetupKeyPress = async (event: KeyboardEvent) => { + if (event.key === " " || event.key === NormalizedEventKey.Enter) { + await setupNotebookWorkspace(); + event.stopPropagation(); + return false; + } + return true; + }; + + const setupNotebookWorkspace = async (): Promise => { + if (!explorer) { + return; + } + + const startKey: number = TelemetryProcessor.traceStart(Action.CreateNotebookWorkspace, { + dataExplorerArea: Areas.ContextualPane, + paneTitle: title, + }); + + const clear = NotificationConsoleUtils.logConsoleProgress("Creating a new default notebook workspace"); + + try { + setLoadingTrue(); + await explorer.notebookWorkspaceManager.createNotebookWorkspaceAsync( + userContext.databaseAccount && userContext.databaseAccount.id, + "default" + ); + explorer.isAccountReady.valueHasMutated(); // re-trigger init notebooks + + closePanel(); + + TelemetryProcessor.traceSuccess( + Action.CreateNotebookWorkspace, + { + dataExplorerArea: Areas.ContextualPane, + paneTitle: title, + }, + startKey + ); + NotificationConsoleUtils.logConsoleInfo("Successfully created a default notebook workspace for the account"); + } catch (error) { + const errorMessage = getErrorMessage(error); + TelemetryProcessor.traceFailure( + Action.CreateNotebookWorkspace, + { + dataExplorerArea: Areas.ContextualPane, + paneTitle: title, + error: errorMessage, + errorStack: getErrorStack(error), + }, + startKey + ); + setErrorMessage(`Failed to setup a default notebook workspace: ${errorMessage}`); + setShowErrorDetails(true); + NotificationConsoleUtils.logConsoleError(`Failed to create a default notebook workspace: ${errorMessage}`); + } finally { + setLoadingFalse(); + clear(); + } + }; + + return ( +
+ {errorMessage && ( + + )} +
+
+
{description}
+ +
+
+ {isLoading && } + + ); +}; diff --git a/src/Explorer/Panes/SetupNotebooksPanel/__snapshots__/SetupNotebooksPanel.test.tsx.snap b/src/Explorer/Panes/SetupNotebooksPanel/__snapshots__/SetupNotebooksPanel.test.tsx.snap new file mode 100644 index 000000000..356024d46 --- /dev/null +++ b/src/Explorer/Panes/SetupNotebooksPanel/__snapshots__/SetupNotebooksPanel.test.tsx.snap @@ -0,0 +1,1745 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Setup Notebooks Panel should render Default properly 1`] = ` + +
+
+
+
+ + + + + *": Object { + "left": 0, + "position": "relative", + "top": 0, + }, + }, + "textAlign": "center", + "textDecoration": "none", + "userSelect": "none", + }, + Object { + "height": "32px", + "minWidth": "80px", + }, + Object { + "backgroundColor": "#0078d4", + "border": "1px solid #0078d4", + "color": "#ffffff", + "selectors": Object { + ".ms-Fabric--isFocusVisible &:focus": Object { + "selectors": Object { + ":after": Object { + "border": "none", + "outlineColor": "#ffffff", + }, + }, + }, + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "MsHighContrastAdjust": "none", + "backgroundColor": "WindowText", + "borderColor": "WindowText", + "color": "Window", + "forcedColorAdjust": "none", + }, + }, + }, + ], + "rootChecked": Object { + "backgroundColor": "#005a9e", + "color": "#ffffff", + }, + "rootCheckedHovered": Object { + "backgroundColor": "#005a9e", + "color": "#ffffff", + }, + "rootDisabled": Array [ + Object { + "outline": "transparent", + "position": "relative", + "selectors": Object { + ".ms-Fabric--isFocusVisible &:focus:after": Object { + "border": "1px solid transparent", + "bottom": 2, + "content": "\\"\\"", + "left": 2, + "outline": "1px solid #605e5c", + "position": "absolute", + "right": 2, + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "bottom": -2, + "left": -2, + "outlineColor": "ButtonText", + "right": -2, + "top": -2, + }, + }, + "top": 2, + "zIndex": 1, + }, + "::-moz-focus-inner": Object { + "border": "0", + }, + }, + }, + Object { + "backgroundColor": "#f3f2f1", + "borderColor": "#f3f2f1", + "color": "#a19f9d", + "cursor": "default", + "pointerEvents": "none", + "selectors": Object { + ":focus": Object { + "outline": 0, + }, + ":hover": Object { + "outline": 0, + }, + }, + }, + Object { + "backgroundColor": "#f3f2f1", + "color": "#d2d0ce", + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "Window", + "borderColor": "GrayText", + "color": "GrayText", + }, + }, + }, + ], + "rootExpanded": Object { + "backgroundColor": "#005a9e", + "color": "#ffffff", + }, + "rootHovered": Object { + "backgroundColor": "#106ebe", + "border": "1px solid #106ebe", + "color": "#ffffff", + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "Highlight", + "borderColor": "Highlight", + "color": "Window", + }, + }, + }, + "rootPressed": Object { + "backgroundColor": "#005a9e", + "border": "1px solid #005a9e", + "color": "#ffffff", + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "MsHighContrastAdjust": "none", + "backgroundColor": "WindowText", + "borderColor": "WindowText", + "color": "Window", + "forcedColorAdjust": "none", + }, + }, + }, + "screenReaderText": Object { + "border": 0, + "height": 1, + "margin": -1, + "overflow": "hidden", + "padding": 0, + "position": "absolute", + "width": 1, + }, + "splitButtonContainer": Array [ + Object { + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "border": "none", + }, + }, + }, + Object { + "outline": "transparent", + "position": "relative", + "selectors": Object { + ".ms-Fabric--isFocusVisible &:focus:after": Object { + "border": "1px solid #ffffff", + "bottom": 3, + "content": "\\"\\"", + "left": 3, + "outline": "1px solid #605e5c", + "position": "absolute", + "right": 3, + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "border": "none", + "bottom": -2, + "left": -2, + "right": -2, + "top": -2, + }, + }, + "top": 3, + "zIndex": 1, + }, + "::-moz-focus-inner": Object { + "border": "0", + }, + }, + }, + Object { + "display": "inline-flex", + "selectors": Object { + ".ms-Button--default": Object { + "borderBottomRightRadius": "0", + "borderRight": "none", + "borderTopRightRadius": "0", + }, + ".ms-Button--primary": Object { + "border": "none", + "borderBottomRightRadius": "0", + "borderTopRightRadius": "0", + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "MsHighContrastAdjust": "none", + "backgroundColor": "Window", + "border": "1px solid WindowText", + "borderRightWidth": "0", + "color": "WindowText", + "forcedColorAdjust": "none", + }, + }, + }, + ".ms-Button--primary + .ms-Button": Object { + "border": "none", + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "border": "1px solid WindowText", + "borderLeftWidth": "0", + }, + }, + }, + }, + }, + ], + "splitButtonContainerChecked": Object { + "selectors": Object { + ".ms-Button--primary": Object { + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "MsHighContrastAdjust": "none", + "backgroundColor": "WindowText", + "color": "Window", + "forcedColorAdjust": "none", + }, + }, + }, + }, + }, + "splitButtonContainerCheckedHovered": Object { + "selectors": Object { + ".ms-Button--primary": Object { + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "MsHighContrastAdjust": "none", + "backgroundColor": "WindowText", + "color": "Window", + "forcedColorAdjust": "none", + }, + }, + }, + }, + }, + "splitButtonContainerDisabled": Object { + "border": "none", + "outline": "none", + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "MsHighContrastAdjust": "none", + "backgroundColor": "Window", + "borderColor": "GrayText", + "color": "GrayText", + "forcedColorAdjust": "none", + }, + }, + }, + "splitButtonContainerFocused": Object { + "outline": "none!important", + }, + "splitButtonContainerHovered": Object { + "selectors": Object { + ".ms-Button--primary": Object { + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "Highlight", + "color": "Window", + }, + }, + }, + ".ms-Button.is-disabled": Object { + "color": "#a19f9d", + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "Window", + "borderColor": "GrayText", + "color": "GrayText", + }, + }, + }, + }, + }, + "splitButtonDivider": Array [ + Object { + "backgroundColor": "#ffffff", + "bottom": 8, + "position": "absolute", + "right": 31, + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "Window", + }, + }, + "top": 8, + "width": 1, + }, + Object { + "bottom": 8, + "position": "absolute", + "right": 31, + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "WindowText", + }, + }, + "top": 8, + "width": 1, + }, + ], + "splitButtonDividerDisabled": Object { + "bottom": 8, + "position": "absolute", + "right": 31, + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "GrayText", + }, + }, + "top": 8, + "width": 1, + }, + "splitButtonFlexContainer": Object { + "alignItems": "center", + "display": "flex", + "flexWrap": "nowrap", + "height": "100%", + "justifyContent": "center", + }, + "splitButtonMenuButton": Array [ + Object { + "backgroundColor": "#0078d4", + "color": "#ffffff", + "selectors": Object { + ":hover": Object { + "backgroundColor": "#106ebe", + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "color": "Highlight", + }, + }, + }, + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "WindowText", + }, + }, + }, + Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + ".ms-Button-menuIcon": Object { + "color": "WindowText", + }, + }, + "border": "1px solid #8a8886", + "borderBottomRightRadius": "2px", + "borderLeft": "none", + "borderRadius": 0, + "borderTopRightRadius": "2px", + "boxSizing": "border-box", + "cursor": "pointer", + "display": "inline-block", + "height": "auto", + "marginBottom": 0, + "marginLeft": -1, + "marginRight": 0, + "marginTop": 0, + "outline": "transparent", + "padding": 6, + "textAlign": "center", + "textDecoration": "none", + "userSelect": "none", + "verticalAlign": "top", + "width": 32, + }, + ], + "splitButtonMenuButtonChecked": Object { + "backgroundColor": "#005a9e", + "selectors": Object { + ":hover": Object { + "backgroundColor": "#005a9e", + }, + }, + }, + "splitButtonMenuButtonDisabled": Array [ + Object { + "backgroundColor": "#f3f2f1", + "selectors": Object { + ":hover": Object { + "backgroundColor": "#f3f2f1", + }, + }, + }, + Object { + "border": "none", + "pointerEvents": "none", + "selectors": Object { + ".ms-Button--primary": Object { + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "Window", + "borderColor": "GrayText", + "color": "GrayText", + }, + }, + }, + ".ms-Button-menuIcon": Object { + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "color": "GrayText", + }, + }, + }, + ":hover": Object { + "cursor": "default", + }, + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "backgroundColor": "Window", + "border": "1px solid GrayText", + "color": "GrayText", + }, + }, + }, + ], + "splitButtonMenuButtonExpanded": Object { + "backgroundColor": "#005a9e", + "selectors": Object { + ":hover": Object { + "backgroundColor": "#005a9e", + }, + }, + }, + "splitButtonMenuIcon": Object { + "color": "#ffffff", + }, + "splitButtonMenuIconDisabled": Object { + "color": "#a19f9d", + "selectors": Object { + "@media screen and (-ms-high-contrast: active), (forced-colors: active)": Object { + "color": "GrayText", + }, + }, + }, + "textContainer": Object { + "display": "block", + "flexGrow": 1, + }, + } + } + text="Complete Setup" + theme={ + Object { + "disableGlobalClassNames": false, + "effects": Object { + "elevation16": "0 6.4px 14.4px 0 rgba(0, 0, 0, 0.132), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.108)", + "elevation4": "0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108)", + "elevation64": "0 25.6px 57.6px 0 rgba(0, 0, 0, 0.22), 0 4.8px 14.4px 0 rgba(0, 0, 0, 0.18)", + "elevation8": "0 3.2px 7.2px 0 rgba(0, 0, 0, 0.132), 0 0.6px 1.8px 0 rgba(0, 0, 0, 0.108)", + "roundedCorner2": "2px", + "roundedCorner4": "4px", + "roundedCorner6": "6px", + }, + "fonts": Object { + "large": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "18px", + "fontWeight": 400, + }, + "medium": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "14px", + "fontWeight": 400, + }, + "mediumPlus": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "16px", + "fontWeight": 400, + }, + "mega": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "68px", + "fontWeight": 600, + }, + "small": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "12px", + "fontWeight": 400, + }, + "smallPlus": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "12px", + "fontWeight": 400, + }, + "superLarge": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "42px", + "fontWeight": 600, + }, + "tiny": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "10px", + "fontWeight": 400, + }, + "xLarge": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "20px", + "fontWeight": 600, + }, + "xLargePlus": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "24px", + "fontWeight": 600, + }, + "xSmall": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "10px", + "fontWeight": 400, + }, + "xxLarge": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "28px", + "fontWeight": 600, + }, + "xxLargePlus": Object { + "MozOsxFontSmoothing": "grayscale", + "WebkitFontSmoothing": "antialiased", + "fontFamily": "'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif", + "fontSize": "32px", + "fontWeight": 600, + }, + }, + "isInverted": false, + "palette": Object { + "accent": "#0078d4", + "black": "#000000", + "blackTranslucent40": "rgba(0,0,0,.4)", + "blue": "#0078d4", + "blueDark": "#002050", + "blueLight": "#00bcf2", + "blueMid": "#00188f", + "green": "#107c10", + "greenDark": "#004b1c", + "greenLight": "#bad80a", + "magenta": "#b4009e", + "magentaDark": "#5c005c", + "magentaLight": "#e3008c", + "neutralDark": "#201f1e", + "neutralLight": "#edebe9", + "neutralLighter": "#f3f2f1", + "neutralLighterAlt": "#faf9f8", + "neutralPrimary": "#323130", + "neutralPrimaryAlt": "#3b3a39", + "neutralQuaternary": "#d2d0ce", + "neutralQuaternaryAlt": "#e1dfdd", + "neutralSecondary": "#605e5c", + "neutralSecondaryAlt": "#8a8886", + "neutralTertiary": "#a19f9d", + "neutralTertiaryAlt": "#c8c6c4", + "orange": "#d83b01", + "orangeLight": "#ea4300", + "orangeLighter": "#ff8c00", + "purple": "#5c2d91", + "purpleDark": "#32145a", + "purpleLight": "#b4a0ff", + "red": "#e81123", + "redDark": "#a4262c", + "teal": "#008272", + "tealDark": "#004b50", + "tealLight": "#00b294", + "themeDark": "#005a9e", + "themeDarkAlt": "#106ebe", + "themeDarker": "#004578", + "themeLight": "#c7e0f4", + "themeLighter": "#deecf9", + "themeLighterAlt": "#eff6fc", + "themePrimary": "#0078d4", + "themeSecondary": "#2b88d8", + "themeTertiary": "#71afe5", + "white": "#ffffff", + "whiteTranslucent40": "rgba(255,255,255,.4)", + "yellow": "#ffb900", + "yellowDark": "#d29200", + "yellowLight": "#fff100", + }, + "rtl": undefined, + "semanticColors": Object { + "accentButtonBackground": "#0078d4", + "accentButtonText": "#ffffff", + "actionLink": "#323130", + "actionLinkHovered": "#201f1e", + "blockingBackground": "#FDE7E9", + "blockingIcon": "#FDE7E9", + "bodyBackground": "#ffffff", + "bodyBackgroundChecked": "#edebe9", + "bodyBackgroundHovered": "#f3f2f1", + "bodyDivider": "#edebe9", + "bodyFrameBackground": "#ffffff", + "bodyFrameDivider": "#edebe9", + "bodyStandoutBackground": "#faf9f8", + "bodySubtext": "#605e5c", + "bodyText": "#323130", + "bodyTextChecked": "#000000", + "buttonBackground": "#ffffff", + "buttonBackgroundChecked": "#c8c6c4", + "buttonBackgroundCheckedHovered": "#edebe9", + "buttonBackgroundDisabled": "#f3f2f1", + "buttonBackgroundHovered": "#f3f2f1", + "buttonBackgroundPressed": "#edebe9", + "buttonBorder": "#8a8886", + "buttonBorderDisabled": "#f3f2f1", + "buttonText": "#323130", + "buttonTextChecked": "#201f1e", + "buttonTextCheckedHovered": "#000000", + "buttonTextDisabled": "#a19f9d", + "buttonTextHovered": "#201f1e", + "buttonTextPressed": "#201f1e", + "cardShadow": "0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108)", + "cardShadowHovered": "0 3.2px 7.2px 0 rgba(0, 0, 0, 0.132), 0 0.6px 1.8px 0 rgba(0, 0, 0, 0.108)", + "cardStandoutBackground": "#ffffff", + "defaultStateBackground": "#faf9f8", + "disabledBackground": "#f3f2f1", + "disabledBodySubtext": "#c8c6c4", + "disabledBodyText": "#a19f9d", + "disabledBorder": "#c8c6c4", + "disabledSubtext": "#d2d0ce", + "disabledText": "#a19f9d", + "errorBackground": "#FDE7E9", + "errorIcon": "#A80000", + "errorText": "#a4262c", + "focusBorder": "#605e5c", + "infoBackground": "#f3f2f1", + "infoIcon": "#605e5c", + "inputBackground": "#ffffff", + "inputBackgroundChecked": "#0078d4", + "inputBackgroundCheckedHovered": "#005a9e", + "inputBorder": "#605e5c", + "inputBorderHovered": "#323130", + "inputFocusBorderAlt": "#0078d4", + "inputForegroundChecked": "#ffffff", + "inputIcon": "#0078d4", + "inputIconDisabled": "#a19f9d", + "inputIconHovered": "#005a9e", + "inputPlaceholderBackgroundChecked": "#deecf9", + "inputPlaceholderText": "#605e5c", + "inputText": "#323130", + "inputTextHovered": "#201f1e", + "link": "#0078d4", + "linkHovered": "#004578", + "listBackground": "#ffffff", + "listHeaderBackgroundHovered": "#f3f2f1", + "listHeaderBackgroundPressed": "#edebe9", + "listItemBackgroundChecked": "#edebe9", + "listItemBackgroundCheckedHovered": "#e1dfdd", + "listItemBackgroundHovered": "#f3f2f1", + "listText": "#323130", + "listTextColor": "#323130", + "menuBackground": "#ffffff", + "menuDivider": "#c8c6c4", + "menuHeader": "#0078d4", + "menuIcon": "#0078d4", + "menuItemBackgroundChecked": "#edebe9", + "menuItemBackgroundHovered": "#f3f2f1", + "menuItemBackgroundPressed": "#edebe9", + "menuItemText": "#323130", + "menuItemTextHovered": "#201f1e", + "messageLink": "#005A9E", + "messageLinkHovered": "#004578", + "messageText": "#323130", + "primaryButtonBackground": "#0078d4", + "primaryButtonBackgroundDisabled": "#f3f2f1", + "primaryButtonBackgroundHovered": "#106ebe", + "primaryButtonBackgroundPressed": "#005a9e", + "primaryButtonBorder": "transparent", + "primaryButtonText": "#ffffff", + "primaryButtonTextDisabled": "#d2d0ce", + "primaryButtonTextHovered": "#ffffff", + "primaryButtonTextPressed": "#ffffff", + "severeWarningBackground": "#FED9CC", + "severeWarningIcon": "#D83B01", + "smallInputBorder": "#605e5c", + "successBackground": "#DFF6DD", + "successIcon": "#107C10", + "successText": "#107C10", + "variantBorder": "#edebe9", + "variantBorderHovered": "#a19f9d", + "warningBackground": "#FFF4CE", + "warningHighlight": "#ffb900", + "warningIcon": "#797775", + "warningText": "#323130", + }, + "spacing": Object { + "l1": "20px", + "l2": "32px", + "m": "16px", + "s1": "8px", + "s2": "4px", + }, + } + } + variantClassName="ms-Button--primary" + > + + + + + + + +
+
+ + +`; diff --git a/src/Explorer/Panes/UploadItemsPane/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/UploadItemsPane/__snapshots__/index.test.tsx.snap index 64fee8529..1863eb33d 100644 --- a/src/Explorer/Panes/UploadItemsPane/__snapshots__/index.test.tsx.snap +++ b/src/Explorer/Panes/UploadItemsPane/__snapshots__/index.test.tsx.snap @@ -300,20 +300,6 @@ exports[`Upload Items Pane should render Default properly 1`] = ` "title": [Function], "visible": [Function], }, - SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, ], "_refreshSparkEnabledStateForAccount": [Function], "_resetNotebookWorkspace": [Function], @@ -698,20 +684,6 @@ exports[`Upload Items Pane should render Default properly 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "setupNotebooksPane": SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { diff --git a/src/Explorer/Panes/__snapshots__/DeleteDatabaseConfirmationPanel.test.tsx.snap b/src/Explorer/Panes/__snapshots__/DeleteDatabaseConfirmationPanel.test.tsx.snap index 69fa8c792..08c7d2d8c 100644 --- a/src/Explorer/Panes/__snapshots__/DeleteDatabaseConfirmationPanel.test.tsx.snap +++ b/src/Explorer/Panes/__snapshots__/DeleteDatabaseConfirmationPanel.test.tsx.snap @@ -301,20 +301,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database "title": [Function], "visible": [Function], }, - SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, ], "_refreshSparkEnabledStateForAccount": [Function], "_resetNotebookWorkspace": [Function], @@ -703,20 +689,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "setupNotebooksPane": SetupNotebooksPane { - "container": [Circular], - "description": [Function], - "firstFieldHasFocus": [Function], - "formErrors": [Function], - "formErrorsDetails": [Function], - "id": "setupnotebookspane", - "isExecuting": [Function], - "isTemplateReady": [Function], - "onCompleteSetupClick": [Function], - "onCompleteSetupKeyPress": [Function], - "title": [Function], - "visible": [Function], - }, "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { diff --git a/src/Main.tsx b/src/Main.tsx index 5f0c0bcc8..ae9c400b7 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -238,7 +238,6 @@ const App: React.FunctionComponent = () => {
-