integrate with contextkeyservice (#804)

* commting .d.ts changes

* added serverinfo to .d.ts

* maybe its working?

* works

* updated contrib

* remove unnecessary code

* fix compile errors

* change back sqlops engine for merge
This commit is contained in:
Anthony Dresser
2018-03-06 13:56:04 -08:00
committed by GitHub
parent 0bba972657
commit 9f5268101d
27 changed files with 336 additions and 103 deletions

View File

@@ -5,6 +5,7 @@
import { DataService } from 'sql/parts/grid/services/dataService';
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
export interface BootstrapParams {
}
@@ -20,6 +21,7 @@ export interface EditDataComponentParams extends BootstrapParams {
export interface DashboardComponentParams extends BootstrapParams {
connection: IConnectionProfile;
ownerUri: string;
scopedContextService: IContextKeyService;
}
export interface TaskDialogComponentParams extends BootstrapParams {

View File

@@ -112,7 +112,7 @@ export interface IBootstrapService {
* Gets the "params" entry associated with the given id and unassociates the id/entry pair.
* Returns undefined if no entry is found.
*/
getBootstrapParams(id: string): any;
getBootstrapParams<T extends BootstrapParams>(id: string): T;
/*
* Gets the next unique selector given the baseSelectorString. A unique selector is the baseSelectorString with a

View File

@@ -0,0 +1,23 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import Event from 'vs/base/common/event';
import * as sqlops from 'sqlops';
export const IDashboardService = createDecorator<IDashboardService>('dashboardService');
export interface IDashboardService {
_serviceBrand: any;
readonly onDidOpenDashboard: Event<sqlops.DashboardDocument>;
readonly onDidChangeToDashboard: Event<sqlops.DashboardDocument>;
openDashboard(document: sqlops.DashboardDocument): void;
changeToDashboard(document: sqlops.DashboardDocument): void;
}

View File

@@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IDashboardService } from './dashboardService';
import Event, { Emitter } from 'vs/base/common/event';
import * as sqlops from 'sqlops';
export class DashboardService implements IDashboardService {
public _serviceBrand: any;
private _onDidOpenDashboard = new Emitter<sqlops.DashboardDocument>();
public readonly onDidOpenDashboard: Event<sqlops.DashboardDocument> = this._onDidOpenDashboard.event;
private _onDidChangeToDashboard = new Emitter<sqlops.DashboardDocument>();
public readonly onDidChangeToDashboard: Event<sqlops.DashboardDocument> = this._onDidChangeToDashboard.event;
public openDashboard(document: sqlops.DashboardDocument): void {
this._onDidOpenDashboard.fire(document);
}
public changeToDashboard(document: sqlops.DashboardDocument): void {
this._onDidChangeToDashboard.fire(document);
}
}