mealie-recipes / mealie

Mealie is a self hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the url and mealie will automatically import the relevant data or add a family recipe with the UI editor
https://docs.mealie.io
GNU Affero General Public License v3.0
5.59k stars 608 forks source link

feat: check all in shopping list view #3786

Closed ollywelch closed 1 day ago

ollywelch commented 4 days ago

What type of PR is this?

What this PR does / why we need it:

This PR adds a new 'check all' button to the button group in the shopping list view. This allows checking all unchecked items in a shopping list, so they can then be deleted using the existing 'delete checked items' button for instance.

image

Which issue(s) this PR fixes:

N/A

Testing

Created a shopping list, added some items, then pressed the check all button. This moved all items from the checked to unchecked state.

boc-the-git commented 4 days ago

Just reading what the idea is, I think I'd want this to have a confirmation button. It serves an edge case for general usage (IMO), and is fairly destructive if clicked by accident

ollywelch commented 4 days ago

Isn't it equally destructive as unchecking all checked items? If you check everything by mistake, you can always uncheck everything again.

boc-the-git commented 4 days ago

I think there's a good argument for them both to have a confirmation, yes! Marking as checked is marginally more destructive though, as combined with delete the items are gone. Unchecked doesn't have that.

michael-genson commented 4 days ago

+1 to putting both of those options behind a confirmation button

ollywelch commented 3 days ago

I've added dialogue boxes for:

Not really sure what I'm doing with the text in the dialogue boxes + translations, please lmk if I've missed something!

boc-the-git commented 2 days ago

Thanks for taking on that revision @ollywelch, this looks good!

There's a couple scenarios where we probably want a tiny bit more logic though. Right now I can get the popups even though their actions would do nothing, e.g.

Other than that though, functionally this works quite nicely 👍

ollywelch commented 1 day ago

@boc-the-git thanks for reviewing! I've just added some checks at the start of each open dialogue method, so should only display the prompt when necessary now