Tab contribution support both inline container and registered container (#766)

* accept inline nav section contribution

* contribution accepted both inline container and registered container

* address comments

* formatting
This commit is contained in:
Abbie Petchtes
2018-02-23 15:12:30 -08:00
committed by GitHub
parent f9d8f479b5
commit bd7341ddc2
13 changed files with 183 additions and 157 deletions

View File

@@ -34,9 +34,7 @@ export interface IDashboardRegistry {
registerDashboardProvider(id: string, properties: ProviderProperties): void;
getProperties(id: string): ProviderProperties;
registerTab(tab: IDashboardTab): void;
registerTabContent(id: string, schema: IJSONSchema): void;
tabs: Array<IDashboardTab>;
tabContentSchemaProperties: IJSONSchemaMap;
}
class DashboardRegistry implements IDashboardRegistry {
@@ -77,19 +75,6 @@ class DashboardRegistry implements IDashboardRegistry {
public get tabs(): Array<IDashboardTab> {
return this._tabs;
}
/**
* Register a dashboard widget
* @param id id of the widget
* @param schema config schema of the widget
*/
public registerTabContent(id: string, schema: IJSONSchema): void {
this._dashboardTabContentSchemaProperties[id] = schema;
}
public get tabContentSchemaProperties(): IJSONSchemaMap {
return deepClone(this._dashboardTabContentSchemaProperties);
}
}
const dashboardRegistry = new DashboardRegistry();
@@ -99,14 +84,6 @@ export function registerTab(tab: IDashboardTab): void {
dashboardRegistry.registerTab(tab);
}
export function registerTabContent(id: string, schema: IJSONSchema): void {
dashboardRegistry.registerTabContent(id, schema);
}
export function generateTabContentSchemaProperties(): IJSONSchemaMap {
return dashboardRegistry.tabContentSchemaProperties;
}
const dashboardPropertiesPropertyContrib: IJSONSchema = {
description: nls.localize('dashboard.properties.property', "Defines a property to show on the dashboard"),
type: 'object',