mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 17:22:45 -05:00
Initial Code Layering (#3788)
* working on formatting * fixed basic lint errors; starting moving things to their appropriate location * formatting * update tslint to match the version of vscode we have * remove unused code * work in progress fixing layering * formatting * moved connection management service to platform * formatting * add missing file * moving more servies * formatting * moving more services * formatting * wip * moving more services * formatting * revert back tslint rules * move css file * add missing svgs
This commit is contained in:
26
src/sql/platform/dashboard/browser/dashboardService.ts
Normal file
26
src/sql/platform/dashboard/browser/dashboardService.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 DOM from 'vs/base/browser/dom';
|
||||
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>;
|
||||
readonly onLayout: Event<DOM.Dimension>;
|
||||
|
||||
openDashboard(document: sqlops.DashboardDocument): void;
|
||||
|
||||
changeToDashboard(document: sqlops.DashboardDocument): void;
|
||||
|
||||
layout(dimension: DOM.Dimension): void;
|
||||
}
|
||||
34
src/sql/platform/dashboard/browser/dashboardServiceImpl.ts
Normal file
34
src/sql/platform/dashboard/browser/dashboardServiceImpl.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 DOM from 'vs/base/browser/dom';
|
||||
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;
|
||||
|
||||
private _onLayout = new Emitter<DOM.Dimension>();
|
||||
public readonly onLayout: Event<DOM.Dimension> = this._onLayout.event;
|
||||
|
||||
public openDashboard(document: sqlops.DashboardDocument): void {
|
||||
this._onDidOpenDashboard.fire(document);
|
||||
}
|
||||
|
||||
public changeToDashboard(document: sqlops.DashboardDocument): void {
|
||||
this._onDidChangeToDashboard.fire(document);
|
||||
}
|
||||
|
||||
public layout(dimension: DOM.Dimension): void {
|
||||
this._onLayout.fire(dimension);
|
||||
}
|
||||
}
|
||||
29
src/sql/platform/dashboard/common/dashboardViewService.ts
Normal file
29
src/sql/platform/dashboard/common/dashboardViewService.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { IView, IModelView } from 'sql/platform/model/common/modelViewService';
|
||||
|
||||
export const SERVICE_ID = 'dashboardViewService';
|
||||
|
||||
export interface IDashboardWebview extends IView {
|
||||
setHtml(html: string): void;
|
||||
onMessage: Event<string>;
|
||||
sendMessage(message: string);
|
||||
}
|
||||
|
||||
export interface IDashboardViewService {
|
||||
_serviceBrand: any;
|
||||
onRegisteredWebview: Event<IDashboardWebview>;
|
||||
registerWebview(widget: IDashboardWebview);
|
||||
onRegisteredModelView: Event<IModelView>;
|
||||
registerModelView(widget: IModelView);
|
||||
}
|
||||
|
||||
export const IDashboardViewService = createDecorator<IDashboardViewService>(SERVICE_ID);
|
||||
@@ -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 { IDashboardViewService, IDashboardWebview } from 'sql/platform/dashboard/common/dashboardViewService';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IModelView } from 'sql/platform/model/common/modelViewService';
|
||||
|
||||
export class DashboardViewService implements IDashboardViewService {
|
||||
_serviceBrand: any;
|
||||
|
||||
private _onRegisteredWebview = new Emitter<IDashboardWebview>();
|
||||
public readonly onRegisteredWebview: Event<IDashboardWebview> = this._onRegisteredWebview.event;
|
||||
|
||||
private _onRegisteredModelView = new Emitter<IModelView>();
|
||||
public readonly onRegisteredModelView: Event<IModelView> = this._onRegisteredModelView.event;
|
||||
|
||||
public registerWebview(widget: IDashboardWebview) {
|
||||
this._onRegisteredWebview.fire(widget);
|
||||
}
|
||||
|
||||
registerModelView(view: IModelView) {
|
||||
this._onRegisteredModelView.fire(view);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user