Skip to content

Commit

Permalink
Merge pull request #2392 from zetkin/issue-532/convert-to-static-list…
Browse files Browse the repository at this point in the history
…-info

Add confirm dialog to "Convert to static list"
  • Loading branch information
richardolsson authored Dec 5, 2024
2 parents 6eb0d5c + d6482f1 commit 1ba21e2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/features/views/l10n/messageIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 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'),
Expand Down
10 changes: 8 additions & 2 deletions src/features/views/layout/SingleViewLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ const SingleViewLayout: FunctionComponent<SingleViewLayoutProps> = ({
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 {
Expand Down

0 comments on commit 1ba21e2

Please sign in to comment.