Closed Ameer-Alaswad closed 1 week ago
The recent changes across multiple files in the ReDI Connect project focus on enhancing user experience and improving functionality. Key updates include conditional notifications for rejected profiles, restructuring login logic, introducing a new error component, and modifying import organization settings. These changes aim to streamline user interactions, provide clearer feedback, and ensure smoother navigation and error handling within the application.
File Path | Change Summary |
---|---|
.vscode/settings.json | Adjusted editor.codeActionsOnSave to explicitly trigger organize imports action. |
.../locales/en/translation.json | Added messages for "rejectedMentee" and "rejectedMentor" notifications. |
.../components/templates/LoggedIn.tsx | Added conditional rendering for notifications based on profile.userType and profileStatus . |
.../pages/front/login/Login.tsx | Restructured fetcher call, added redirection logic based on conProfile status. |
.../pages/front/login/LoginError.tsx | Introduced LoginError component to display access change messages with navigation options. |
.../routes/routes__logged-out.tsx | Added lazy-loaded LoginError component and corresponding route /front/login-result . |
.../services/api/api.tsx | Updated assignment of accessToken with null check (?. ) on loginResp.data . |
sequenceDiagram
participant User
participant LoginPage
participant API
participant Dashboard
participant LoginErrorPage
User->>LoginPage: Attempt to login
LoginPage->>API: Fetch user profile
API-->>LoginPage: Return conProfile
alt conProfile is rejected
LoginPage->>LoginErrorPage: Redirect to /front/login-result
LoginErrorPage-->>User: Display rejection message
else conProfile is accepted
LoginPage->>Dashboard: Redirect to dashboard
Dashboard-->>User: Display user dashboard
end
In code, we tweak and mend, With changes that never end, Notifications clear and bright, Guide you through day and night. Login smooth, errors few, For a journey fresh and new! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Dear @Ameer-Alaswad, thanks a loooot! Dear @helloanil and @Ameer-Alaswad, I have a question here: do we use the same approach as for TP?
If I am not mistaken, For TP: deactivated/rejected users can't log in at all and instead are redirected to the page with a notification, am I right? Here you can see the video from TP.
In this solution as far as I understand user will see a page with a notification (super cool), but can still log in and see a banner?
Thank you for the explanation!
Dear @Ameer-Alaswad, thanks a loooot! Dear @helloanil and @Ameer-Alaswad, I have a question here: do we use the same approach as for TP?
If I am not mistaken, For TP: deactivated/rejected users can't log in at all and instead are redirected to the page with a notification, am I right? Here you can see the video from TP.
In this solution as far as I understand user will see a page with a notification (super cool), but can still log in and see a banner?
Thank you for the explanation!
Thank you for pointing this out.
You are correct; for TP, deactivated/rejected users are indeed unable to log in and are redirected to a notification page. I apologize for the oversight in the current solution. The user should not be able to log in at all if they are deactivated/rejected.
I am currently working on a fix to ensure that deactivated/rejected users are redirected to the appropriate notification page without being able to log in.
Thanks for the great job, dear @Ameer-Alaswad . Let's wait for @helloanil 's feedback.
Thanks
Well done @Ameer-Alaswad, the code looks great to me. I would like to give it a quick test tomorrow and if it's working as expected, I will also merge.
Great job 💪
Dear @helloanil any news? ready to merge and deploy?
@astkhikatredi @Ameer-Alaswad I just tried to login with a deactivated CON account, and this is what I see:
I believe this is the same approach with the TP, as you discussed above. Then I'm happy to approve and merge this PR. Let me know.
@helloanil, yes, please. Thank you both!
Hey @Ameer-Alaswad, unfortunately I have to revert this PR as it was breaking ReDI Connect Sign Up. Let's catch up on Monday so I can explain what happened.
What Github issue does this PR relate to? Insert link.
Ticket #889
What should the reviewer know?
Mentee status notification :
Mentor status notification :
Mentee/Mentor login deactivated/rejected status:
Summary by CodeRabbit
New Features
LoginError
component to inform users about changes to platform access.LoginError
page.Enhancements
Bug Fixes