mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Switch off "preview feature" prompt
This commit is contained in:
@@ -32,7 +32,7 @@ Registry.as<IConfigurationRegistry>(ConfigExtensions.Configuration).registerConf
|
||||
'properties': {
|
||||
'workbench.enablePreviewFeatures': {
|
||||
'type': 'boolean',
|
||||
'default': undefined,
|
||||
'default': true,
|
||||
'description': nls.localize('previewFeatures.configEnable', 'Enable unreleased preview features')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,44 +27,46 @@ export class EnablePreviewFeatures implements IWorkbenchContribution {
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IConfigurationService configurationService: IConfigurationService
|
||||
) {
|
||||
let previewFeaturesEnabled = configurationService.getValue('workbench')['enablePreviewFeatures'];
|
||||
if (previewFeaturesEnabled || storageService.get(EnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN)) {
|
||||
return;
|
||||
}
|
||||
Promise.all([
|
||||
windowService.isFocused(),
|
||||
windowsService.getWindowCount()
|
||||
]).then(([focused, count]) => {
|
||||
if (!focused && count > 1) {
|
||||
return null;
|
||||
}
|
||||
configurationService.updateValue('workbench.enablePreviewFeatures', false);
|
||||
return;
|
||||
|
||||
const enablePreviewFeaturesNotice = localize('enablePreviewFeatures.notice', "Would you like to enable preview features?");
|
||||
notificationService.prompt(
|
||||
Severity.Info,
|
||||
enablePreviewFeaturesNotice,
|
||||
[{
|
||||
label: localize('enablePreviewFeatures.yes', "Yes"),
|
||||
run: () => {
|
||||
configurationService.updateValue('workbench.enablePreviewFeatures', true);
|
||||
storageService.store(EnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN, true);
|
||||
}
|
||||
}, {
|
||||
label: localize('enablePreviewFeatures.no', "No"),
|
||||
run: () => {
|
||||
configurationService.updateValue('workbench.enablePreviewFeatures', false);
|
||||
}
|
||||
}, {
|
||||
label: localize('enablePreviewFeatures.never', "No, don't show again"),
|
||||
run: () => {
|
||||
configurationService.updateValue('workbench.enablePreviewFeatures', false);
|
||||
storageService.store(EnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN, true);
|
||||
},
|
||||
isSecondary: true
|
||||
}]
|
||||
);
|
||||
})
|
||||
.then(null, onUnexpectedError);
|
||||
// let previewFeaturesEnabled = configurationService.getValue('workbench')['enablePreviewFeatures'];
|
||||
// if (previewFeaturesEnabled || storageService.get(EnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN)) {
|
||||
// return;
|
||||
// }
|
||||
// Promise.all([
|
||||
// windowService.isFocused(),
|
||||
// windowsService.getWindowCount()
|
||||
// ]).then(([focused, count]) => {
|
||||
// if (!focused && count > 1) {
|
||||
// return null;
|
||||
// }
|
||||
// configurationService.updateValue('workbench.enablePreviewFeatures', false);
|
||||
|
||||
// const enablePreviewFeaturesNotice = localize('enablePreviewFeatures.notice', "Would you like to enable preview features?");
|
||||
// notificationService.prompt(
|
||||
// Severity.Info,
|
||||
// enablePreviewFeaturesNotice,
|
||||
// [{
|
||||
// label: localize('enablePreviewFeatures.yes', "Yes"),
|
||||
// run: () => {
|
||||
// configurationService.updateValue('workbench.enablePreviewFeatures', true);
|
||||
// storageService.store(EnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN, true);
|
||||
// }
|
||||
// }, {
|
||||
// label: localize('enablePreviewFeatures.no', "No"),
|
||||
// run: () => {
|
||||
// configurationService.updateValue('workbench.enablePreviewFeatures', false);
|
||||
// }
|
||||
// }, {
|
||||
// label: localize('enablePreviewFeatures.never', "No, don't show again"),
|
||||
// run: () => {
|
||||
// configurationService.updateValue('workbench.enablePreviewFeatures', false);
|
||||
// storageService.store(EnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN, true);
|
||||
// },
|
||||
// isSecondary: true
|
||||
// }]
|
||||
// );
|
||||
// })
|
||||
// .then(null, onUnexpectedError);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user