Skip to content
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

[CMDCT-3817] Upgrade React-Router-Dom #139753

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

[CMDCT-3817] Upgrade React-Router-Dom #139753

wants to merge 19 commits into from

Conversation

ntsummers1
Copy link
Collaborator

@ntsummers1 ntsummers1 commented Aug 22, 2024

Description

The long awaited react-router upgrade is here, and the fruits of our labor can finally be fully observed. Bask in the hooks that make this a lot easier to use router!

Related ticket(s)

CMDCT-3817


How to test

Log in as a stateuser
Enter a report
Navigate through the sections, clicking any buttons you see to go to different pages. I.E., check the Sidebar, the print actions button on the bottom, the navigation buttons on the bottom, etc.
If everything loads, fill in some data and make sure it saves
Use the top right menu to check that your state user info shows up in the account page
Click the banner image to see you navigate to the root page
Sign out
Sign in as an admin
Repeat the same steps as above and it should all work

Notes

React-Router is removed
React-Router-Dom 5.2 -> 6.26


Pre-review checklist

  • I have added thorough tests, if necessary
  • I have updated relevant documentation, if necessary
  • I have performed a self-review of my code
  • I have manually tested this PR in the deployed cloud environment

Pre-merge checklist

Review

  • Product: This work has been reviewed and approved by product owner, if necessary

@ntsummers1 ntsummers1 self-assigned this Aug 22, 2024
Copy link

codeclimate bot commented Aug 23, 2024

Code Climate has analyzed commit 7b71347 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 89.2% (90% is the threshold).

This pull request will bring the total coverage in the repository to 79.2% (-0.5% change).

View more on Code Climate.

@ntsummers1 ntsummers1 added the ready for review Ready for all the reviews! label Aug 23, 2024
@ntsummers1 ntsummers1 marked this pull request as ready for review August 23, 2024 16:43
Copy link
Contributor

@gmrabian gmrabian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking due to issue with user timeout

services/ui-src/src/components/layout/Timeout.test.jsx Outdated Show resolved Hide resolved
@@ -39,7 +34,7 @@ const Timeout = () => {
unlisten();
clearInterval(timer);
};
});
}, [location]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the timeout isn't working as expected and I'm wondering if this might be why? it's listening on location and location won't change if you are not using the page

steps to reproduce:

  1. in authLifecycle change IDLE_WINDOW from 30 to 1 and PROMPT_AT from 29 to 0.5
  2. Log in and let sit until the modal pops up
  3. The modal displays and says you will be logged out in 59 seconds. The time never changes and it does not change the view after that time

<Route path={"/state_assoc"} element={Unauthorized} />
<Route path={"/role_jobcode_assoc"} element={Unauthorized} />
<Route path={"/users"} element={Unauthorized} />
</Routes>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought in reviewing these: is it normal to control routes by user type? or to have all routes and restrict them on a component level by type? just curious

@@ -107,7 +107,7 @@ export const Header = () => {
<li>
<a
data-testid={"headerDropDownMenuButton"}
href="#menu"
href="javascript:void(0);"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

@ntsummers1 ntsummers1 added in progress In progress and removed ready for review Ready for all the reviews! labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress In progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants