mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
* Initial VS Code 1.21 file copy with patches * A few more merges * Post npm install * Fix batch of build breaks * Fix more build breaks * Fix more build errors * Fix more build breaks * Runtime fixes 1 * Get connection dialog working with some todos * Fix a few packaging issues * Copy several node_modules to package build to fix loader issues * Fix breaks from master * A few more fixes * Make tests pass * First pass of license header updates * Second pass of license header updates * Fix restore dialog issues * Remove add additional themes menu items * fix select box issues where the list doesn't show up * formatting * Fix editor dispose issue * Copy over node modules to correct location on all platforms
36 lines
1.7 KiB
TypeScript
36 lines
1.7 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
import { IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
|
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
|
import * as nls from 'vs/nls';
|
|
|
|
import { generateDashboardGridLayoutSchema } from 'sql/parts/dashboard/pages/dashboardPageContribution';
|
|
import { registerContainerType, registerNavSectionContainerType } from 'sql/platform/dashboard/common/dashboardContainerRegistry';
|
|
|
|
export const GRID_CONTAINER = 'grid-container';
|
|
|
|
let gridContainersSchema: IJSONSchema = {
|
|
type: 'array',
|
|
description: nls.localize('dashboard.container.gridtab.items', "The list of widgets or webviews that will be displayed in this tab."),
|
|
items: generateDashboardGridLayoutSchema(undefined, true)
|
|
};
|
|
|
|
registerContainerType(GRID_CONTAINER, gridContainersSchema);
|
|
registerNavSectionContainerType(GRID_CONTAINER, gridContainersSchema);
|
|
|
|
export function validateGridContainerContribution(extension: IExtensionPointUser<any>, gridConfigs: object[]): boolean {
|
|
let result = true;
|
|
gridConfigs.forEach(widgetConfig => {
|
|
let allKeys = Object.keys(widgetConfig);
|
|
let widgetOrWebviewKey = allKeys.find(key => key === 'widget' || key === 'webview');
|
|
if (!widgetOrWebviewKey) {
|
|
result = false;
|
|
extension.collector.error(nls.localize('gridContainer.invalidInputs', 'widgets or webviews are expected inside widgets-container for extension.'));
|
|
return;
|
|
}
|
|
});
|
|
return result;
|
|
}
|