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

Prevent orphaned contact cards #3282

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

charludo
Copy link
Contributor

@charludo charludo commented Dec 9, 2024

DRAFT until #3169 is merged

Short description

Prevent the deletion of contacts as long as pages/pois/events still referr to it. Note that no list of objects referring to the contact in question is shown in the error message, since we show that list in the contact details anyways.

Proposed changes

  • prevent deletion of contacts in the edit view
  • prevent deletion in the bulk action view

Side effects

  • none

Resolved issues

Fixes: #3260


Pull Request Review Guidelines

@charludo charludo linked an issue Dec 9, 2024 that may be closed by this pull request
@MizukiTemma
Copy link
Member

@charludo
Could you add the same check for archiving too? 😸

@MizukiTemma MizukiTemma added the blocked Blocked by external dependency label Dec 9, 2024
@charludo charludo force-pushed the enhancement/prevent-orphaned-contact-cards branch from 4967b5c to b2e6bb2 Compare December 10, 2024 06:20
@charludo
Copy link
Contributor Author

@charludo Could you add the same check for archiving too? 😸

done

@charludo charludo force-pushed the enhancement/prevent-orphaned-contact-cards branch from b2e6bb2 to 78a40b8 Compare January 7, 2025 08:58
@charludo charludo marked this pull request as ready for review January 7, 2025 08:58
@MizukiTemma MizukiTemma removed the blocked Blocked by external dependency label Jan 7, 2025
Copy link
Member

@MizukiTemma MizukiTemma left a comment

Choose a reason for hiding this comment

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

Thank you for the PR, the protection functions as expected 😸

I have some suggestion for improvement:

  1. Can we probably add to the tests such cases that archiving/deleting is prevented due to referring contents?
  2. It's even more cool if error messages are bundled that appear when contacts cannt be bulk archived/deleted, like the corresponding success messages?
  3. Deactivating the buttons if the contact is protected: you can open an issue for this if you think better to separate.

@MizukiTemma MizukiTemma added the deadline Needs to be fixed in the given time label Jan 7, 2025
@charludo charludo force-pushed the enhancement/prevent-orphaned-contact-cards branch from 78a40b8 to a295ac3 Compare January 8, 2025 15:31
@charludo
Copy link
Contributor Author

charludo commented Jan 8, 2025

  1. Can we probably add to the tests such cases that archiving/deleting is prevented due to referring contents?

Absolutely!
But more importantly: I had not realized how much preparation you had already made for this - thank you so much! It was a breeze to add the tests thanks to you!! 💛

  1. It's even more cool if error messages are bundled that appear when contacts cannt be bulk archived/deleted, like the corresponding success messages?

Done!

  1. Deactivating the buttons if the contact is protected: you can open an issue for this if you think better to separate.

Done!

@charludo charludo requested a review from MizukiTemma January 8, 2025 15:34
@charludo charludo force-pushed the enhancement/prevent-orphaned-contact-cards branch 8 times, most recently from d36db85 to 16e1cb1 Compare January 11, 2025 08:44
@charludo charludo force-pushed the enhancement/prevent-orphaned-contact-cards branch from 16e1cb1 to 638674c Compare January 11, 2025 08:58
Copy link
Member

@MizukiTemma MizukiTemma left a comment

Choose a reason for hiding this comment

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

Thank you 😸

@JoeyStk JoeyStk self-assigned this Jan 13, 2025
Copy link
Contributor

@JoeyStk JoeyStk left a comment

Choose a reason for hiding this comment

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

Thank you very much!
This looks really good 🚀

@charludo charludo merged commit 1852c62 into develop Jan 17, 2025
5 checks passed
@charludo charludo deleted the enhancement/prevent-orphaned-contact-cards branch January 17, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deadline Needs to be fixed in the given time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent orphaned contact cards
3 participants