From d75865fac59b5750c3acb53f0fea1e5dcb436410 Mon Sep 17 00:00:00 2001 From: ziggabyte Date: Fri, 29 Nov 2024 10:04:52 +0100 Subject: [PATCH 1/2] Add confirm dialog to describe that converting to a static list will make the list empty. --- src/features/views/l10n/messageIds.ts | 9 ++++++++- src/features/views/layout/SingleViewLayout.tsx | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/features/views/l10n/messageIds.ts b/src/features/views/l10n/messageIds.ts index a98f2e310c..4e71dc8d19 100644 --- a/src/features/views/l10n/messageIds.ts +++ b/src/features/views/l10n/messageIds.ts @@ -419,7 +419,14 @@ export default makeMessages('feat.views', { delete: m('Delete list'), editQuery: m('Edit Smart Search query'), makeDynamic: m('Convert to Smart Search list'), - makeStatic: m('Convert to static list'), + makeStatic: { + confirmDialogInfo: m( + 'If you convert this list to a static list the Smart Search will be removed and the list will be empty, as all the people the Smart Search returned will no longer be there.' + ), + confirmDialogSubmitLabel: m('Convert'), + confirmDialogTitle: m('Convert to static list'), + label: m('Convert to static list'), + }, }, jumpMenu: { placeholder: m('Start typing to find list'), diff --git a/src/features/views/layout/SingleViewLayout.tsx b/src/features/views/layout/SingleViewLayout.tsx index b664d4a9c8..06da3cf130 100644 --- a/src/features/views/layout/SingleViewLayout.tsx +++ b/src/features/views/layout/SingleViewLayout.tsx @@ -102,9 +102,15 @@ const SingleViewLayout: FunctionComponent = ({ onSelect: () => setQueryDialogOpen(true), }); ellipsisMenu.push({ - label: messages.viewLayout.ellipsisMenu.makeStatic(), + label: messages.viewLayout.ellipsisMenu.makeStatic.label(), onSelect: () => { - deleteContentQuery(); + showConfirmDialog({ + onSubmit: deleteContentQuery, + title: + messages.viewLayout.ellipsisMenu.makeStatic.confirmDialogTitle(), + warningText: + messages.viewLayout.ellipsisMenu.makeStatic.confirmDialogInfo(), + }); }, }); } else { From d6482f187dacb886d58d676ef1c6f252bf4a1fd3 Mon Sep 17 00:00:00 2001 From: ziggabyte Date: Wed, 4 Dec 2024 09:53:33 +0100 Subject: [PATCH 2/2] Update message in confirm dialog. --- src/features/views/l10n/messageIds.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/views/l10n/messageIds.ts b/src/features/views/l10n/messageIds.ts index 4e71dc8d19..1d0fcadb70 100644 --- a/src/features/views/l10n/messageIds.ts +++ b/src/features/views/l10n/messageIds.ts @@ -421,7 +421,7 @@ export default makeMessages('feat.views', { makeDynamic: m('Convert to Smart Search list'), makeStatic: { confirmDialogInfo: m( - 'If you convert this list to a static list the Smart Search will be removed and the list will be empty, as all the people the Smart Search returned will no longer be there.' + 'If you convert this list to a static list the Smart Search will be removed and all the people the Smart Search returned will no longer be there.' ), confirmDialogSubmitLabel: m('Convert'), confirmDialogTitle: m('Convert to static list'),