Skip to content

Commit 6aaad34

Browse files
Kateryna ProkopenkoDevtools-frontend LUCI CQ
authored andcommitted
[GM3Restyling] Update rest of NavigatorView confirm dialogs
Namely: exclude folder, delete folder and delete file dialogs Screenshot: https://imgur.com/a/DHwyLP1 Bug: 325442935 Change-Id: Id452092f56a87c3c54dd4e53f23346d50b285157 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6257567 Auto-Submit: Kateryna Prokopenko <[email protected]> Commit-Queue: Kateryna Prokopenko <[email protected]> Reviewed-by: Kim-Anh Tran <[email protected]>
1 parent 941b581 commit 6aaad34

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

front_end/panels/sources/NavigatorView.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,15 @@ const UIStrings = {
8080
/**
8181
*@description Text in Navigator View of the Sources panel
8282
*/
83-
areYouSureYouWantToExcludeThis: 'Are you sure you want to exclude this folder?',
83+
excludeThisFolder: 'Exclude this folder?',
84+
/**
85+
*@description Text in a dialog which appears when users click on 'Exclude from Workspace' menu item
86+
*/
87+
folderWillNotBeShown: 'This folder and its contents will not be shown in workspace.',
8488
/**
8589
*@description Text in Navigator View of the Sources panel
8690
*/
87-
areYouSureYouWantToDeleteThis: 'Are you sure you want to delete this file?',
91+
deleteThisFile: 'Delete this file?',
8892
/**
8993
*@description A context menu item in the Navigator View of the Sources panel
9094
*/
@@ -104,9 +108,9 @@ const UIStrings = {
104108
/**
105109
*@description Text in Navigator View of the Sources panel
106110
*/
107-
areYouSureYouWantToDeleteFolder: 'Are you sure you want to delete this folder and its contents?',
111+
deleteFolder: 'Delete this folder and its contents?',
108112
/**
109-
*@description Text in Navigator View of the Sources panel. A confirmation message on action to delete a folder.
113+
*@description Text in Navigator View of the Sources panel. A confirmation message on action to delete a folder or file.
110114
*/
111115
actionCannotBeUndone: 'This action cannot be undone.',
112116
/**
@@ -974,7 +978,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
974978
private async handleContextMenuExclude(
975979
project: Workspace.Workspace.Project, path: Platform.DevToolsPath.EncodedPathString): Promise<void> {
976980
const shouldExclude = await UI.UIUtils.ConfirmDialog.show(
977-
i18nString(UIStrings.areYouSureYouWantToExcludeThis), undefined, undefined,
981+
i18nString(UIStrings.folderWillNotBeShown), i18nString(UIStrings.excludeThisFolder), undefined,
978982
{jslogContext: 'exclude-folder-confirmation'});
979983
if (shouldExclude) {
980984
UI.UIUtils.startBatchUpdate();
@@ -986,7 +990,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
986990

987991
private async handleContextMenuDelete(uiSourceCode: Workspace.UISourceCode.UISourceCode): Promise<void> {
988992
const shouldDelete = await UI.UIUtils.ConfirmDialog.show(
989-
i18nString(UIStrings.areYouSureYouWantToDeleteThis), undefined, undefined,
993+
i18nString(UIStrings.actionCannotBeUndone), i18nString(UIStrings.deleteThisFile), undefined,
990994
{jslogContext: 'delete-file-confirmation'});
991995
if (shouldDelete) {
992996
uiSourceCode.project().deleteFile(uiSourceCode);
@@ -1015,10 +1019,9 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
10151019
}
10161020

10171021
private async handleDeleteFolder(node: NavigatorTreeNode): Promise<void> {
1018-
const warningMsg =
1019-
`${i18nString(UIStrings.areYouSureYouWantToDeleteFolder)}\n${i18nString(UIStrings.actionCannotBeUndone)}`;
10201022
const shouldRemove = await UI.UIUtils.ConfirmDialog.show(
1021-
warningMsg, undefined, undefined, {jslogContext: 'delete-folder-confirmation'});
1023+
i18nString(UIStrings.actionCannotBeUndone), i18nString(UIStrings.deleteFolder), undefined,
1024+
{jslogContext: 'delete-folder-confirmation'});
10221025
if (shouldRemove) {
10231026
Host.userMetrics.actionTaken(Host.UserMetrics.Action.OverrideTabDeleteFolderContextMenu);
10241027
const topNode = this.findTopNonMergedNode(node);

front_end/ui/legacy/confirmDialog.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
.header {
1414
display: flex;
1515
margin: var(--sys-size-5) var(--sys-size-5) var(--sys-size-5) var(--sys-size-8);
16+
padding-top: var(--sys-size-3);
1617
font: var(--sys-typescale-body2-medium);
1718
}
1819

0 commit comments

Comments
 (0)