mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 09:35:40 -05:00
Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)
* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 * disable strict null check
This commit is contained in:
@@ -53,7 +53,7 @@ class AccountPanel extends ViewletPanel {
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
this.accountList = new List<azdata.Account>(container, new AccountListDelegate(AccountDialog.ACCOUNTLIST_HEIGHT), [this.instantiationService.createInstance(AccountListRenderer)]);
|
||||
this.disposables.push(attachListStyler(this.accountList, this.themeService));
|
||||
this._register(attachListStyler(this.accountList, this.themeService));
|
||||
}
|
||||
|
||||
protected layoutBody(size: number): void {
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/accountListStatusbarItem';
|
||||
import { Action, IAction } from 'vs/base/common/actions';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { $, append } from 'vs/base/browser/dom';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
import { IAccountManagementService } from 'sql/platform/accounts/common/interfaces';
|
||||
|
||||
export class AccountListStatusbarItem extends Themable implements IStatusbarItem {
|
||||
private _manageLinkedAccountAction: IAction;
|
||||
private _icon: HTMLElement;
|
||||
|
||||
constructor(
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService
|
||||
) {
|
||||
super(themeService);
|
||||
}
|
||||
|
||||
protected updateStyles(): void {
|
||||
super.updateStyles();
|
||||
if (this._icon) {
|
||||
this._icon.style.backgroundColor = this.getColor(STATUS_BAR_FOREGROUND);
|
||||
}
|
||||
}
|
||||
|
||||
public render(container: HTMLElement): IDisposable {
|
||||
// Create root element for account list
|
||||
const rootElement = append(container, $('.linked-account-staus'));
|
||||
const accountElement = append(rootElement, $('a.linked-account-status-selection'));
|
||||
accountElement.title = ManageLinkedAccountAction.LABEL;
|
||||
accountElement.onclick = () => this._onClick();
|
||||
this._icon = append(accountElement, $('.linked-account-icon'));
|
||||
|
||||
this.updateStyles();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private _onClick() {
|
||||
if (!this._manageLinkedAccountAction) {
|
||||
this._manageLinkedAccountAction = this._instantiationService.createInstance(ManageLinkedAccountAction, ManageLinkedAccountAction.ID, ManageLinkedAccountAction.LABEL);
|
||||
}
|
||||
this._manageLinkedAccountAction.run().then(null, onUnexpectedError);
|
||||
}
|
||||
}
|
||||
|
||||
export class ManageLinkedAccountAction extends Action {
|
||||
public static ID = 'sql.action.accounts.manageLinkedAccount';
|
||||
public static LABEL = localize('manageLinedAccounts', 'Manage Linked Accounts');
|
||||
|
||||
constructor(id: string, label: string,
|
||||
@IAccountManagementService protected _accountManagementService: IAccountManagementService) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(): Promise<any> {
|
||||
return new Promise<any>(() => this._accountManagementService.openAccountListDialog());
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { IExtensionPointUser, ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -13,19 +10,6 @@ import { join } from 'path';
|
||||
import { createCSSRule } from 'vs/base/browser/dom';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
import { ManageLinkedAccountAction } from 'sql/platform/accounts/browser/accountListStatusbarItem';
|
||||
|
||||
let actionRegistry = <IWorkbenchActionRegistry>Registry.as(Extensions.WorkbenchActions);
|
||||
|
||||
actionRegistry.registerWorkbenchAction(
|
||||
new SyncActionDescriptor(
|
||||
ManageLinkedAccountAction,
|
||||
ManageLinkedAccountAction.ID,
|
||||
ManageLinkedAccountAction.LABEL
|
||||
),
|
||||
ManageLinkedAccountAction.LABEL
|
||||
);
|
||||
|
||||
export interface IAccountContrib {
|
||||
id: string;
|
||||
icon?: IUserFriendlyIcon;
|
||||
|
||||
Reference in New Issue
Block a user