mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Setup files for workbench/services to be strict compiled (#9168)
* setup services to be strict compiled. fix some of the issues * fix compile * fix compile * revert some undefined changes
This commit is contained in:
@@ -7,7 +7,7 @@ import { localize } from 'vs/nls';
|
|||||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { Emitter } from 'vs/base/common/event';
|
import { Emitter } from 'vs/base/common/event';
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from 'vs/base/common/uri';
|
||||||
import { EditorInput, GroupIdentifier, IRevertOptions, ISaveOptions, IEditorInput } from 'vs/workbench/common/editor';
|
import { EditorInput, GroupIdentifier, IRevertOptions, ISaveOptions, IEditorInput, TextResourceEditorInput } from 'vs/workbench/common/editor';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
|
|
||||||
import { IConnectionManagementService, IConnectableInput, INewConnectionParams, RunQueryOnConnectionMode } from 'sql/platform/connection/common/connectionManagement';
|
import { IConnectionManagementService, IConnectableInput, INewConnectionParams, RunQueryOnConnectionMode } from 'sql/platform/connection/common/connectionManagement';
|
||||||
@@ -118,7 +118,7 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _description: string,
|
private _description: string,
|
||||||
protected _text: EditorInput,
|
protected _text: TextResourceEditorInput,
|
||||||
protected _results: QueryResultsInput,
|
protected _results: QueryResultsInput,
|
||||||
@IConnectionManagementService private readonly connectionManagementService: IConnectionManagementService,
|
@IConnectionManagementService private readonly connectionManagementService: IConnectionManagementService,
|
||||||
@IQueryModelService private readonly queryModelService: IQueryModelService,
|
@IQueryModelService private readonly queryModelService: IQueryModelService,
|
||||||
@@ -167,7 +167,7 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
|
|||||||
|
|
||||||
// Getters for private properties
|
// Getters for private properties
|
||||||
public get uri(): string { return this.resource!.toString(true); }
|
public get uri(): string { return this.resource!.toString(true); }
|
||||||
public get text(): EditorInput { return this._text; }
|
public get text(): TextResourceEditorInput { return this._text; }
|
||||||
public get results(): QueryResultsInput { return this._results; }
|
public get results(): QueryResultsInput { return this._results; }
|
||||||
// Description is shown beside the tab name in the combobox of open editors
|
// Description is shown beside the tab name in the combobox of open editors
|
||||||
public getDescription(): string { return this._description; }
|
public getDescription(): string { return this._description; }
|
||||||
@@ -191,7 +191,7 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
|
|||||||
|
|
||||||
// Forwarding resource functions to the inline sql file editor
|
// Forwarding resource functions to the inline sql file editor
|
||||||
public isDirty(): boolean { return this._text.isDirty(); }
|
public isDirty(): boolean { return this._text.isDirty(); }
|
||||||
public get resource(): URI | undefined { return this._text.resource; }
|
public get resource(): URI { return this._text.resource; }
|
||||||
|
|
||||||
public matchInputInstanceType(inputType: any): boolean {
|
public matchInputInstanceType(inputType: any): boolean {
|
||||||
return (this._text instanceof inputType);
|
return (this._text instanceof inputType);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser
|
|||||||
|
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
import { memoize } from 'vs/base/common/decorators';
|
import { memoize } from 'vs/base/common/decorators';
|
||||||
import { AgentViewComponent } from '../../../jobManagement/browser/agentView.component';
|
import { AgentViewComponent } from 'sql/workbench/contrib/jobManagement/browser/agentView.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: decodeURI(require.toUrl('./controlHostContent.component.html')),
|
templateUrl: decodeURI(require.toUrl('./controlHostContent.component.html')),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import * as azdata from 'azdata';
|
|||||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||||
import Severity from 'vs/base/common/severity';
|
import Severity from 'vs/base/common/severity';
|
||||||
import { JobHistoryComponent } from 'sql/workbench/contrib/jobManagement/browser/jobHistory.component';
|
import { JobHistoryComponent } from 'sql/workbench/contrib/jobManagement/browser/jobHistory.component';
|
||||||
import { IJobManagementService } from '../../../services/jobManagement/common/interfaces';
|
import { IJobManagementService } from 'sql/workbench/services/jobManagement/common/interfaces';
|
||||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||||
import { JobsViewComponent } from 'sql/workbench/contrib/jobManagement/browser/jobsView.component';
|
import { JobsViewComponent } from 'sql/workbench/contrib/jobManagement/browser/jobsView.component';
|
||||||
import { AlertsViewComponent } from 'sql/workbench/contrib/jobManagement/browser/alertsView.component';
|
import { AlertsViewComponent } from 'sql/workbench/contrib/jobManagement/browser/alertsView.component';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import { default as AnsiUp } from 'ansi_up';
|
import { default as AnsiUp } from 'ansi_up';
|
||||||
import { IRenderMime } from 'sql/workbench/services/notebook/browser/outputs/renderMimeInterfaces';
|
import { IRenderMime } from 'sql/workbench/services/notebook/browser/outputs/renderMimeInterfaces';
|
||||||
import { URLExt } from '../../common/models/url';
|
import { URLExt } from 'sql/workbench/contrib/notebook/common/models/url';
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export interface IAdminService {
|
|||||||
|
|
||||||
registerProvider(providerId: string, provider: azdata.AdminServicesProvider): void;
|
registerProvider(providerId: string, provider: azdata.AdminServicesProvider): void;
|
||||||
|
|
||||||
getDefaultDatabaseInfo(connectionUri: string): Thenable<azdata.DatabaseInfo>;
|
getDefaultDatabaseInfo(connectionUri: string): Thenable<azdata.DatabaseInfo | undefined>;
|
||||||
|
|
||||||
getDatabaseInfo(connectionUri: string): Thenable<azdata.DatabaseInfo>;
|
getDatabaseInfo(connectionUri: string): Thenable<azdata.DatabaseInfo>;
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ export class AdminService implements IAdminService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getDefaultDatabaseInfo(connectionUri: string): Thenable<azdata.DatabaseInfo> {
|
public getDefaultDatabaseInfo(connectionUri: string): Thenable<azdata.DatabaseInfo | undefined> {
|
||||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||||
if (providerId) {
|
if (providerId) {
|
||||||
let provider = this._providers[providerId];
|
let provider = this._providers[providerId];
|
||||||
|
|||||||
@@ -155,12 +155,7 @@ export class RestoreDialogController implements IRestoreDialogController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private handleOnRestore(isScriptOnly: boolean = false): void {
|
private handleOnRestore(isScriptOnly: boolean = false): void {
|
||||||
let restoreOption = this.setRestoreOption();
|
let restoreOption = this.setRestoreOption(isScriptOnly ? TaskExecutionMode.script : TaskExecutionMode.executeAndScript);
|
||||||
if (isScriptOnly) {
|
|
||||||
restoreOption.taskExecutionMode = TaskExecutionMode.script;
|
|
||||||
} else {
|
|
||||||
restoreOption.taskExecutionMode = TaskExecutionMode.executeAndScript;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._restoreService.restore(this._ownerUri, restoreOption).then(result => {
|
this._restoreService.restore(this._ownerUri, restoreOption).then(result => {
|
||||||
const self = this;
|
const self = this;
|
||||||
@@ -192,7 +187,7 @@ export class RestoreDialogController implements IRestoreDialogController {
|
|||||||
|
|
||||||
private handleMssqlOnValidateFile(overwriteTargetDatabase: boolean = false): void {
|
private handleMssqlOnValidateFile(overwriteTargetDatabase: boolean = false): void {
|
||||||
let restoreDialog = this._restoreDialogs[this._currentProvider] as RestoreDialog;
|
let restoreDialog = this._restoreDialogs[this._currentProvider] as RestoreDialog;
|
||||||
this._restoreService.getRestorePlan(this._ownerUri, this.setRestoreOption(overwriteTargetDatabase)).then(restorePlanResponse => {
|
this._restoreService.getRestorePlan(this._ownerUri, this.setRestoreOption(TaskExecutionMode.execute, overwriteTargetDatabase)).then(restorePlanResponse => {
|
||||||
this._sessionId = restorePlanResponse.sessionId;
|
this._sessionId = restorePlanResponse.sessionId;
|
||||||
|
|
||||||
if (restorePlanResponse.errorMessage) {
|
if (restorePlanResponse.errorMessage) {
|
||||||
@@ -237,12 +232,12 @@ export class RestoreDialogController implements IRestoreDialogController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private setRestoreOption(overwriteTargetDatabase: boolean = false): azdata.RestoreInfo {
|
private setRestoreOption(taskExecutionMode: TaskExecutionMode, overwriteTargetDatabase: boolean = false): azdata.RestoreInfo {
|
||||||
let restoreInfo = undefined;
|
let restoreInfo = undefined;
|
||||||
|
|
||||||
let providerId: string = this.getCurrentProviderId();
|
let providerId: string = this.getCurrentProviderId();
|
||||||
if (providerId === ConnectionConstants.mssqlProviderName) {
|
if (providerId === ConnectionConstants.mssqlProviderName) {
|
||||||
restoreInfo = new MssqlRestoreInfo();
|
restoreInfo = new MssqlRestoreInfo(taskExecutionMode);
|
||||||
|
|
||||||
if (this._sessionId) {
|
if (this._sessionId) {
|
||||||
restoreInfo.sessionId = this._sessionId;
|
restoreInfo.sessionId = this._sessionId;
|
||||||
@@ -287,7 +282,7 @@ export class RestoreDialogController implements IRestoreDialogController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private handleOnCancel(): void {
|
private handleOnCancel(): void {
|
||||||
let restoreInfo = new MssqlRestoreInfo();
|
let restoreInfo = new MssqlRestoreInfo(TaskExecutionMode.execute);
|
||||||
restoreInfo.sessionId = this._sessionId;
|
restoreInfo.sessionId = this._sessionId;
|
||||||
this._restoreService.cancelRestorePlan(this._ownerUri, restoreInfo).then(() => {
|
this._restoreService.cancelRestorePlan(this._ownerUri, restoreInfo).then(() => {
|
||||||
this._connectionService.disconnect(this._ownerUri);
|
this._connectionService.disconnect(this._ownerUri);
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ import * as azdata from 'azdata';
|
|||||||
export class MssqlRestoreInfo implements azdata.RestoreInfo {
|
export class MssqlRestoreInfo implements azdata.RestoreInfo {
|
||||||
|
|
||||||
options: { [name: string]: any };
|
options: { [name: string]: any };
|
||||||
taskExecutionMode: azdata.TaskExecutionMode;
|
|
||||||
|
|
||||||
public constructor() {
|
public constructor(public taskExecutionMode: azdata.TaskExecutionMode) {
|
||||||
this.options = {};
|
this.options = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,4 +92,4 @@ export class MssqlRestoreInfo implements azdata.RestoreInfo {
|
|||||||
public set overwriteTargetDatabase(value: boolean) {
|
public set overwriteTargetDatabase(value: boolean) {
|
||||||
this.options['overwriteTargetDatabase'] = value;
|
this.options['overwriteTargetDatabase'] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ import { SERVER_GROUP_CONFIG, SERVER_GROUP_COLORS_CONFIG } from 'sql/workbench/s
|
|||||||
export class ServerGroupController implements IServerGroupController {
|
export class ServerGroupController implements IServerGroupController {
|
||||||
_serviceBrand: undefined;
|
_serviceBrand: undefined;
|
||||||
|
|
||||||
private _serverGroupDialog: ServerGroupDialog;
|
private _serverGroupDialog?: ServerGroupDialog;
|
||||||
private _callbacks: IServerGroupDialogCallbacks;
|
private _callbacks?: IServerGroupDialogCallbacks;
|
||||||
private _group: ConnectionProfileGroup;
|
private _group?: ConnectionProfileGroup;
|
||||||
private _viewModel: ServerGroupViewModel;
|
private _viewModel?: ServerGroupViewModel;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@IErrorMessageService private _errorMessageService: IErrorMessageService,
|
@IErrorMessageService private _errorMessageService: IErrorMessageService,
|
||||||
@@ -32,13 +32,14 @@ export class ServerGroupController implements IServerGroupController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private handleOnAddServerGroup(): void {
|
private handleOnAddServerGroup(): void {
|
||||||
|
const viewModel = this._viewModel!;
|
||||||
if (this._group) {
|
if (this._group) {
|
||||||
let tempGroup: ConnectionProfileGroup = this.copyConnectionProfileGroup(this._group);
|
let tempGroup: ConnectionProfileGroup = this.copyConnectionProfileGroup(this._group);
|
||||||
this._group.name = this._viewModel.groupName;
|
this._group.name = viewModel.groupName;
|
||||||
this._group.color = this._viewModel.groupColor;
|
this._group.color = viewModel.groupColor;
|
||||||
this._group.description = this._viewModel.groupDescription;
|
this._group.description = viewModel.groupDescription;
|
||||||
this.connectionManagementService.editGroup(this._group).then(() => {
|
this.connectionManagementService.editGroup(this._group).then(() => {
|
||||||
this._serverGroupDialog.close();
|
this._serverGroupDialog!.close();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
// rollback changes made
|
// rollback changes made
|
||||||
this._group = tempGroup;
|
this._group = tempGroup;
|
||||||
@@ -55,9 +56,9 @@ export class ServerGroupController implements IServerGroupController {
|
|||||||
};
|
};
|
||||||
this.connectionManagementService.saveProfileGroup(newGroup).then(groupId => {
|
this.connectionManagementService.saveProfileGroup(newGroup).then(groupId => {
|
||||||
if (this._callbacks) {
|
if (this._callbacks) {
|
||||||
this._callbacks.onAddGroup(this._serverGroupDialog.groupName);
|
this._callbacks.onAddGroup(this._serverGroupDialog!.groupName);
|
||||||
}
|
}
|
||||||
this._serverGroupDialog.close();
|
this._serverGroupDialog!.close();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this._errorMessageService.showDialog(Severity.Error, '', err);
|
this._errorMessageService.showDialog(Severity.Error, '', err);
|
||||||
});
|
});
|
||||||
@@ -76,33 +77,31 @@ export class ServerGroupController implements IServerGroupController {
|
|||||||
|
|
||||||
|
|
||||||
public showCreateGroupDialog(callbacks?: IServerGroupDialogCallbacks): Promise<void> {
|
public showCreateGroupDialog(callbacks?: IServerGroupDialogCallbacks): Promise<void> {
|
||||||
this._group = null;
|
this._group = undefined;
|
||||||
this._viewModel = new ServerGroupViewModel(undefined, this._configurationService.getValue(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
this._viewModel = new ServerGroupViewModel(undefined, this._configurationService.getValue<{ [key: string]: any }>(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
||||||
this._callbacks = callbacks ? callbacks : undefined;
|
this._callbacks = callbacks ? callbacks : undefined;
|
||||||
return this.openServerGroupDialog();
|
return this.openServerGroupDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
public showEditGroupDialog(group: ConnectionProfileGroup): Promise<void> {
|
public showEditGroupDialog(group: ConnectionProfileGroup): Promise<void> {
|
||||||
this._group = group;
|
this._group = group;
|
||||||
this._viewModel = new ServerGroupViewModel(group, this._configurationService.getValue(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
this._viewModel = new ServerGroupViewModel(group, this._configurationService.getValue<{ [key: string]: any }>(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
||||||
return this.openServerGroupDialog();
|
return this.openServerGroupDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private openServerGroupDialog(): Promise<void> {
|
private openServerGroupDialog(): Promise<void> {
|
||||||
if (!this._serverGroupDialog) {
|
if (!this._serverGroupDialog) {
|
||||||
this._serverGroupDialog = this._instantiationService.createInstance(ServerGroupDialog);
|
this._serverGroupDialog = this._instantiationService.createInstance(ServerGroupDialog);
|
||||||
this._serverGroupDialog.viewModel = this._viewModel;
|
this._serverGroupDialog.setViewModel(this._viewModel!);
|
||||||
this._serverGroupDialog.onCancel(() => { });
|
this._serverGroupDialog.onCancel(() => { });
|
||||||
this._serverGroupDialog.onAddServerGroup(() => this.handleOnAddServerGroup());
|
this._serverGroupDialog.onAddServerGroup(() => this.handleOnAddServerGroup());
|
||||||
this._serverGroupDialog.onCloseEvent(() => this.handleOnClose());
|
this._serverGroupDialog.onCloseEvent(() => this.handleOnClose());
|
||||||
this._serverGroupDialog.render();
|
this._serverGroupDialog.render();
|
||||||
} else {
|
} else {
|
||||||
// reset the view model in the view
|
// reset the view model in the view
|
||||||
this._serverGroupDialog.viewModel = this._viewModel;
|
this._serverGroupDialog.setViewModel(this._viewModel!);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise<void>(() => {
|
return Promise.resolve(this._serverGroupDialog.open());
|
||||||
this._serverGroupDialog.open();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,17 +30,21 @@ import { Color } from 'vs/base/common/color';
|
|||||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||||
|
import { assertIsDefined, isUndefinedOrNull } from 'vs/base/common/types';
|
||||||
|
|
||||||
|
interface IRenderedServerGroupDialog {
|
||||||
|
groupNameInputBox: InputBox;
|
||||||
|
groupDescriptionInputBox: InputBox;
|
||||||
|
serverGroupContainer: HTMLElement;
|
||||||
|
addServerButton: Button;
|
||||||
|
closeButton: Button;
|
||||||
|
}
|
||||||
|
|
||||||
export class ServerGroupDialog extends Modal {
|
export class ServerGroupDialog extends Modal {
|
||||||
private _addServerButton: Button;
|
|
||||||
private _closeButton: Button;
|
|
||||||
private _colorColorBoxesMap: Array<{ color: string, colorbox: Colorbox }> = [];
|
private _colorColorBoxesMap: Array<{ color: string, colorbox: Colorbox }> = [];
|
||||||
private _selectedColorOption: number;
|
private _selectedColorOption?: number;
|
||||||
private _groupNameInputBox: InputBox;
|
private _viewModel?: ServerGroupViewModel;
|
||||||
private _groupDescriptionInputBox: InputBox;
|
|
||||||
private _viewModel: ServerGroupViewModel;
|
|
||||||
private _skipGroupNameValidation: boolean = false;
|
private _skipGroupNameValidation: boolean = false;
|
||||||
private _serverGroupContainer: HTMLElement;
|
|
||||||
|
|
||||||
private _onAddServerGroup = new Emitter<void>();
|
private _onAddServerGroup = new Emitter<void>();
|
||||||
public onAddServerGroup: Event<void> = this._onAddServerGroup.event;
|
public onAddServerGroup: Event<void> = this._onAddServerGroup.event;
|
||||||
@@ -51,6 +55,14 @@ export class ServerGroupDialog extends Modal {
|
|||||||
private _onCloseEvent = new Emitter<void>();
|
private _onCloseEvent = new Emitter<void>();
|
||||||
public onCloseEvent: Event<void> = this._onCloseEvent.event;
|
public onCloseEvent: Event<void> = this._onCloseEvent.event;
|
||||||
|
|
||||||
|
// rendered elements
|
||||||
|
private isRendered = false;
|
||||||
|
private _groupNameInputBox?: InputBox;
|
||||||
|
private _groupDescriptionInputBox?: InputBox;
|
||||||
|
private _serverGroupContainer?: HTMLElement;
|
||||||
|
private _addServerButton?: Button;
|
||||||
|
private _closeButton?: Button;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||||
@IThemeService themeService: IThemeService,
|
@IThemeService themeService: IThemeService,
|
||||||
@@ -72,6 +84,7 @@ export class ServerGroupDialog extends Modal {
|
|||||||
this._addServerButton = this.addFooterButton(okLabel, () => this.addGroup());
|
this._addServerButton = this.addFooterButton(okLabel, () => this.addGroup());
|
||||||
this._closeButton = this.addFooterButton(cancelLabel, () => this.cancel());
|
this._closeButton = this.addFooterButton(cancelLabel, () => this.cancel());
|
||||||
this.registerListeners();
|
this.registerListeners();
|
||||||
|
this.isRendered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected layout(height?: number): void {
|
protected layout(height?: number): void {
|
||||||
@@ -139,31 +152,33 @@ export class ServerGroupDialog extends Modal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private focusNext(): void {
|
private focusNext(): void {
|
||||||
if (this._groupNameInputBox.hasFocus()) {
|
const renderedDialog = this.withRenderedDialog;
|
||||||
this._groupDescriptionInputBox.focus();
|
if (renderedDialog.groupNameInputBox.hasFocus()) {
|
||||||
} else if (this._groupDescriptionInputBox.hasFocus()) {
|
renderedDialog.groupDescriptionInputBox.focus();
|
||||||
this._colorColorBoxesMap[this._selectedColorOption].colorbox.focus();
|
} else if (renderedDialog.groupDescriptionInputBox.hasFocus()) {
|
||||||
|
this._colorColorBoxesMap[this._selectedColorOption ?? 0].colorbox.focus();
|
||||||
} else if (this.isFocusOnColors()) {
|
} else if (this.isFocusOnColors()) {
|
||||||
this._addServerButton.enabled ? this._addServerButton.focus() : this._closeButton.focus();
|
renderedDialog.addServerButton.enabled ? renderedDialog.addServerButton.focus() : renderedDialog.closeButton.focus();
|
||||||
} else if (document.activeElement === this._addServerButton.element) {
|
} else if (document.activeElement === renderedDialog.addServerButton.element) {
|
||||||
this._closeButton.focus();
|
renderedDialog.closeButton.focus();
|
||||||
}
|
}
|
||||||
else if (document.activeElement === this._closeButton.element) {
|
else if (document.activeElement === renderedDialog.closeButton.element) {
|
||||||
this._groupNameInputBox.focus();
|
renderedDialog.groupNameInputBox.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private focusPrevious(): void {
|
private focusPrevious(): void {
|
||||||
if (document.activeElement === this._closeButton.element) {
|
const renderedDialog = this.withRenderedDialog;
|
||||||
this._addServerButton.enabled ? this._addServerButton.focus() : this._colorColorBoxesMap[this._selectedColorOption].colorbox.focus();
|
if (document.activeElement === renderedDialog.closeButton.element) {
|
||||||
} else if (document.activeElement === this._addServerButton.element) {
|
renderedDialog.addServerButton.enabled ? renderedDialog.addServerButton.focus() : this._colorColorBoxesMap[this._selectedColorOption ?? 0].colorbox.focus();
|
||||||
this._colorColorBoxesMap[this._selectedColorOption].colorbox.focus();
|
} else if (document.activeElement === renderedDialog.addServerButton.element) {
|
||||||
|
this._colorColorBoxesMap[this._selectedColorOption ?? 0].colorbox.focus();
|
||||||
} else if (this.isFocusOnColors()) {
|
} else if (this.isFocusOnColors()) {
|
||||||
this._groupDescriptionInputBox.focus();
|
renderedDialog.groupDescriptionInputBox.focus();
|
||||||
} else if (this._groupDescriptionInputBox.hasFocus()) {
|
} else if (renderedDialog.groupDescriptionInputBox.hasFocus()) {
|
||||||
this._groupNameInputBox.focus();
|
renderedDialog.groupNameInputBox.focus();
|
||||||
} else if (this._groupNameInputBox.hasFocus()) {
|
} else if (renderedDialog.groupNameInputBox.hasFocus()) {
|
||||||
this._closeButton.focus();
|
renderedDialog.closeButton.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,32 +211,33 @@ export class ServerGroupDialog extends Modal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private onSelectGroupColor(colorToSelect: string): void {
|
private onSelectGroupColor(colorToSelect: string): void {
|
||||||
this._viewModel.groupColor = colorToSelect;
|
this.withViewModel.groupColor = colorToSelect;
|
||||||
this._selectedColorOption = this._viewModel.colors.indexOf(colorToSelect);
|
this._selectedColorOption = this.withViewModel.colors.indexOf(colorToSelect);
|
||||||
this.updateView();
|
this.updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
private registerListeners(): void {
|
private registerListeners(): void {
|
||||||
|
const renderedDialog = this.withRenderedDialog;
|
||||||
// Theme styler
|
// Theme styler
|
||||||
this._register(attachInputBoxStyler(this._groupNameInputBox, this._themeService));
|
this._register(attachInputBoxStyler(renderedDialog.groupNameInputBox, this._themeService));
|
||||||
this._register(attachInputBoxStyler(this._groupDescriptionInputBox, this._themeService));
|
this._register(attachInputBoxStyler(renderedDialog.groupDescriptionInputBox, this._themeService));
|
||||||
this._register(attachButtonStyler(this._addServerButton, this._themeService));
|
this._register(attachButtonStyler(renderedDialog.addServerButton, this._themeService));
|
||||||
this._register(attachButtonStyler(this._closeButton, this._themeService));
|
this._register(attachButtonStyler(renderedDialog.closeButton, this._themeService));
|
||||||
|
|
||||||
// handler for name change events
|
// handler for name change events
|
||||||
this._register(this._groupNameInputBox.onDidChange(groupName => {
|
this._register(renderedDialog.groupNameInputBox.onDidChange(groupName => {
|
||||||
this.groupNameChanged(groupName);
|
this.groupNameChanged(groupName);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// handler for description change events
|
// handler for description change events
|
||||||
this._register(this._groupDescriptionInputBox.onDidChange(groupDescription => {
|
this._register(renderedDialog.groupDescriptionInputBox.onDidChange(groupDescription => {
|
||||||
this.groupDescriptionChanged(groupDescription);
|
this.groupDescriptionChanged(groupDescription);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private fillGroupColors(container: HTMLElement): void {
|
private fillGroupColors(container: HTMLElement): void {
|
||||||
for (let i = 0; i < this._viewModel.colors.length; i++) {
|
for (let i = 0; i < this.withViewModel.colors.length; i++) {
|
||||||
const color = this._viewModel.colors[i];
|
const color = this.withViewModel.colors[i];
|
||||||
|
|
||||||
const colorColorBox = new Colorbox(container, {
|
const colorColorBox = new Colorbox(container, {
|
||||||
name: 'server-group-color',
|
name: 'server-group-color',
|
||||||
@@ -245,31 +261,32 @@ export class ServerGroupDialog extends Modal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private groupNameChanged(groupName: string) {
|
private groupNameChanged(groupName: string) {
|
||||||
this._viewModel.groupName = groupName;
|
this.withViewModel.groupName = groupName;
|
||||||
this.updateView();
|
this.updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
private groupDescriptionChanged(groupDescription: string) {
|
private groupDescriptionChanged(groupDescription: string) {
|
||||||
this._viewModel.groupDescription = groupDescription;
|
this.withViewModel.groupDescription = groupDescription;
|
||||||
this.updateView();
|
this.updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public get groupName(): string {
|
public get groupName(): string {
|
||||||
return this._groupNameInputBox.value;
|
return this.withRenderedDialog.groupNameInputBox.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get groupDescription(): string {
|
public get groupDescription(): string {
|
||||||
return this._groupDescriptionInputBox.value;
|
return this.withRenderedDialog.groupDescriptionInputBox.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get selectedColor(): string {
|
public get selectedColor(): string | undefined {
|
||||||
return this._colorColorBoxesMap[this._selectedColorOption].color;
|
return !isUndefinedOrNull(this._selectedColorOption) ? this._colorColorBoxesMap[this._selectedColorOption].color : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get viewModel(): ServerGroupViewModel {
|
public get viewModel(): ServerGroupViewModel | undefined {
|
||||||
return this._viewModel;
|
return this._viewModel;
|
||||||
}
|
}
|
||||||
public set viewModel(theViewModel: ServerGroupViewModel) {
|
|
||||||
|
public setViewModel(theViewModel: ServerGroupViewModel) {
|
||||||
this._viewModel = theViewModel;
|
this._viewModel = theViewModel;
|
||||||
if (this._serverGroupContainer) {
|
if (this._serverGroupContainer) {
|
||||||
DOM.clearNode(this._serverGroupContainer);
|
DOM.clearNode(this._serverGroupContainer);
|
||||||
@@ -278,7 +295,7 @@ export class ServerGroupDialog extends Modal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public addGroup(): void {
|
public addGroup(): void {
|
||||||
if (this._addServerButton.enabled) {
|
if (this.withRenderedDialog.addServerButton.enabled) {
|
||||||
if (this.validateInputs()) {
|
if (this.validateInputs()) {
|
||||||
this._onAddServerGroup.fire();
|
this._onAddServerGroup.fire();
|
||||||
}
|
}
|
||||||
@@ -290,22 +307,24 @@ export class ServerGroupDialog extends Modal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private validateInputs(): boolean {
|
private validateInputs(): boolean {
|
||||||
let validate = this._groupNameInputBox.validate();
|
const renderedDialog = this.withRenderedDialog;
|
||||||
|
let validate = renderedDialog.groupNameInputBox.validate();
|
||||||
if (!validate) {
|
if (!validate) {
|
||||||
this._groupNameInputBox.focus();
|
renderedDialog.groupNameInputBox.focus();
|
||||||
}
|
}
|
||||||
return validate;
|
return validate;
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize the view based on the current state of the view model
|
// initialize the view based on the current state of the view model
|
||||||
private initializeView(): void {
|
private initializeView(): void {
|
||||||
this.title = this._viewModel.getDialogTitle();
|
const renderedDialog = this.withRenderedDialog;
|
||||||
|
this.title = this.withViewModel.getDialogTitle();
|
||||||
|
|
||||||
this._skipGroupNameValidation = true;
|
this._skipGroupNameValidation = true;
|
||||||
this._groupNameInputBox.value = this._viewModel.groupName;
|
renderedDialog.groupNameInputBox.value = this.withViewModel.groupName;
|
||||||
this._skipGroupNameValidation = false;
|
this._skipGroupNameValidation = false;
|
||||||
|
|
||||||
this._groupDescriptionInputBox.value = this._viewModel.groupDescription;
|
renderedDialog.groupDescriptionInputBox.value = this.withViewModel.groupDescription ?? '';
|
||||||
|
|
||||||
this.updateView();
|
this.updateView();
|
||||||
}
|
}
|
||||||
@@ -315,16 +334,19 @@ export class ServerGroupDialog extends Modal {
|
|||||||
// check the color buttons and if their checked state does not match the view model state then correct it
|
// check the color buttons and if their checked state does not match the view model state then correct it
|
||||||
for (let i = 0; i < this._colorColorBoxesMap.length; i++) {
|
for (let i = 0; i < this._colorColorBoxesMap.length; i++) {
|
||||||
let { colorbox: colorbox, color } = this._colorColorBoxesMap[i];
|
let { colorbox: colorbox, color } = this._colorColorBoxesMap[i];
|
||||||
if ((this._viewModel.groupColor === color) && (colorbox.checked === false)) {
|
if ((this.withViewModel.groupColor === color) && (colorbox.checked === false)) {
|
||||||
colorbox.checked = true;
|
colorbox.checked = true;
|
||||||
this._selectedColorOption = i;
|
this._selectedColorOption = i;
|
||||||
} else if ((this._viewModel.groupColor !== color) && (colorbox.checked === true)) {
|
} else if ((this.withViewModel.groupColor !== color) && (colorbox.checked === true)) {
|
||||||
colorbox.checked = false;
|
colorbox.checked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// OK button state - enabled if there are pending changes that can be saved
|
// OK button state - enabled if there are pending changes that can be saved
|
||||||
this._addServerButton.enabled = this._viewModel.hasPendingChanges();
|
this.withRenderedDialog.addServerButton.enabled = this.withViewModel.hasPendingChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
private get withViewModel(): ServerGroupViewModel {
|
||||||
|
return assertIsDefined(this._viewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Overwrite escape key behavior */
|
/* Overwrite escape key behavior */
|
||||||
@@ -344,15 +366,30 @@ export class ServerGroupDialog extends Modal {
|
|||||||
|
|
||||||
public close() {
|
public close() {
|
||||||
this.hide();
|
this.hide();
|
||||||
this._groupNameInputBox.hideMessage();
|
this.withRenderedDialog.groupNameInputBox.hideMessage();
|
||||||
this._onCloseEvent.fire();
|
this._onCloseEvent.fire();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private get withRenderedDialog(): IRenderedServerGroupDialog {
|
||||||
|
if (this.isRendered) {
|
||||||
|
// we assume if we are rendered then all our rendered elements are defined
|
||||||
|
return {
|
||||||
|
groupNameInputBox: this._groupNameInputBox!,
|
||||||
|
groupDescriptionInputBox: this._groupDescriptionInputBox!,
|
||||||
|
serverGroupContainer: this._serverGroupContainer!,
|
||||||
|
addServerButton: this._addServerButton!,
|
||||||
|
closeButton: this._closeButton!
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
throw new Error('Server Group Dialog Not Rendered');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public open() {
|
public open() {
|
||||||
// reset the dialog
|
// reset the dialog
|
||||||
this.hideError();
|
this.hideError();
|
||||||
this.initializeView();
|
this.initializeView();
|
||||||
this.show();
|
this.show();
|
||||||
this._groupNameInputBox.focus();
|
this.withRenderedDialog.groupNameInputBox.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import * as strings from 'vs/base/common/strings';
|
|||||||
|
|
||||||
export class ServerGroupViewModel {
|
export class ServerGroupViewModel {
|
||||||
public groupName: string;
|
public groupName: string;
|
||||||
public groupDescription: string;
|
public groupDescription?: string;
|
||||||
public groupColor: string;
|
public groupColor?: string;
|
||||||
public colors: string[] = ['#515151', '#004760', '#771b00', '#700060', '#a17d01', '#006749', '#654502', '#3A0293'];
|
public colors: string[] = ['#515151', '#004760', '#771b00', '#700060', '#a17d01', '#006749', '#654502', '#3A0293'];
|
||||||
|
|
||||||
private _domainModel: IConnectionProfileGroup;
|
private _domainModel?: IConnectionProfileGroup;
|
||||||
private _editMode: boolean;
|
private _editMode: boolean;
|
||||||
private readonly _addServerGroupTitle: string = localize('serverGroup.addServerGroup', "Add server group");
|
private readonly _addServerGroupTitle: string = localize('serverGroup.addServerGroup', "Add server group");
|
||||||
private readonly _editServerGroupTitle: string = localize('serverGroup.editServerGroup', "Edit server group");
|
private readonly _editServerGroupTitle: string = localize('serverGroup.editServerGroup', "Edit server group");
|
||||||
@@ -67,4 +67,4 @@ export class ServerGroupViewModel {
|
|||||||
return this._addServerGroupTitle;
|
return this._addServerGroupTitle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,51 +25,72 @@
|
|||||||
// "./vs/code/**/*.ts",
|
// "./vs/code/**/*.ts",
|
||||||
"./vs/editor/**/*.ts",
|
"./vs/editor/**/*.ts",
|
||||||
"./vs/platform/**/*.ts",
|
"./vs/platform/**/*.ts",
|
||||||
// "./vs/workbench/api/common/**/*.ts",
|
"./vs/workbench/contrib/debug/common/debugProtocol.d.ts",
|
||||||
// "./vs/workbench/api/worker/**/*.ts",
|
"./vs/workbench/services/**/*.ts",
|
||||||
// "./vs/workbench/browser/**/*.ts",
|
"./sql/workbench/services/**/*.ts",
|
||||||
// "./vs/workbench/common/**/*.ts",
|
|
||||||
// "./vs/workbench/contrib/debug/common/debugProtocol.d.ts",
|
|
||||||
// "./vs/workbench/electron-browser/**/*.ts",
|
|
||||||
// "./vs/workbench/services/activity/**/*.ts",
|
|
||||||
// "./vs/workbench/services/activityBar/**/*.ts",
|
|
||||||
// "./vs/workbench/services/authentication/**/*.ts",
|
|
||||||
// "./vs/workbench/services/bulkEdit/**/*.ts",
|
|
||||||
// "./vs/workbench/services/clipboard/**/*.ts",
|
|
||||||
// "./vs/workbench/services/commands/**/*.ts",
|
|
||||||
// "./vs/workbench/services/contextmenu/**/*.ts",
|
|
||||||
// "./vs/workbench/services/decorations/**/*.ts",
|
|
||||||
// "./vs/workbench/services/electron/**/*.ts",
|
|
||||||
// "./vs/workbench/services/extensionResourceLoader/**/*.ts",
|
|
||||||
// "./vs/workbench/services/integrity/**/*.ts",
|
|
||||||
// "./vs/workbench/services/issue/**/*.ts",
|
|
||||||
// "./vs/workbench/services/layout/**/*.ts",
|
|
||||||
// "./vs/workbench/services/lifecycle/**/*.ts",
|
|
||||||
// "./vs/workbench/services/localizations/**/*.ts",
|
|
||||||
// "./vs/workbench/services/log/**/*.ts",
|
|
||||||
// "./vs/workbench/services/menubar/**/*.ts",
|
|
||||||
// "./vs/workbench/services/mode/**/*.ts",
|
|
||||||
// "./vs/workbench/services/notification/**/*.ts",
|
|
||||||
// "./vs/workbench/services/request/**/*.ts",
|
|
||||||
// "./vs/workbench/services/sharedProcess/**/*.ts",
|
|
||||||
// "./vs/workbench/services/statusbar/**/*.ts",
|
|
||||||
// "./vs/workbench/services/textMate/**/*.ts",
|
|
||||||
// "./vs/workbench/services/title/**/*.ts",
|
|
||||||
// "./vs/workbench/services/untitled/**/*.ts",
|
|
||||||
// "./vs/workbench/services/userDataSync/**/*.ts",
|
|
||||||
// "./vs/workbench/services/**/test/**/*.ts",
|
|
||||||
"./sql/base/**/*.ts",
|
"./sql/base/**/*.ts",
|
||||||
"./sql/editor/**/*.ts",
|
"./sql/editor/**/*.ts",
|
||||||
"./sql/platform/**/*.ts",
|
"./sql/platform/**/*.ts"
|
||||||
// "./sql/workbench/api/common/**/*.ts",
|
|
||||||
// "./sql/workbench/api/worker/**/*.ts",
|
|
||||||
// "./sql/workbench/browser/**/*.ts",
|
|
||||||
// "./sql/workbench/common/**/*.ts",
|
|
||||||
// "./sql/workbench/electron-browser/**/*.ts",
|
|
||||||
// "./sql/workbench/services/**/test/**/*.ts"
|
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"./vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts",
|
"./vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts",
|
||||||
"./vs/workbench/common/editor/editorGroup.ts"
|
// sql services
|
||||||
|
"./sql/workbench/services/accountManagement/**/*.ts", // 3101 errors
|
||||||
|
"./sql/workbench/services/bootstrap/**/*.ts", // 3087 errors
|
||||||
|
"./sql/workbench/services/connection/**/*.ts", // 3192 errors
|
||||||
|
"./sql/workbench/services/dashboard/**/*.ts", // 57 errors
|
||||||
|
"./sql/workbench/services/dialog/**/*.ts", // 3094 errors
|
||||||
|
"./sql/workbench/services/errorMessage/**/*.ts", // 61 errors
|
||||||
|
"./sql/workbench/services/fileBrowser/**/*.ts", // 3087
|
||||||
|
"./sql/workbench/services/insights/**/*.ts", // 3151
|
||||||
|
"./sql/workbench/services/jobManagement/**/*.ts", // 3132
|
||||||
|
"./sql/workbench/services/languageAssociation/**/*.ts", // 3087
|
||||||
|
"./sql/workbench/services/notebook/**/*.ts", // 3087
|
||||||
|
"./sql/workbench/services/objectExplorer/**/*.ts", // 3143
|
||||||
|
"./sql/workbench/services/profiler/**/*.ts", // 3087
|
||||||
|
"./sql/workbench/services/query/**/*.ts", // 3089
|
||||||
|
"./sql/workbench/services/queryEditor/**/*.ts", // 3087
|
||||||
|
"./sql/workbench/services/queryHistory/**/*.ts", // 3091
|
||||||
|
"./sql/workbench/services/resourceProvider/**/*.ts", // 70
|
||||||
|
"./sql/workbench/services/restore/**/*.ts", // 3100
|
||||||
|
"./sql/workbench/services/serverGroup/**/*.ts", // 49
|
||||||
|
// vs services
|
||||||
|
"./vs/workbench/services/accessibility/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/authentication/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/backup/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/bulkEdit/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/configuration/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/configurationResolver/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/credentials/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/dialogs/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/editor/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/environment/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/extensionManagement/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/extensions/**/*.ts", // 3287
|
||||||
|
"./vs/workbench/services/filesConfiguration/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/history/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/host/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/keybinding/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/label/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/output/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/path/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/preferences/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/progress/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/remote/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/search/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/telemetry/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/textfile/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/textmodelResolver/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/textresourceProperties/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/themes/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/timer/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/untitled/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/update/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/url/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/userData/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/viewlet/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/views/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/workingCopy/**/*.ts", // 3087
|
||||||
|
"./vs/workbench/services/workspaces/**/*.ts", // 3087
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -795,13 +795,9 @@ export class TabsTitleControl extends TitleControl {
|
|||||||
|
|
||||||
// {{SQL CARBON EDIT}} -- Display the editor's tab color
|
// {{SQL CARBON EDIT}} -- Display the editor's tab color
|
||||||
if (isTab) {
|
if (isTab) {
|
||||||
const tabContainer = this.tabsContainer.children[index];
|
this.doWithTab(index!, editor!, (editor, index, tabContainer) => {
|
||||||
if (tabContainer instanceof HTMLElement) {
|
this.setEditorTabColor(editor, tabContainer, isActiveTab);
|
||||||
let editor = this.group.getEditors(index);
|
});
|
||||||
if (editor.length > 0) {
|
|
||||||
this.setEditorTabColor(editor[0], tabContainer, isActiveTab);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor {
|
|||||||
private diffNavigator: DiffNavigator | undefined;
|
private diffNavigator: DiffNavigator | undefined;
|
||||||
private readonly diffNavigatorDisposables = this._register(new DisposableStore());
|
private readonly diffNavigatorDisposables = this._register(new DisposableStore());
|
||||||
|
|
||||||
private reverseColor: boolean; // {{SQL CARBON EDIT}} add property
|
private reverseColor?: boolean; // {{SQL CARBON EDIT}} add property
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ITelemetryService telemetryService: ITelemetryService,
|
@ITelemetryService telemetryService: ITelemetryService,
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export abstract class MenubarControl extends Disposable {
|
|||||||
// 'Terminal': IMenu; {{SQL CARBON EDIT}} - Disable unusued menus
|
// 'Terminal': IMenu; {{SQL CARBON EDIT}} - Disable unusued menus
|
||||||
'Window'?: IMenu;
|
'Window'?: IMenu;
|
||||||
'Help': IMenu;
|
'Help': IMenu;
|
||||||
// [index: string]: IMenu | undefined; {{SQL CARBON EDIT}} - Disable unusued menus
|
[index: string]: IMenu | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
protected topLevelTitles: { [menu: string]: string } = {
|
protected topLevelTitles: { [menu: string]: string } = {
|
||||||
|
|||||||
@@ -2818,7 +2818,7 @@ export class InstallVSIXAction extends Action {
|
|||||||
|
|
||||||
static readonly ID = 'workbench.extensions.action.installVSIX';
|
static readonly ID = 'workbench.extensions.action.installVSIX';
|
||||||
static readonly LABEL = localize('installVSIX', "Install from VSIX...");
|
static readonly LABEL = localize('installVSIX', "Install from VSIX...");
|
||||||
static readonly AVAILABLE = !(product.disabledFeatures?.indexOf(InstallVSIXAction.ID) >= 0); // {{SQL CARBON EDIT}} add available logic
|
static readonly AVAILABLE = !(product.disabledFeatures && product.disabledFeatures.indexOf(InstallVSIXAction.ID) >= 0); // {{SQL CARBON EDIT}} add available logic
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
id = InstallVSIXAction.ID,
|
id = InstallVSIXAction.ID,
|
||||||
|
|||||||
@@ -130,9 +130,9 @@ class Extension implements IExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
get downloadPage(): string {
|
get downloadPage(): string | undefined {
|
||||||
if (!this.productService.extensionsGallery) {
|
if (!this.productService.extensionsGallery) {
|
||||||
return null;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.gallery && this.gallery.assets && this.gallery.assets.downloadPage && this.gallery.assets.downloadPage.uri;
|
return this.gallery && this.gallery.assets && this.gallery.assets.downloadPage && this.gallery.assets.downloadPage.uri;
|
||||||
@@ -846,7 +846,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||||||
if (extension.publisherDisplayName === 'Microsoft') {
|
if (extension.publisherDisplayName === 'Microsoft') {
|
||||||
await this.downloadOrBrowse(extension);
|
await this.downloadOrBrowse(extension);
|
||||||
} else {
|
} else {
|
||||||
return Promise.resolve(null);
|
return Promise.reject(new Error('Extension Not Allowed'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.downloadOrBrowse(extension);
|
await this.downloadOrBrowse(extension);
|
||||||
@@ -856,11 +856,11 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
private downloadOrBrowse(ext: IExtension): Promise<any> {
|
private downloadOrBrowse(ext: IExtension): Promise<any> {
|
||||||
if (ext.gallery.assets.downloadPage && ext.gallery.assets.downloadPage.uri) {
|
if (ext.gallery!.assets.downloadPage && ext.gallery!.assets.downloadPage.uri) {
|
||||||
this.openerService.open(URI.parse(ext.gallery.assets.downloadPage.uri));
|
this.openerService.open(URI.parse(ext.gallery!.assets.downloadPage.uri));
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
} else {
|
} else {
|
||||||
return this.extensionService.installFromGallery(ext.gallery);
|
return this.extensionService.installFromGallery(ext.gallery!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// {{SQL CARBON EDIT}} - End
|
// {{SQL CARBON EDIT}} - End
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ export interface IExtension {
|
|||||||
readonly latestVersion: string;
|
readonly latestVersion: string;
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
readonly url?: string;
|
readonly url?: string;
|
||||||
// {{SQL CARBON EDIT}}
|
readonly downloadPage?: string; // {{SQL CARBON EDIT}}
|
||||||
readonly downloadPage?: string;
|
|
||||||
readonly repository?: string;
|
readonly repository?: string;
|
||||||
readonly iconUrl: string;
|
readonly iconUrl: string;
|
||||||
readonly iconUrlFallback: string;
|
readonly iconUrlFallback: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user