mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 02:02:35 -05:00
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:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
23
src/sql/services/dashboard/common/dashboardService.ts
Normal file
23
src/sql/services/dashboard/common/dashboardService.ts
Normal 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;
|
||||
}
|
||||
28
src/sql/services/dashboard/common/dashboardServiceImpl.ts
Normal file
28
src/sql/services/dashboard/common/dashboardServiceImpl.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user