mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -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;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
container: object;
|
container: object;
|
||||||
|
when?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
provider?: string | string[];
|
|
||||||
edition?: number | number[];
|
|
||||||
alwaysShow?: boolean;
|
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."),
|
description: localize('sqlops.extension.contributes.dashboard.tab.description', "Description of this tab that will be shown to the user."),
|
||||||
type: 'string'
|
type: 'string'
|
||||||
},
|
},
|
||||||
provider: {
|
when: {
|
||||||
description: localize('sqlops.extension.contributes.dashboard.tab.provider', "Providers for which this tab should be allowed for."),
|
description: localize('sqlops.extension.contributes.tab.when', 'Condition which must be true to show this item'),
|
||||||
anyOf: [
|
type: 'string'
|
||||||
{
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
description: localize('sqlops.extension.contributes.dashboard.tab.container', "The container that will be displayed in this tab."),
|
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 => {
|
ExtensionsRegistry.registerExtensionPoint<IDashboardTabContrib | IDashboardTabContrib[]>('dashboard.tabs', [], tabContributionSchema).setHandler(extensions => {
|
||||||
|
|
||||||
function handleCommand(tab: IDashboardTabContrib, extension: IExtensionPointUser<any>) {
|
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 always show is not specified, set it to true by default.
|
||||||
if (!types.isBoolean(alwaysShow)) {
|
if (!types.isBoolean(alwaysShow)) {
|
||||||
@@ -135,7 +110,7 @@ ExtensionsRegistry.registerExtensionPoint<IDashboardTabContrib | IDashboardTabCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result) {
|
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;
|
publisher: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
container?: object;
|
container?: object;
|
||||||
provider?: string | string[];
|
|
||||||
edition?: number | number[];
|
|
||||||
when?: string;
|
when?: string;
|
||||||
alwaysShow?: boolean;
|
alwaysShow?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user