mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
use modal confirmation dialog (#16247)
This commit is contained in:
@@ -16,7 +16,7 @@ import * as nls from 'vs/nls';
|
|||||||
import { IEditorAction } from 'vs/editor/common/editorCommon';
|
import { IEditorAction } from 'vs/editor/common/editorCommon';
|
||||||
import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||||
|
|
||||||
export class ProfilerConnect extends Action {
|
export class ProfilerConnect extends Action {
|
||||||
private static readonly ConnectText = nls.localize('profilerAction.connect', "Connect");
|
private static readonly ConnectText = nls.localize('profilerAction.connect', "Connect");
|
||||||
@@ -150,22 +150,18 @@ export class ProfilerClear extends Action {
|
|||||||
|
|
||||||
constructor(id: string,
|
constructor(id: string,
|
||||||
label: string,
|
label: string,
|
||||||
@INotificationService private _notificationService: INotificationService) {
|
@IDialogService private _dialogService: IDialogService) {
|
||||||
super(id, label, 'clear-results');
|
super(id, label, 'clear-results');
|
||||||
}
|
}
|
||||||
|
|
||||||
override async run(input: ProfilerInput): Promise<void> {
|
override async run(input: ProfilerInput): Promise<void> {
|
||||||
this._notificationService.prompt(Severity.Warning, nls.localize('profiler.clearDataPrompt', "Are you sure you want to clear the data?"), [
|
const result = await this._dialogService.confirm({
|
||||||
{
|
type: 'question',
|
||||||
label: nls.localize('profiler.yes', "Yes"),
|
message: nls.localize('profiler.clearDataPrompt', "Are you sure you want to clear the data?")
|
||||||
run: () => {
|
});
|
||||||
input.data.clear();
|
if (result.confirmed) {
|
||||||
}
|
input.data.clear();
|
||||||
}, {
|
}
|
||||||
label: nls.localize('profiler.no', "No"),
|
|
||||||
run: () => { }
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,22 +311,18 @@ export class ProfilerClearSessionFilter extends Action {
|
|||||||
constructor(
|
constructor(
|
||||||
id: string,
|
id: string,
|
||||||
label: string,
|
label: string,
|
||||||
@INotificationService private _notificationService: INotificationService
|
@IDialogService private _dialogService: IDialogService
|
||||||
) {
|
) {
|
||||||
super(id, label, 'clear-filter');
|
super(id, label, 'clear-filter');
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async run(input: ProfilerInput): Promise<void> {
|
public override async run(input: ProfilerInput): Promise<void> {
|
||||||
this._notificationService.prompt(Severity.Warning, nls.localize('profiler.clearFilterPrompt', "Are you sure you want to clear the filters?"), [
|
const result = await this._dialogService.confirm({
|
||||||
{
|
type: 'question',
|
||||||
label: nls.localize('profiler.yes', "Yes"),
|
message: nls.localize('profiler.clearFilterPrompt', "Are you sure you want to clear the filters?")
|
||||||
run: () => {
|
});
|
||||||
input.clearFilter();
|
if (result.confirmed) {
|
||||||
}
|
input.clearFilter();
|
||||||
}, {
|
}
|
||||||
label: nls.localize('profiler.no', "No"),
|
|
||||||
run: () => { }
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user