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

BHBC-2274: Router technical debt #983

Merged
merged 13 commits into from
Apr 12, 2023
Merged

BHBC-2274: Router technical debt #983

merged 13 commits into from
Apr 12, 2023

Conversation

curtisupshall
Copy link
Contributor

@curtisupshall curtisupshall commented Mar 21, 2023

Overview

Fixes some minor annoyances + addresses some technical debt surrounding the app router

Links to Jira tickets

Description of relevant changes

  • Replaces normal anchor links with React Router links

  • Removes unneccessary routes:

    • surveys/:survey_id/attachments
    • surveys/:survey_id/observations
    • surveys/:survey_id/results
  • Removes <Layout> components that are already wrapped

  • Fixes an issue with the Forbidden page, wherein users cannot navigate away from the forbidden page if the initial request to fetch the user's userdata fails. This often occurs during development when the app refreshes while the API is momentarily re-compiling.

Testing Procedures

  1. Create a project and survey.
  2. Click into the project, then click into the survey. It should:
  • Fetch and render the survey immediately without reloading the webpage
  1. From any page in SIMS, reload the browser while the API is rebuilding. You can achive this by going to api/src/app.ts in your IDE and saving the file, triggering a rebuild of the API. If this is successful, you should land on the Forbidden page in SIMS.
  2. Wait until the API is finished rebuilding, then attempt to click away from the Forbidden page. You should:
  • Successfully navigate away from the forbidden page

@curtisupshall curtisupshall added the Not Ready For Review Addressing feedback and/or refactoring label Apr 5, 2023
@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #983 (24bb0fe) into dev (b09d73c) will decrease coverage by 12.75%.
The diff coverage is 87.50%.

@@             Coverage Diff             @@
##              dev     #983       +/-   ##
===========================================
- Coverage   80.85%   68.11%   -12.75%     
===========================================
  Files         177      378      +201     
  Lines        7027    11722     +4695     
  Branches     1225     1987      +762     
===========================================
+ Hits         5682     7984     +2302     
- Misses       1065     3290     +2225     
- Partials      280      448      +168     
Impacted Files Coverage Δ
app/src/components/layout/Header.tsx 85.00% <ø> (ø)
app/src/components/map/DatasetPopup.tsx 8.69% <ø> (ø)
app/src/components/security/RouteGuards.tsx 0.00% <0.00%> (ø)
app/src/components/surveys/SurveysList.tsx 100.00% <ø> (ø)
app/src/features/admin/users/ActiveUsersList.tsx 32.50% <ø> (ø)
...p/src/features/admin/users/UsersDetailProjects.tsx 78.82% <ø> (ø)
app/src/features/projects/ProjectsRouter.tsx 0.00% <ø> (ø)
...es/projects/view/components/ProjectCoordinator.tsx 100.00% <ø> (ø)
app/src/features/surveys/CreateSurveyPage.tsx 2.77% <ø> (ø)
app/src/features/surveys/SurveyRouter.tsx 0.00% <ø> (ø)
... and 2 more

... and 189 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@curtisupshall curtisupshall marked this pull request as ready for review April 11, 2023 18:52
@curtisupshall curtisupshall removed the Not Ready For Review Addressing feedback and/or refactoring label Apr 11, 2023
Copy link
Contributor

@AlfredRosenthal AlfredRosenthal left a comment

Choose a reason for hiding this comment

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

📸

@curtisupshall curtisupshall added Do Not Merge PR should not be merged and removed Do Not Merge PR should not be merged labels Apr 11, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@anissa-agahchen
Copy link
Contributor

Screenshot 2023-04-11 at 5 16 02 PM

Copy link
Contributor

@AlfredRosenthal AlfredRosenthal left a comment

Choose a reason for hiding this comment

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

🐤

@curtisupshall
Copy link
Contributor Author

Screenshot 2023-04-11 at 5 16 02 PM

Unrelated; Will write a ticket.

Copy link
Contributor

@anissa-agahchen anissa-agahchen left a comment

Choose a reason for hiding this comment

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

Looks good!

@curtisupshall curtisupshall merged commit 67836d6 into dev Apr 12, 2023
@curtisupshall curtisupshall deleted the BHBC-2274 branch April 12, 2023 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants