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 info about dependencies when deleting collection #17961
Conversation
@Nitwel Do we know for a fact that the deletion will fail? Cause if that's the case, I'd rather just say "You can't delete collection this as other items are relying on it. Please delete the other collection first" |
Good point, I went with that wording for now as I had the suspicion that DB vendors like SQLite might not support foreign key constraints. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's working as advertised but I find the double popup on postgres a bit counter intuitive
firefox_c9TG9fkCsQ.mp4
In sqlite it makes a lot more sense as it doesnt get constraint blocked. However both postgres and sqlite have issues with circular dependencies, that may be a separate issue.
firefox_U4NNA231a2.mp4
firefox_zre1R907X9.mp4
@rijkvanzanten Tim and I discussed that it might make more sense to not only warn the user that you might not be able to delete something but instead to delete the fields that the collection depends on first and then delete the collection, so you don't have to do that yourself manually. Thoughts? |
Yes |
it's should have a warning though that the data of that field will be lost This collection " a " depends on the collection you want to delete " b " , |
Updated it to show a danger banner and to delete all fields it depends on first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
@br41nslug @paescuj Y'all happy?!!!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of those PRs that should've been there from the beginning. Thanks @Nitwel!
Not yet, as outlined in #17961 (review). |
@paescuj I updated to only delete the item field in an a2o, when there is only 1 collection left, thus it is fine to delete it. Otherwise it won't be deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks to be working as expected now on sqlite and postgres
Okay, that already makes me much happier |
Agreed |
* add info about dependencies when deleting collection * Delete dependent fields * Update app/src/lang/translations/en-US.yaml Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * add m2a edgecase * run linter * run linter * Update app/src/lang/translations/en-US.yaml * only delete m2o relations --------- Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com> Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
* add info about dependencies when deleting collection * Delete dependent fields * Update app/src/lang/translations/en-US.yaml Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> * add m2a edgecase * run linter * run linter * Update app/src/lang/translations/en-US.yaml * only delete m2o relations --------- Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com> Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This PR introduces a warning showing the user in advance why the deletion process might fail.
Fixes #17536
Fixes ENG-701