-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Adds end-to-end feature for archiving and deleting user accounts #1449
Conversation
Branch Notes
|
Ready for review! Do note the comment above:
|
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 PR is FANTASTIC! I ran the migration against the shared dev db and it worked great, then tested all the features you implemented and they all worked perfectly, as far as I can tell.
There is a bit of overlap of your project archive feature with a different Issue that allows users to move their own projects to the trash and eventually delete them, but the purpose is a bit different, so we need to figure out if the admin delete/archive and user delete/archive for projects can just remain separate or not.
I had seen the report.html and report.json files crop up before, but didn't look into where they came from. It turns out the Flyway, the DB migration tool auto-generates these files. I read enough to know that they document the migration changes and you can somehow run reports on the migrations using them as source data, but we might look into their utility and see if we want to use them and figure out how to disable their generation if we don't. If we do want to use them, we should probably change the flyway config to give them better names, and tuck them away in the /server/db folder so they are out of the way.
Karandeep was also having trouble with line endings in Windows. We can talk about the relevant settings tonight.
I'm sure the UI designers will want to make some tweaks to the UI appearance, but the functionality is all there.
* adds db migration file * adds backend feature to soft del and hard del users with their projects * adds endpoints to client * fixes broken endpoints * adds functionality to prevent archived users logging in * refactors migration and account service * adds frontend user feedback for archived users on log in * fixes functionality to retrieve all archived projects by security admin * edits migration for selecting all archived projects * adds db migration and service for unarchiving user * adds route and controller for unarchive endpoint * adds controller for unarchive endpoint * fixes unarchiveUser service * adds code to prevent self archive and self delete * adds frontend functionality to archive and delete users * updates migration reports * small fix to address line endings issues when working on branches between windows and unix systems * automatic linting fixes by lerna * fixes lerna issues, refactors, lints
Summary
This PR solves #1395
Implemented an end-to-end feature, creating a workflow that allows security admins to archive, un-archive/restore, and delete users along with their corresponding projects.
Features
Technical Details
archivedAt
column that is set toNULL
by default or to a timestamp if queried/api/accounts/:id/archiveaccount
/api/accounts/:id/unarchiveaccount
/api/accounts/archivedaccounts
/api/accounts/:id/deleteaccount
/api/projects/archivedprojects
How to Test
/Roles
page.archivedAt
field for the user and their projects; thus, 'archiving' the user. Security Admins cannot be archived or deleted. The user is also not able to self-archive or self-delete./archivedaccounts
by following the link. Here, the security admin can 'un-archive and restore' a user OR permanently delete by clicking on the arrow or trash icons and their respective PopUp's. These actions will take effect on the user and their corresponding projects./archivedprojects
by following the link. This page only shows all archived projects - no actions. To return to the/Roles
page, follow the link on the top of the page.Feature Notes
Future Improvements
Visuals