mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Tasks schema registration (#900)
* inital task update * fix schema update problems * remove dead code
This commit is contained in:
@@ -2,30 +2,36 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { registerDashboardWidget } from 'sql/platform/dashboard/common/widgetRegistry';
|
||||
import { TaskRegistry } from 'sql/platform/tasks/common/tasks';
|
||||
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
|
||||
const singleTaskSchema: IJSONSchema = {
|
||||
type: 'string',
|
||||
enum: TaskRegistry.getTasks()
|
||||
};
|
||||
|
||||
const tasksSchema: IJSONSchema = {
|
||||
type: 'array',
|
||||
items: {
|
||||
anyOf: [{
|
||||
type: 'string',
|
||||
enum: TaskRegistry.getTasks()
|
||||
},
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: {
|
||||
type: 'string',
|
||||
enum: TaskRegistry.getTasks()
|
||||
},
|
||||
when: {
|
||||
type: 'string'
|
||||
anyOf: [
|
||||
singleTaskSchema,
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: singleTaskSchema,
|
||||
when: {
|
||||
type: 'string'
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
registerDashboardWidget('tasks-widget', '', tasksSchema);
|
||||
TaskRegistry.onTaskRegistered(e => {
|
||||
singleTaskSchema.enum.push(e);
|
||||
});
|
||||
|
||||
registerDashboardWidget('tasks-widget', '', tasksSchema);
|
||||
|
||||
Reference in New Issue
Block a user