Conversation
… on the projectmember
chartgerink
approved these changes
Jan 27, 2025
Member
chartgerink
left a comment
There was a problem hiding this comment.
Upon review, the code seems to make sense for what you are doing. It would be helpful to have a few test cases run to showcase things work as expected at this stage. Those tests will also be helpful to add to if bugs pop up.
Member
|
I think Chris would know more about this than me, so let me know @marton-balazs-kovacs when you update the files, and I'll push it forward. |
Co-authored-by: Chris Hartgerink <chris@libscie.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We decided to allow to soft-delete users from projects. In this PR I mainly focused on the backend functionality of the soft-delete feautre, in future PRs the UI should be updated to make it clear to our users that soft-delete (or inactive, suggested by @chartgerink) does not mean that there information is deleted from the db.
To avoid showing the name of soft-deleted users on a project I implemented several safeguards:
projectmemberprisma model is queried without an explicitdeletedkey defined in thewhereargument,deleted: falseis added by a prisma middleware.Usernames if the users are returned from nested prisma queries. The anonymization now happens in the query, instead in the component code, which makes it safer if the query is reused across multiple components.getNamefunction that we use to decide whether the username or firstname and lastname are shown also replaces the returned name if the projectmember is deleted.