Build Admin Lock Account Flow
Build a feature to allow a role based permission to lock user accounts and display messaging to the end user.
@devondragon I would love to work on this, let me know if this is still needed. Thanks.
@UditThakkar - that would be great! Thank you! Please also create a fork of the DemoApp project so you can build and test the front end etc.. for the feature. Let me know if you have any questions!
Branch issue-32-Build-Admin-Lock-Account-Flow created!
Thanks, I will start setting up the project. Will ping you if I face any issue.
Hey @devondragon I wanted to discuss what I understood the requirement of the ticket is:
- We need to implement a feature that allows the admin user to lock or unlock any user’s account.
- To facilitate this, we require either a page displaying a list of all users or a form with an email field, allowing the admin to lock or unlock a user by entering their email.
- If a user with a locked account attempts to log in, they should receive a notification stating: "Your account has been locked. Please contact customer support to unlock it."
That all sounds good. The front end work, the pages, forms, etc... should be done in the Demo App, and can be simple. i.e. it's a Demo App and doesn't need to be built for thousands of users (pagination, or even search (although feel free to implement that if you want to)). The APIs and backend functionality changes will be under this project and should be built in a best practices, production-ready, approach.
I've just added a CONTRIBUTING.md guide which should help provide guidance on forking, PRs, and other aspects. If you find gaps, let me know, I want to improve the documentation so it's clear and comprehensive!
Thanks!
Hey @devondragon
I am done with the development part and have started working on the test case, but I saw that we have disabled test cases with the message Temporarily disabled due to OAuth2 dependency issues.
Can I skip test cases for my PR and work on them once the issue is fixed? I am not able to test them as they just throw some error related to Oauth.
Or I can just write the test case and mark them disabled for now, and once the issue is fixed, I can check if they are correct or not.
WDYT?
@UditThakkar - Yes, currently the UserAPITest and UserServiceTest are both disabled. The other Tests are still active and working. So it depends a bit on if your new code has unit testable methods that can work without OAuth2 related issues.
If you think you can add useful test cases that will pass, please do so, just create a new Test class. If you can't, just note it and submit the PR without. Thanks!
@devondragon Create a PR for this issue, please help to review: https://github.com/devondragon/SpringUserFramework/pull/171
Thanks.
@UditThakkar - I merged it to the branch in this project. I was able to fix the OAuth2 related test issues and re-enable most of the unit tests. However your tests are still failing. Could you take look and see if you can fix them?
I also was able to assign you the sibling issue in the Demo App - https://github.com/devondragon/SpringUserFrameworkDemoApp/issues/27
Would you be able to add the front end pages/JS needed to demo and fully test this feature? Thanks!
@devondragon Sure, I will check why the test cases are failing. Regarding the changes in the Demo App, let me create the PR with changes to the frotend. A simple frotend with an email field and button will work right?
@UditThakkar - Thanks!
Yes, a simple Admin page that allows for the locking or unlocking of a user account by email address is all we need. Thanks!
@devondragon I have created a PR with fixed test cases; please help to review. Thanks.