Add ability to delete all tags #2200

Merged
ahatzz11 merged 4 commits from mass-delete-tags into main 2025-05-06 00:43:46 +08:00
ahatzz11 commented 2025-05-03 09:03:06 +08:00 (Migrated from github.com)

I've done a few imports that I messed up and have a lot of tags that I don't want/care about, and I'd love to be able to start fresh. I think having the ability to mass select tags (or categories) for deletion would be great as well in the future, but as a starting point I thought I'd bring tags up to the same functionality that categories have.

https://github.com/user-attachments/assets/5a970982-cf13-445c-b463-cc2831a9a22e

I also noticed, when copying this from the categories, that the capitalization of the confirmation button was a bit strange. I updated the CustomConfirm to have titlelize for the title & button, and downcase for the text. I think this is a bit nicer looking personally, but happy to revert if others feel differently.

CleanShot-002820 2025-05-02 at 19 57 47@2x

I've done a few imports that I messed up and have a lot of tags that I don't want/care about, and I'd love to be able to start fresh. I think having the ability to mass select tags (or categories) for deletion would be great as well in the future, but as a starting point I thought I'd bring tags up to the same functionality that categories have. https://github.com/user-attachments/assets/5a970982-cf13-445c-b463-cc2831a9a22e I also noticed, when copying this from the categories, that the capitalization of the confirmation button was a bit strange. I updated the `CustomConfirm` to have `titlelize` for the title & button, and `downcase` for the text. I think this is a bit nicer looking personally, but happy to revert if others feel differently. ![CleanShot-002820 2025-05-02 at 19 57 47@2x](https://github.com/user-attachments/assets/cb5b8df0-47fe-488c-bd83-5a3817aa0403)
ahatzz11 (Migrated from github.com) reviewed 2025-05-03 09:04:07 +08:00
@@ -37,0 +37,4 @@
def destroy_all
Current.family.tags.destroy_all
redirect_back_or_to tags_path, notice: "All tags deleted"
end
ahatzz11 (Migrated from github.com) commented 2025-05-03 09:04:07 +08:00

I'm still new to rails, but some of the functionality you can build out in a handful of lines of code is kinda insane

I'm still new to rails, but some of the functionality you can build out in a handful of lines of code is kinda insane
zachgoll (Migrated from github.com) reviewed 2025-05-06 00:40:59 +08:00
@@ -37,0 +37,4 @@
def destroy_all
Current.family.tags.destroy_all
redirect_back_or_to tags_path, notice: "All tags deleted"
end
zachgoll (Migrated from github.com) commented 2025-05-06 00:40:59 +08:00

The appeal of Rails for sure!

The appeal of Rails for sure!
zachgoll (Migrated from github.com) approved these changes 2025-05-06 00:42:50 +08:00
zachgoll (Migrated from github.com) left a comment

Agree, this is a nice feature for users who have a mess of tags they want to cleanup. And definitely matches up with our existing "delete all" pattern.

Agree, this is a nice feature for users who have a mess of tags they want to cleanup. And definitely matches up with our existing "delete all" pattern.
Sign in to join this conversation.