mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
add disabled features option (#8678)
This commit is contained in:
@@ -127,8 +127,10 @@ actionRegistry.registerWorkbenchAction(builtinActionDescriptor, 'Extensions: Sho
|
||||
const updateAllActionDescriptor = SyncActionDescriptor.create(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(updateAllActionDescriptor, 'Extensions: Update All Extensions', ExtensionsLabel);
|
||||
|
||||
const installVSIXActionDescriptor = SyncActionDescriptor.create(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(installVSIXActionDescriptor, 'Extensions: Install from VSIX...', ExtensionsLabel);
|
||||
if (InstallVSIXAction.AVAILABLE) { // {{SQL CARBON EDIT}} add disable logic
|
||||
const installVSIXActionDescriptor = SyncActionDescriptor.create(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(installVSIXActionDescriptor, 'Extensions: Install from VSIX...', ExtensionsLabel);
|
||||
}
|
||||
|
||||
const disableAllAction = SyncActionDescriptor.create(DisableAllAction, DisableAllAction.ID, DisableAllAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(disableAllAction, 'Extensions: Disable All Installed Extensions', ExtensionsLabel);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user