From 8d46aef40c77f32a651a0162e27fdf7d9145613d Mon Sep 17 00:00:00 2001 From: Karl Burtram Date: Sat, 2 May 2020 10:27:47 -0700 Subject: [PATCH] Port/welcomeflag (#10254) * Put new welcome page behind preview features flag (#10099) * import correct welcome page (#10117) Co-authored-by: Anthony Dresser --- .../browser/abstractEnablePreviewFeatures.ts | 67 +++++++++++ .../browser/enablePreviewFeatures.ts | 28 +++++ .../browser/gettingStarted.contribution.ts | 13 +++ .../electron-browser/enablePreviewFeatures.ts | 30 +++++ .../gettingStarted.contribution.ts | 13 +++ .../page/browser/az_data_welcome_page.ts | 76 +++++++++++++ .../page/browser/welcomePage.contribution.ts | 34 +++++- .../welcome/page/browser/welcomePage.css | 104 +++++++++--------- .../welcome/page/browser/welcomePage.ts | 28 ++--- 9 files changed, 321 insertions(+), 72 deletions(-) create mode 100644 src/sql/workbench/contrib/welcome2/gettingStarted/browser/abstractEnablePreviewFeatures.ts create mode 100644 src/sql/workbench/contrib/welcome2/gettingStarted/browser/enablePreviewFeatures.ts create mode 100644 src/sql/workbench/contrib/welcome2/gettingStarted/browser/gettingStarted.contribution.ts create mode 100644 src/sql/workbench/contrib/welcome2/gettingStarted/electron-browser/enablePreviewFeatures.ts create mode 100644 src/sql/workbench/contrib/welcome2/gettingStarted/electron-browser/gettingStarted.contribution.ts create mode 100644 src/sql/workbench/contrib/welcome2/page/browser/az_data_welcome_page.ts diff --git a/src/sql/workbench/contrib/welcome2/gettingStarted/browser/abstractEnablePreviewFeatures.ts b/src/sql/workbench/contrib/welcome2/gettingStarted/browser/abstractEnablePreviewFeatures.ts new file mode 100644 index 0000000000..2313d4c804 --- /dev/null +++ b/src/sql/workbench/contrib/welcome2/gettingStarted/browser/abstractEnablePreviewFeatures.ts @@ -0,0 +1,67 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; +import { localize } from 'vs/nls'; +import { onUnexpectedError } from 'vs/base/common/errors'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IHostService } from 'vs/workbench/services/host/browser/host'; + +export abstract class AbstractEnablePreviewFeatures implements IWorkbenchContribution { + + private static ENABLE_PREVIEW_FEATURES_SHOWN = 'workbench.enablePreviewFeaturesShown'; + + constructor( + @IStorageService private readonly storageService: IStorageService, + @INotificationService private readonly notificationService: INotificationService, + @IHostService private readonly hostService: IHostService, + @IConfigurationService private readonly configurationService: IConfigurationService + ) { } + + protected handlePreviewFeatures(): void { + let previewFeaturesEnabled = this.configurationService.getValue('workbench')['enablePreviewFeatures']; + if (previewFeaturesEnabled || this.storageService.get(AbstractEnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN, StorageScope.GLOBAL)) { + return; + } + Promise.all([ + this.hostService.hasFocus, + this.getWindowCount() + ]).then(async ([focused, count]) => { + if (!focused && count > 1) { + return null; + } + await this.configurationService.updateValue('workbench.enablePreviewFeatures', false); + + const enablePreviewFeaturesNotice = localize('enablePreviewFeatures.notice', "Preview features are required in order for extensions to be fully supported and for some actions to be available. Would you like to enable preview features?"); + this.notificationService.prompt( + Severity.Info, + enablePreviewFeaturesNotice, + [{ + label: localize('enablePreviewFeatures.yes', "Yes"), + run: () => { + this.configurationService.updateValue('workbench.enablePreviewFeatures', true).catch(e => onUnexpectedError(e)); + this.storageService.store(AbstractEnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN, true, StorageScope.GLOBAL); + } + }, { + label: localize('enablePreviewFeatures.no', "No"), + run: () => { + this.configurationService.updateValue('workbench.enablePreviewFeatures', false).catch(e => onUnexpectedError(e)); + } + }, { + label: localize('enablePreviewFeatures.never', "No, don't show again"), + run: () => { + this.configurationService.updateValue('workbench.enablePreviewFeatures', false).catch(e => onUnexpectedError(e)); + this.storageService.store(AbstractEnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN, true, StorageScope.GLOBAL); + }, + isSecondary: true + }] + ); + }).catch(e => onUnexpectedError(e)); + } + + protected abstract getWindowCount(): Promise; +} diff --git a/src/sql/workbench/contrib/welcome2/gettingStarted/browser/enablePreviewFeatures.ts b/src/sql/workbench/contrib/welcome2/gettingStarted/browser/enablePreviewFeatures.ts new file mode 100644 index 0000000000..2ce21fe847 --- /dev/null +++ b/src/sql/workbench/contrib/welcome2/gettingStarted/browser/enablePreviewFeatures.ts @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { AbstractEnablePreviewFeatures } from 'sql/workbench/contrib/welcome/gettingStarted/browser/abstractEnablePreviewFeatures'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { INotificationService } from 'vs/platform/notification/common/notification'; +import { IHostService } from 'vs/workbench/services/host/browser/host'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; + +export class BrowserEnablePreviewFeatures extends AbstractEnablePreviewFeatures { + + constructor( + @IStorageService storageService: IStorageService, + @INotificationService notificationService: INotificationService, + @IHostService hostService: IHostService, + @IConfigurationService configurationService: IConfigurationService + ) { + super(storageService, notificationService, hostService, configurationService); + + this.handlePreviewFeatures(); + } + + protected async getWindowCount(): Promise { + return 1; + } +} diff --git a/src/sql/workbench/contrib/welcome2/gettingStarted/browser/gettingStarted.contribution.ts b/src/sql/workbench/contrib/welcome2/gettingStarted/browser/gettingStarted.contribution.ts new file mode 100644 index 0000000000..43e0a8b72f --- /dev/null +++ b/src/sql/workbench/contrib/welcome2/gettingStarted/browser/gettingStarted.contribution.ts @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Registry } from 'vs/platform/registry/common/platform'; +import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; +import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; +import { BrowserEnablePreviewFeatures } from 'sql/workbench/contrib/welcome/gettingStarted/browser/enablePreviewFeatures'; + +Registry + .as(WorkbenchExtensions.Workbench) + .registerWorkbenchContribution(BrowserEnablePreviewFeatures, LifecyclePhase.Eventually); diff --git a/src/sql/workbench/contrib/welcome2/gettingStarted/electron-browser/enablePreviewFeatures.ts b/src/sql/workbench/contrib/welcome2/gettingStarted/electron-browser/enablePreviewFeatures.ts new file mode 100644 index 0000000000..be1424fe48 --- /dev/null +++ b/src/sql/workbench/contrib/welcome2/gettingStarted/electron-browser/enablePreviewFeatures.ts @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { AbstractEnablePreviewFeatures } from 'sql/workbench/contrib/welcome/gettingStarted/browser/abstractEnablePreviewFeatures'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { INotificationService } from 'vs/platform/notification/common/notification'; +import { IHostService } from 'vs/workbench/services/host/browser/host'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IElectronService } from 'vs/platform/electron/node/electron'; + +export class NativeEnablePreviewFeatures extends AbstractEnablePreviewFeatures { + + constructor( + @IStorageService storageService: IStorageService, + @INotificationService notificationService: INotificationService, + @IHostService hostService: IHostService, + @IConfigurationService configurationService: IConfigurationService, + @IElectronService private readonly electronService: IElectronService + ) { + super(storageService, notificationService, hostService, configurationService); + + this.handlePreviewFeatures(); + } + + protected getWindowCount(): Promise { + return this.electronService.getWindowCount(); + } +} diff --git a/src/sql/workbench/contrib/welcome2/gettingStarted/electron-browser/gettingStarted.contribution.ts b/src/sql/workbench/contrib/welcome2/gettingStarted/electron-browser/gettingStarted.contribution.ts new file mode 100644 index 0000000000..94b6eee9cd --- /dev/null +++ b/src/sql/workbench/contrib/welcome2/gettingStarted/electron-browser/gettingStarted.contribution.ts @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Registry } from 'vs/platform/registry/common/platform'; +import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; +import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; +import { NativeEnablePreviewFeatures } from 'sql/workbench/contrib/welcome/gettingStarted/electron-browser/enablePreviewFeatures'; + +Registry + .as(WorkbenchExtensions.Workbench) + .registerWorkbenchContribution(NativeEnablePreviewFeatures, LifecyclePhase.Eventually); diff --git a/src/sql/workbench/contrib/welcome2/page/browser/az_data_welcome_page.ts b/src/sql/workbench/contrib/welcome2/page/browser/az_data_welcome_page.ts new file mode 100644 index 0000000000..537e3be962 --- /dev/null +++ b/src/sql/workbench/contrib/welcome2/page/browser/az_data_welcome_page.ts @@ -0,0 +1,76 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { escape } from 'vs/base/common/strings'; +import { localize } from 'vs/nls'; + +export default () => ` +
+
+
+

${escape(localize('welcomePage.azdata', "Azure Data Studio"))}

+

+
+
+ +
+
+

${escape(localize('welcomePage.customize', "Customize"))}

+
+
+
+
+
+
+
+

${escape(localize('welcomePage.learn', "Learn"))}

+
+
+
+
+
+
+
+
+
+
+`; diff --git a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts index 385a9adb75..2a382a9726 100644 --- a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts +++ b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts @@ -7,12 +7,14 @@ import { localize } from 'vs/nls'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { Registry } from 'vs/platform/registry/common/platform'; import { WelcomePageContribution, WelcomePageAction, WelcomeInputFactory } from 'sql/workbench/contrib/welcome/page/browser/welcomePage'; // {{SQL CARBON EDIT}} use our welcome page +import { WelcomePageContribution as WelcomePageContribution2, WelcomePageAction as WelcomePageAction2, WelcomeInputFactory as WelcomeInputFactory2 } from 'vs/workbench/contrib/welcome/page/browser/welcomePage'; // {{SQL CARBON EDIT}} use our welcome pag import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; import { IEditorInputFactoryRegistry, Extensions as EditorExtensions } from 'vs/workbench/common/editor'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; Registry.as(ConfigurationExtensions.Configuration) .registerConfiguration({ @@ -35,13 +37,33 @@ Registry.as(ConfigurationExtensions.Configuration) } }); +class WelcomeContributions { + constructor( + @IConfigurationService configurationService: IConfigurationService, + ) { + const previewFeaturesEnabled: boolean = configurationService.getValue('workbench')['enablePreviewFeatures']; + if (previewFeaturesEnabled) { + Registry.as(WorkbenchExtensions.Workbench) + .registerWorkbenchContribution(WelcomePageContribution, LifecyclePhase.Restored); + + Registry.as(ActionExtensions.WorkbenchActions) + .registerWorkbenchAction(SyncActionDescriptor.create(WelcomePageAction, WelcomePageAction.ID, WelcomePageAction.LABEL), 'Help: Welcome', localize('help', "Help")); + + Registry.as(EditorExtensions.EditorInputFactories).registerEditorInputFactory(WelcomeInputFactory.ID, WelcomeInputFactory); + } else { + Registry.as(WorkbenchExtensions.Workbench) + .registerWorkbenchContribution(WelcomePageContribution2, LifecyclePhase.Restored); + + Registry.as(ActionExtensions.WorkbenchActions) + .registerWorkbenchAction(SyncActionDescriptor.create(WelcomePageAction2, WelcomePageAction2.ID, WelcomePageAction2.LABEL), 'Help: Welcome', localize('help', "Help")); + + Registry.as(EditorExtensions.EditorInputFactories).registerEditorInputFactory(WelcomeInputFactory2.ID, WelcomeInputFactory2); + } + } +} + Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(WelcomePageContribution, LifecyclePhase.Restored); - -Registry.as(ActionExtensions.WorkbenchActions) - .registerWorkbenchAction(SyncActionDescriptor.from(WelcomePageAction), 'Help: Welcome', localize('help', "Help")); - -Registry.as(EditorExtensions.EditorInputFactories).registerEditorInputFactory(WelcomeInputFactory.ID, WelcomeInputFactory); + .registerWorkbenchContribution(WelcomeContributions, LifecyclePhase.Starting); MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, { group: '1_welcome', diff --git a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.css b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.css index eb85946db6..ae3fa61427 100644 --- a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.css +++ b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.css @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-workbench .part.editor > .content .welcomePageContainer { +.monaco-workbench .part.editor > .content .welcomePageContainer2 { align-items: center; display: flex; justify-content: center; @@ -11,51 +11,51 @@ min-height: 100%; } -.monaco-workbench .part.editor > .content .welcomePage { +.monaco-workbench .part.editor > .content .welcomePage2 { width: 90%; max-width: 1200px; font-size: 10px; } -.monaco-workbench .part.editor > .content .welcomePage .row { +.monaco-workbench .part.editor > .content .welcomePage2 .row { display: flex; flex-flow: row; } -.monaco-workbench .part.editor > .content .welcomePage .row .section { +.monaco-workbench .part.editor > .content .welcomePage2 .row .section { overflow: hidden; } -.monaco-workbench .part.editor > .content .welcomePage .row .splash { +.monaco-workbench .part.editor > .content .welcomePage2 .row .splash { overflow: hidden; } -.monaco-workbench .part.editor > .content .welcomePage .row .commands { +.monaco-workbench .part.editor > .content .welcomePage2 .row .commands { overflow: hidden; } -.monaco-workbench .part.editor > .content .welcomePage .row .commands .list { +.monaco-workbench .part.editor > .content .welcomePage2 .row .commands .list { overflow: hidden; } -.monaco-workbench .part.editor > .content .welcomePage p { +.monaco-workbench .part.editor > .content .welcomePage2 p { font-size: 1.3em; } -.monaco-workbench .part.editor > .content .welcomePage .keyboard { +.monaco-workbench .part.editor > .content .welcomePage2 .keyboard { font-family: "Lucida Grande", sans-serif;/* Keyboard shortcuts */ } -.monaco-workbench .part.editor > .content .welcomePage a { +.monaco-workbench .part.editor > .content .welcomePage2 a { text-decoration: none; } -.monaco-workbench .part.editor > .content .welcomePage a:focus { +.monaco-workbench .part.editor > .content .welcomePage2 a:focus { outline: 1px solid -webkit-focus-ring-color; outline-offset: -1px; } -.monaco-workbench .part.editor > .content .welcomePage h1 { +.monaco-workbench .part.editor > .content .welcomePage2 h1 { padding: 0; margin: 0; border: none; @@ -64,28 +64,28 @@ white-space: nowrap; } -.monaco-workbench .part.editor > .content .welcomePage .title { +.monaco-workbench .part.editor > .content .welcomePage2 .title { margin-top: 1em; margin-bottom: 1em; flex: 1 100%; } -.monaco-workbench .part.editor > .content .welcomePage .subtitle { +.monaco-workbench .part.editor > .content .welcomePage2 .subtitle { margin-top: .8em; font-size: 2.6em; display: block; } -.hc-black .monaco-workbench .part.editor > .content .welcomePage .subtitle { +.hc-black .monaco-workbench .part.editor > .content .welcomePage2 .subtitle { font-weight: 200; } -.monaco-workbench .part.editor > .content .welcomePage .splash, -.monaco-workbench .part.editor > .content .welcomePage .commands { +.monaco-workbench .part.editor > .content .welcomePage2 .splash, +.monaco-workbench .part.editor > .content .welcomePage2 .commands { flex: 1 1 0; } -.monaco-workbench .part.editor > .content .welcomePage h2 { +.monaco-workbench .part.editor > .content .welcomePage2 h2 { font-weight: 200; margin-top: 17px; margin-bottom: 5px; @@ -93,62 +93,62 @@ line-height: initial; } -.monaco-workbench .part.editor > .content .welcomePage .splash .section { +.monaco-workbench .part.editor > .content .welcomePage2 .splash .section { margin-bottom: 5em; } -.monaco-workbench .part.editor > .content .welcomePage .splash ul { +.monaco-workbench .part.editor > .content .welcomePage2 .splash ul { margin: 0; font-size: 1.3em; list-style: none; padding: 0; } -.monaco-workbench .part.editor > .content .welcomePage .splash li { +.monaco-workbench .part.editor > .content .welcomePage2 .splash li { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.monaco-workbench .part.editor > .content .welcomePage.emptyRecent .splash .recent .list { +.monaco-workbench .part.editor > .content .welcomePage2.emptyRecent .splash .recent .list { display: none; } -.monaco-workbench .part.editor > .content .welcomePage .splash .recent .none { +.monaco-workbench .part.editor > .content .welcomePage2 .splash .recent .none { display: none; } -.monaco-workbench .part.editor > .content .welcomePage.emptyRecent .splash .recent .none { +.monaco-workbench .part.editor > .content .welcomePage2.emptyRecent .splash .recent .none { display: initial; } -.monaco-workbench .part.editor > .content .welcomePage .splash .recent li.moreRecent { +.monaco-workbench .part.editor > .content .welcomePage2 .splash .recent li.moreRecent { margin-top: 5px; } -.monaco-workbench .part.editor > .content .welcomePage .splash .recent .path { +.monaco-workbench .part.editor > .content .welcomePage2 .splash .recent .path { padding-left: 1em; } -.monaco-workbench .part.editor > .content .welcomePage .splash .title, -.monaco-workbench .part.editor > .content .welcomePage .splash .showOnStartup { +.monaco-workbench .part.editor > .content .welcomePage2 .splash .title, +.monaco-workbench .part.editor > .content .welcomePage2 .splash .showOnStartup { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.monaco-workbench .part.editor > .content .welcomePage .splash .showOnStartup > .checkbox { +.monaco-workbench .part.editor > .content .welcomePage2 .splash .showOnStartup > .checkbox { vertical-align: bottom; } -.monaco-workbench .part.editor > .content .welcomePage .commands .list { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .list { list-style: none; padding: 0; } -.monaco-workbench .part.editor > .content .welcomePage .commands .item { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .item { margin: 7px 0px; } -.monaco-workbench .part.editor > .content .welcomePage .commands .item button { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button { margin: 1px; padding: 12px 10px; width: calc(100% - 2px); @@ -160,7 +160,7 @@ font-family: inherit; } -.monaco-workbench .part.editor > .content .welcomePage .commands .item button > span { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button > span { display: inline-block; width:100%; min-width: 0; @@ -169,7 +169,7 @@ text-overflow: ellipsis; } -.monaco-workbench .part.editor > .content .welcomePage .commands .item button h3 { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button h3 { font-weight: normal; font-size: 1em; margin: 0; @@ -180,41 +180,41 @@ text-overflow: ellipsis; } -.monaco-workbench .part.editor > .content .welcomePage .commands .item button { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button { border: none; } -.hc-black .monaco-workbench .part.editor > .content .welcomePage .commands .item button > h3 { +.hc-black .monaco-workbench .part.editor > .content .welcomePage2 .commands .item button > h3 { font-weight: bold; } -.monaco-workbench .part.editor > .content .welcomePage .commands .item button:focus { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button:focus { outline-style: solid; outline-width: 1px; } -.hc-black .monaco-workbench .part.editor > .content .welcomePage .commands .item button { +.hc-black .monaco-workbench .part.editor > .content .welcomePage2 .commands .item button { border-width: 1px; border-style: solid; } -.hc-black .monaco-workbench .part.editor > .content .welcomePage .commands .item button:hover { +.hc-black .monaco-workbench .part.editor > .content .welcomePage2 .commands .item button:hover { outline-width: 1px; outline-style: dashed; outline-offset: -5px; } -.monaco-workbench .part.editor > .content .welcomePage .commands .item button .enabledExtension { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button .enabledExtension { display: none; } -.monaco-workbench .part.editor > .content .welcomePage .commands .item button .installExtension.installed { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button .installExtension.installed { display: none; } -.monaco-workbench .part.editor > .content .welcomePage .commands .item button .enabledExtension.installed { +.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button .enabledExtension.installed { display: inline; } -.monaco-workbench .part.editor > .content .welcomePageContainer.max-height-685px .title { +.monaco-workbench .part.editor > .content .welcomePageContainer2.max-height-685px .title { display: none; } @@ -223,26 +223,26 @@ background-image: url('../../../../browser/media/code-icon.svg'); } -.monaco-workbench .part.editor > .content .welcomePage .mac-only, -.monaco-workbench .part.editor > .content .welcomePage .windows-only, -.monaco-workbench .part.editor > .content .welcomePage .linux-only { +.monaco-workbench .part.editor > .content .welcomePage2 .mac-only, +.monaco-workbench .part.editor > .content .welcomePage2 .windows-only, +.monaco-workbench .part.editor > .content .welcomePage2 .linux-only { display: none; } -.monaco-workbench.mac .part.editor > .content .welcomePage .mac-only { +.monaco-workbench.mac .part.editor > .content .welcomePage2 .mac-only { display: initial; } -.monaco-workbench.windows .part.editor > .content .welcomePage .windows-only { +.monaco-workbench.windows .part.editor > .content .welcomePage2 .windows-only { display: initial; } -.monaco-workbench.linux .part.editor > .content .welcomePage .linux-only { +.monaco-workbench.linux .part.editor > .content .welcomePage2 .linux-only { display: initial; } -.monaco-workbench.mac .part.editor > .content .welcomePage li.mac-only { +.monaco-workbench.mac .part.editor > .content .welcomePage2 li.mac-only { display: list-item; } -.monaco-workbench.windows .part.editor > .content .welcomePage li.windows-only { +.monaco-workbench.windows .part.editor > .content .welcomePage2 li.windows-only { display: list-item; } -.monaco-workbench.linux .part.editor > .content .welcomePage li.linux-only { +.monaco-workbench.linux .part.editor > .content .welcomePage2 li.linux-only { display: list-item; } diff --git a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts index 718a306dcb..863152b339 100644 --- a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts +++ b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts @@ -42,7 +42,7 @@ import { ExtensionType } from 'vs/platform/extensions/common/extensions'; import { joinPath } from 'vs/base/common/resources'; import { IRecentlyOpened, isRecentWorkspace, IRecentWorkspace, IRecentFolder, isRecentFolder, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; import { CancellationToken } from 'vs/base/common/cancellation'; -import 'sql/workbench/contrib/welcome/page/browser/az_data_welcome_page'; // {{SQL CARBON EDIT}} +import 'sql/workbench/contrib/welcome2/page/browser/az_data_welcome_page'; // {{SQL CARBON EDIT}} import { IHostService } from 'vs/workbench/services/host/browser/host'; import { IProductService } from 'vs/platform/product/common/productService'; import { IEditorOptions } from 'vs/platform/editor/common/editor'; @@ -292,7 +292,7 @@ class WelcomePage extends Disposable { const resource = URI.parse(require.toUrl('./az_data_welcome_page')) .with({ scheme: Schemas.walkThrough, - query: JSON.stringify({ moduleId: 'sql/workbench/contrib/welcome/page/browser/az_data_welcome_page' }) + query: JSON.stringify({ moduleId: 'sql/workbench/contrib/welcome2/page/browser/az_data_welcome_page' }) }); this.editorInput = this.instantiationService.createInstance(WalkThroughInput, { typeId: welcomeInputTypeId, @@ -317,7 +317,7 @@ class WelcomePage extends Disposable { this.configurationService.updateValue(configurationKey, showOnStartup.checked ? 'welcomePage' : 'newUntitledFile', ConfigurationTarget.USER); }); - const prodName = container.querySelector('.welcomePage .title .caption') as HTMLElement; + const prodName = container.querySelector('.welcomePage2 .title .caption') as HTMLElement; if (prodName) { prodName.innerHTML = this.productService.nameLong; } @@ -326,7 +326,7 @@ class WelcomePage extends Disposable { // Filter out the current workspace workspaces = workspaces.filter(recent => !this.contextService.isCurrentWorkspace(isRecentWorkspace(recent) ? recent.workspace : recent.folderUri)); if (!workspaces.length) { - const recent = container.querySelector('.welcomePage') as HTMLElement; + const recent = container.querySelector('.welcomePage2') as HTMLElement; recent.classList.add('emptyRecent'); return; } @@ -639,39 +639,39 @@ registerThemingParticipant((theme, collector) => { } const foregroundColor = theme.getColor(foreground); if (foregroundColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .caption { color: ${foregroundColor}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage2 .caption { color: ${foregroundColor}; }`); } const descriptionColor = theme.getColor(descriptionForeground); if (descriptionColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .detail { color: ${descriptionColor}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage2 .detail { color: ${descriptionColor}; }`); } const buttonColor = getExtraColor(theme, buttonBackground, { dark: 'rgba(0, 0, 0, .2)', extra_dark: 'rgba(200, 235, 255, .042)', light: 'rgba(0,0,0,.04)', hc: 'black' }); if (buttonColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .commands .item button { background: ${buttonColor}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button { background: ${buttonColor}; }`); } const buttonHoverColor = getExtraColor(theme, buttonHoverBackground, { dark: 'rgba(200, 235, 255, .072)', extra_dark: 'rgba(200, 235, 255, .072)', light: 'rgba(0,0,0,.10)', hc: null }); if (buttonHoverColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .commands .item button:hover { background: ${buttonHoverColor}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button:hover { background: ${buttonHoverColor}; }`); } const link = theme.getColor(textLinkForeground); if (link) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage a { color: ${link}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage2 a { color: ${link}; }`); } const activeLink = theme.getColor(textLinkActiveForeground); if (activeLink) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage a:hover, - .monaco-workbench .part.editor > .content .welcomePage a:active { color: ${activeLink}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage2 a:hover, + .monaco-workbench .part.editor > .content .welcomePage2 a:active { color: ${activeLink}; }`); } const focusColor = theme.getColor(focusBorder); if (focusColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage a:focus { outline-color: ${focusColor}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage2 a:focus { outline-color: ${focusColor}; }`); } const border = theme.getColor(contrastBorder); if (border) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .commands .item button { border-color: ${border}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button { border-color: ${border}; }`); } const activeBorder = theme.getColor(activeContrastBorder); if (activeBorder) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .commands .item button:hover { outline-color: ${activeBorder}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage2 .commands .item button:hover { outline-color: ${activeBorder}; }`); } });