Jaden Taking Over For Peterson: Implement Improvements in 404 Page (DONE Jaden) - #3286
Jaden Taking Over For Peterson: Implement Improvements in 404 Page (DONE Jaden)#3286peterson337 wants to merge 25 commits into
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…e user's login state.
…e user's login state.
…e user's login state.
vaibhavkoladiya
left a comment
There was a problem hiding this comment.
Everything works as expected. I checked out the current branch, ran the PR locally after npm install, and tested both logged-in and logged-out states. When logged in, the error page correctly shows two links—one redirects to the dashboard, and the other opens the same route with the suggestions/development modal. When not logged in, the error page displays a link that properly redirects to the login page. Looks good to me—approved! ✅
Screen.Recording.2025-04-04.182506.mp4
rsripathi2906
left a comment
There was a problem hiding this comment.
Tested the 404 error page implementation — everything works as expected.
Tested both logged-in and logged-out scenarios.
Links and modal behave correctly. Approving the PR.
Screen.Recording.2025-04-04.223938_1.mp4
pavanputti
left a comment
There was a problem hiding this comment.
I tested the fix by checking out the current branch, running npm install, and starting the app locally. I logged in as a user, navigated to a nonexistent URL, and confirmed that the error page showed two links: one redirecting to the dashboard and another opening the suggestions modal while also redirecting to the dashboard. I then logged out, revisited the invalid URL, and verified that the error page displayed a single link redirecting to the login page.
Screen.Recording.2025-04-10.at.5.07.22.PM.mov
nikhilpittala16
left a comment
There was a problem hiding this comment.
I have tested the PR and everything works as expected.
PR.vid.21.mp4
JuliaHa0902
left a comment
There was a problem hiding this comment.
I have checked out the branch and followed the instructions to test the branch. It works as intended.
When not login:

When login


I clicked on the modal and the pop up showed

Just a suggestion, maybe we should remove the white part at the end of the page containing "Back to Top" button, or change the background to match the dark theme.

Ram-blip
left a comment
There was a problem hiding this comment.
I checked the PR and confirmed that the new error page correctly shows a single “Login” link for unauthenticated users, and for logged-in users it displays both a “Go to Dashboard” link and a “Send Feedback” link that opens the suggestions modal -everything navigates and behaves exactly as intended.
aayushshetty12
left a comment
There was a problem hiding this comment.
Working as expected.
When user is logged in, two links appear on the error page: the first redirects to the dashboard, and the second redirects to same dashboard with the modal for suggestions and development.


When user is not logged in, link appears on the error page that redirects to the login page.

… resolve conflicts
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ificationCard - Move section border, heading color, link margin, and p margin to CSS module classes - Remove injected style tag from NotFoundPage JSX - Restore notificationCard.module.css import and use module classes for card layout - Fix pre-existing stylelint errors in NotFoundPage.module.css
- Remove unused imports: useId, Col, convertDateFormatToMMMDDYY, ProfileImageModal, CREATED_DATE_CRITERIA - Remove unused state: didLinkUpdate, setDidLinkUpdate - Remove unused vars: result, isStartDateValid, isEndDateValid and their dead functions - Fix two bugs: spread of optional chain now uses nullish coalescing to avoid TypeError - Fix for loop to for-of, findIndex !== -1 to .some, typeof check to direct undefined compare - Fix optional chaining on err.response and nested ternary for canEditUserProfile - Convert 6 span role=button elements to proper button elements - Remove duplicate useHistory call in Logout - Fix nested template literal in notificationCard - Move all new inline styles to CSS module classes in UserProfile and SummaryBar
- Remove unused isModalOpen state and toggleModal function - Fix nested template literal in profilePicture className - Replace double && checks with optional chaining in SummaryBar getInfringements and getBadges
- Extract getCategoryDescription, getDraggedNextElement, applyEditMode, applyDraggableMode, readFormData, and applyFieldUpdate to module level - Replace remaining inline style in renderSummaryMessage with btnResetInherit CSS module class
…nitive complexity - Extract getInfringements, getBadges, getWeeklySummary, canEditData, getContainerClass, and getPlaceholderText to module level - Update all call sites to pass required params
- Extract loadUserProfile, getUserTasks, openSuggestionModal, editField, sendUserSuggestion to module level - Update all call sites to pass required params explicitly
…to module level Extract editRadioButtonSelected, onTaskClick, onBadgeClick, renderSummary, renderSummaryMessage, openReport, sendBugReport, closeSuggestionModal, onDragToggleDraggingClass, onSortableDragOver, and handleEditClick from the component body to module-level functions. Update all call sites to pass required state and props as explicit parameters. Also fix editField to use a fieldState object to stay within the 7-parameter SonarQube limit.
Reduce renderSummary from 9 params to 6 by pre-computing canEdit in the component and passing it directly. Replace all repeated isAuthUser || canEditData(...) ternaries in JSX with the single canEdit boolean, eliminating 5 duplicate branch expressions from the component body.
…tive complexity Move the suggestion and bug report modal JSX into separate module-level function components, removing their branch logic from the SummaryBar component body to bring cognitive complexity within the allowed limit.
…complexity Extract badge icon section into BadgeIcons component removing 5 canEdit ternaries from SummaryBar. Extract handleLoadEvent to module level. Convert useEffect && shortcut to explicit if statement.
kzou55
left a comment
There was a problem hiding this comment.
iAbhi001
left a comment
There was a problem hiding this comment.
Local Testing & PR Review
I checked out the branch and performed local testing across both logged-in and logged-out states.
✅ Verified Functionality:
- Logged-in state: Navigating to an invalid route displays the updated 404 page with two functional links—one pointing to the Dashboard, and the other opening the User Suggestion/Development modal as expected.
- Logged-out state: The 404 page correctly shows a single link redirecting to the Login page.
⚠️ Issue Found / Question for Author:
- Navbar visibility when logged out: As noted by
@kzou55, when navigating to a non-existent route as an unauthenticated/logged-out user, the authenticated top navbar (with options like Hello, View Profile, Update Password, and Logout) is still rendered.
Expected Behavior: When a user is logged out, the top navigation header should not display logged-in user controls/dropdowns. Could you please check the auth wrapper or route guarding on the 404 page to ensure the navbar reflects the correct logged-out state?
DeepighaJ
left a comment
There was a problem hiding this comment.
Hi @Jaden300 Tested the PR locally. The mentioned behaviors working as expected but need clarity before approving on the header part during log out scenario. Otherwise its good to go. Will approve once its confirmed.
When LoggedIn: Two links appear "Home" and "here".
On clicking on Home redirects to dashboard page
On clicking on here redirects to dashboard page with model appears and submitting feedback shows success toast "Email sent successfully"

Clicking on home:

Clicking on here model appears:



When Logged out : Only one link appears for login page


Kept all existing routes from HEAD and all new routes from development, with NotFoundPage catch-all placed after all new ProtectedRoutes.
iAbhi001
left a comment
There was a problem hiding this comment.
I tested the PR locally on the Peterson_implement_improvements_in_404_page2 branch after running npm install and npm start.
🛠️ Verification Results:
- Logged-out State: Navigating to an invalid URL correctly shows a single link redirecting to the login page.
- Logged-in State: Navigating to an invalid URL displays two functional links—one pointing to the Dashboard, and the other redirecting to the Dashboard while opening the Feedback/Suggestions modal.
- Modal Functionality: Submitting feedback inside the modal works as expected with a success toast notification.
- UI & Styling: The 404 page styling renders cleanly without console errors or inline style issues.
Everything works as expected on my end! LGTM! 🚀
…and Inventory routes from development
|
























Jaden Taking Over For Peterson: Implement Improvements in 404 Page (DONE Jaden) #3286
Description
This pull request improves the 404 Not Found page and resolves all SonarQube quality gate failures.
The 404 page now displays dynamic messages and styles based on authentication state. All new and modified components follow project code standards (CSS Modules, no inline styles, WCAG contrast compliance).
Related PRs (if any):
None
Main changes explained:
<style>tag; replaced with CSS module classes. Dynamic messaging for logged-in vs logged-out users.<span role="button">elements to proper<button>elements.useHistorydeclaration.How to test:
cd HighestGoodNetworkApp git checkout Peterson_implement_improvements_in_404_page2 npm install npm starthttp://localhost:3000/doesnotexistNote:
SonarQube quality gate passes with 0 new issues, 0 security hotspots, and 1.1% duplication on new code.