Skip to content

Commit

Permalink
Add connecting title to spinner for Connection dialog (#9623)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-Gagnon committed Mar 16, 2020
1 parent d6d3316 commit 64eb406
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/sql/workbench/browser/modal/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { find, firstIndex } from 'vs/base/common/arrays';
import { IThemable } from 'vs/base/common/styler';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { alert } from 'vs/base/browser/ui/aria/aria';

export enum MessageLevel {
Error = 0,
Expand Down Expand Up @@ -63,6 +64,7 @@ export interface IModalOptions {
hasTitleIcon?: boolean;
hasErrors?: boolean;
hasSpinner?: boolean;
spinnerTitle?: string;
}

const defaultOptions: IModalOptions = {
Expand Down Expand Up @@ -245,6 +247,7 @@ export abstract class Modal extends Disposable implements IThemable {
this._modalFooterSection = DOM.append(this._modalContent, DOM.$('.modal-footer'));
if (this._modalOptions.hasSpinner) {
this._spinnerElement = DOM.append(this._modalFooterSection, DOM.$('.codicon.in-progress'));
this._spinnerElement.setAttribute('title', this._modalOptions.spinnerTitle);
DOM.hide(this._spinnerElement);
}
this._leftFooter = DOM.append(this._modalFooterSection, DOM.$('.left-footer'));
Expand Down Expand Up @@ -511,6 +514,9 @@ export abstract class Modal extends Disposable implements IThemable {
if (this._modalOptions.hasSpinner) {
if (show) {
DOM.show(this._spinnerElement);
if (this._modalOptions.spinnerTitle) {
alert(this._modalOptions.spinnerTitle);
}
} else {
DOM.hide(this._spinnerElement);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,17 @@ export class ConnectionDialogWidget extends Modal {
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(localize('connection', "Connection"), TelemetryKeys.Connection, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { hasSpinner: true, hasErrors: true });
super(
localize('connection', "Connection"),
TelemetryKeys.Connection,
telemetryService,
layoutService,
clipboardService,
themeService,
logService,
textResourcePropertiesService,
contextKeyService,
{ hasSpinner: true, spinnerTitle: localize('connecting', "Connecting"), hasErrors: true });
}

/**
Expand Down

0 comments on commit 64eb406

Please sign in to comment.