Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add confirm dialog to "Convert to static list" #2392

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 the list will be empty, as all the people the Smart Search returned will no longer be there.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The part about the "empty" list is not 100% correct. If there are statically added rows from before, those rows will still be there. Try doing this:

  1. Create a list
  2. Add a person
  3. Use ellipsis menu to convert to Smart Search list
  4. Configure Smart Search and save
  5. Use ellipsis menu again to convert to static list
  6. Read the message
  7. Confirm
  8. Contemplate message vs result 😊

),
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
Loading