diff --git a/src/sql/parts/dashboard/common/dashboardTab.contribution.ts b/src/sql/parts/dashboard/common/dashboardTab.contribution.ts index a22a77fa25..cb7c8cda79 100644 --- a/src/sql/parts/dashboard/common/dashboardTab.contribution.ts +++ b/src/sql/parts/dashboard/common/dashboardTab.contribution.ts @@ -17,9 +17,8 @@ export interface IDashboardTabContrib { id: string; title: string; container: object; + when?: string; description?: string; - provider?: string | string[]; - edition?: number | number[]; alwaysShow?: boolean; } @@ -38,33 +37,9 @@ const tabSchema: IJSONSchema = { description: localize('sqlops.extension.contributes.dashboard.tab.description', "Description of this tab that will be shown to the user."), type: 'string' }, - provider: { - description: localize('sqlops.extension.contributes.dashboard.tab.provider', "Providers for which this tab should be allowed for."), - anyOf: [ - { - type: 'string' - }, - { - type: 'array', - items: { - type: 'string' - } - } - ] - }, - edition: { - description: localize('sqlops.extension.contributes.dashboard.tab.edition', "Editions for which this tab should be allowed for."), - anyOf: [ - { - type: 'number' - }, - { - type: 'array', - items: { - type: 'number' - } - } - ] + when: { + description: localize('sqlops.extension.contributes.tab.when', 'Condition which must be true to show this item'), + type: 'string' }, container: { description: localize('sqlops.extension.contributes.dashboard.tab.container', "The container that will be displayed in this tab."), @@ -92,7 +67,7 @@ const tabContributionSchema: IJSONSchema = { ExtensionsRegistry.registerExtensionPoint('dashboard.tabs', [], tabContributionSchema).setHandler(extensions => { function handleCommand(tab: IDashboardTabContrib, extension: IExtensionPointUser) { - let { description, container, title, edition, provider, id, alwaysShow } = tab; + let { description, container, title, when, id, alwaysShow } = tab; // If always show is not specified, set it to true by default. if (!types.isBoolean(alwaysShow)) { @@ -135,7 +110,7 @@ ExtensionsRegistry.registerExtensionPoint