mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
* Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3 * Fix test build break * Update distro * Fix build errors * Update distro * Update REH build file * Update build task names for REL * Fix product build yaml * Fix product REH task name * Fix type in task name * Update linux build step * Update windows build tasks * Turn off server publish * Disable REH * Fix typo * Bump distro * Update vscode tests * Bump distro * Fix type in disto * Bump distro * Turn off docker build * Remove docker step from release Co-authored-by: ADS Merger <andresse@microsoft.com> Co-authored-by: Karl Burtram <karlb@microsoft.com>
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { Event, Emitter } from 'vs/base/common/event';
|
|
|
|
import { IDashboardTab } from 'sql/workbench/services/dashboard/browser/common/interfaces';
|
|
|
|
|
|
export interface IDashboardUITab {
|
|
tabConfig: IDashboardTab;
|
|
isOpened?: boolean;
|
|
}
|
|
|
|
/**
|
|
* View model for new dashboard tab
|
|
*/
|
|
export class NewDashboardTabViewModel {
|
|
|
|
// EVENTING ///////////////////////////////////////////////////////
|
|
private _updateTabListEmitter: Emitter<IDashboardUITab[]>;
|
|
public get updateTabListEvent(): Event<IDashboardUITab[]> { return this._updateTabListEmitter.event; }
|
|
|
|
|
|
constructor() {
|
|
// Create event emitters
|
|
this._updateTabListEmitter = new Emitter<IDashboardUITab[]>();
|
|
}
|
|
|
|
public updateDashboardTabs(dashboardTabs: Array<IDashboardTab>, openedTabs: Array<IDashboardTab>) {
|
|
let tabList: IDashboardUITab[] = [];
|
|
dashboardTabs.forEach(tab => {
|
|
tabList.push({ tabConfig: tab });
|
|
});
|
|
openedTabs.forEach(tab => {
|
|
let uiTab = tabList.find(i => i.tabConfig === tab);
|
|
if (uiTab) {
|
|
uiTab.isOpened = true;
|
|
}
|
|
});
|
|
this._updateTabListEmitter.fire(tabList);
|
|
}
|
|
}
|