mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Fix tab contrib to be accurate (#901)
* update tab contrib to be accurate with expectation * update contracts * formatting
This commit is contained in:
@@ -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<IDashboardTabContrib | IDashboardTabContrib[]>('dashboard.tabs', [], tabContributionSchema).setHandler(extensions => {
|
||||
|
||||
function handleCommand(tab: IDashboardTabContrib, extension: IExtensionPointUser<any>) {
|
||||
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<IDashboardTabContrib | IDashboardTabCo
|
||||
}
|
||||
|
||||
if (result) {
|
||||
registerTab({ description, title, container, edition, provider, id, alwaysShow, publisher });
|
||||
registerTab({ description, title, container, when, id, alwaysShow, publisher });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ export interface IDashboardTab {
|
||||
publisher: string;
|
||||
description?: string;
|
||||
container?: object;
|
||||
provider?: string | string[];
|
||||
edition?: number | number[];
|
||||
when?: string;
|
||||
alwaysShow?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user