mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
Add connecting title to spinner for Connection dialog (#9623)
This commit is contained in:
@@ -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,
|
||||
@@ -63,6 +64,7 @@ export interface IModalOptions {
|
||||
hasTitleIcon?: boolean;
|
||||
hasErrors?: boolean;
|
||||
hasSpinner?: boolean;
|
||||
spinnerTitle?: string;
|
||||
}
|
||||
|
||||
const defaultOptions: IModalOptions = {
|
||||
@@ -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'));
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user