Task contribution (#742)

* work in progress

* set up necessary code. need to work on getting it working

* formatting

* work in progress

* work in progress

* formatting

* work in progress

* work in progress

* work in progress

* formatting

* needs a lot of work regarding how we do actions vs how extensions do actions

* formatting

* use connection profile for actions

* change action to be
This commit is contained in:
Anthony Dresser
2018-02-27 11:40:13 -08:00
committed by GitHub
parent 5adab4fafb
commit 3432dac261
23 changed files with 518 additions and 323 deletions

View File

@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { registerTask } from 'sql/platform/tasks/taskRegistry';
import { TaskRegistry } from 'sql/platform/tasks/common/tasks';
import * as Actions from './actions';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
@@ -15,39 +15,14 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } fr
import { ShowCurrentReleaseNotesAction, ProductContribution } from 'sql/workbench/update/releaseNotes';
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
const backupSchema: IJSONSchema = {
description: nls.localize('carbon.actions.back', 'Open up backup dialog'),
type: 'null',
default: null
};
const restoreSchema: IJSONSchema = {
description: nls.localize('carbon.actions.restore', 'Open up restore dialog'),
type: 'null',
default: null
};
const newQuerySchema: IJSONSchema = {
description: nls.localize('carbon.actions.newQuery', 'Open a new query window'),
type: 'null',
default: null
};
const configureDashboardSchema: IJSONSchema = {
description: nls.localize('carbon.actions.configureDashboard', 'Configure the Management Dashboard'),
type: 'null',
default: null
};
registerTask('backup', '', backupSchema, Actions.BackupAction);
registerTask('restore', '', restoreSchema, Actions.RestoreAction);
registerTask('new-query', '', newQuerySchema, Actions.NewQueryAction);
registerTask('configure-dashboard', '', configureDashboardSchema, Actions.ConfigureDashboardAction);
new Actions.BackupAction().registerTask();
new Actions.RestoreAction().registerTask();
new Actions.NewQueryAction().registerTask();
new Actions.ConfigureDashboardAction().registerTask();
// add product update and release notes contributions
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
.registerWorkbenchContribution(ProductContribution, LifecyclePhase.Running);
.registerWorkbenchContribution(ProductContribution, LifecyclePhase.Running);
Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions)
.registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Show Getting Started');