add disabled features option (#8678)

This commit is contained in:
Anthony Dresser
2020-01-21 16:51:57 -08:00
committed by GitHub
parent 13d4ab22b1
commit f22dacadbe
4 changed files with 21 additions and 10 deletions

View File

@@ -63,6 +63,7 @@ import { IFileDialogService, IDialogService } from 'vs/platform/dialogs/common/d
import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; // {{SQL CARBON EDIT}}
import product from 'vs/platform/product/common/product';
export function toExtensionDescription(local: ILocalExtension): IExtensionDescription {
return {
@@ -86,7 +87,7 @@ const promptDownloadManually = (extension: IGalleryExtension | undefined, messag
return dialogService.show(Severity.Error, error.message, []);
} else {
const downloadUrl = (extension.assets.downloadPage && extension.assets.downloadPage.uri) || extension.assets.download.uri; // {{SQL CARBON EDIT}} Use the URI directly since we don't have a marketplace hosting the packages
notificationService.prompt(Severity.Error, message, [{
notificationService.prompt(Severity.Error, message, !InstallVSIXAction.AVAILABLE ? [] : [{
label: localize('download', "Download Manually"),
run: () => openerService.open(URI.parse(downloadUrl)).then(() => {
notificationService.prompt(
@@ -2871,6 +2872,7 @@ export class InstallVSIXAction extends Action {
static readonly ID = 'workbench.extensions.action.installVSIX';
static readonly LABEL = localize('installVSIX', "Install from VSIX...");
static readonly AVAILABLE = !(product.disabledFeatures?.indexOf(InstallVSIXAction.ID) >= 0); // {{SQL CARBON EDIT}} add available logic
constructor(
id = InstallVSIXAction.ID,
@@ -2965,6 +2967,10 @@ export class InstallVSIXAction extends Action {
}
// {{SQL CARBON EDIT}} - End
}
get enabled(): boolean { // {{SQL CARBON EDIT}} add enabled logic
return InstallVSIXAction.AVAILABLE;
}
}
export class ReinstallAction extends Action {