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