mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 01:25:36 -05:00
Final layering (#9164)
* move handling generated files to the serilization classes * remove unneeded methods * add more folders to strictire compile, add more strict compile options * update ci * wip * add more layering and fix issues * add more strictness * remove unnecessary assertion * add missing checks * fix indentation * wip * remove jsdoc * fix layering * fix compile * fix compile errors * wip * wip * finish layering * fix css * more layering * rip * reworking results serializer * move some files around * move capabilities to platform wip * implement capabilities register provider * fix capabilities service * fix usage of the regist4ry * add contribution * wip * wip * wip * remove no longer good parts * fix strict-nulls * fix issues with startup * another try * fix startup * fix imports * fix tests * fix tests * fix more tests * fix tests * fix more tests * fix broken test * fix tabbing * fix naming * wip * finished layering * fix imports * fix valid layers * fix layers * wip * finish layering * final layering * finish layering * fix spacing
This commit is contained in:
@@ -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<number>;
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { AbstractEnablePreviewFeatures } from 'sql/workbench/contrib/welcome/gettingStarted/common/enablePreviewFeatures';
|
||||
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';
|
||||
|
||||
Reference in New Issue
Block a user