Skip to content

Bosu fix: correct HGN help access restrictions frontend - #5449

Open
BosuBose132 wants to merge 1 commit into
developmentfrom
Bosu-fix-hgnhelp-access-restriction
Open

Bosu fix: correct HGN help access restrictions frontend#5449
BosuBose132 wants to merge 1 commit into
developmentfrom
Bosu-fix-hgnhelp-access-restriction

Conversation

@BosuBose132

Copy link
Copy Markdown

Description

Fixes the HGN Questionnaire Dashboard access restriction issue on /hgnhelp.

Previously, valid users could still be blocked from submitting HGN Help requests because access eligibility was determined using incomplete client-side role/team logic. The questionnaire submission flow could also navigate to the success page before confirming that the questionnaire response was successfully saved.

This update moves HGN Help eligibility to the backend as the authoritative source, properly handles eligibility loading/error states, and ensures questionnaire submission completes successfully before navigating to the confirmation page.

Fixes: (PRIORITY URGENT) HGN Questionnaire Dashboard - Fix Access Restriction Too Strict on /hgnhelp

Related PRS (if any):

Main changes explained:

  • Updated HelpModal.jsx to retrieve HGN Help eligibility from the backend instead of relying on client-side role and team checks.
  • Added handling for eligibility loading, eligible, ineligible, and request-error states.
  • Updated the HGN Help eligibility API endpoint configuration.
  • Removed userId from help request and eligibility calls so user identity is determined securely by the backend from authentication.
  • Updated questionnaire submission in FollowupQuestions.jsx to wait for a successful server response before navigating to the confirmation page.
  • Added focused tests for HGN Help eligibility and request behavior.
  • Preserved existing help categories, Suggestions functionality, modal behavior, notifications, and dark mode.

How to test:

  1. Checkout the frontend branch:
    Bosu-fix-hgnhelp-access-restriction

  2. Checkout backend PR #BACKEND_PR_NUMBER and run both applications locally.

  3. Run the frontend:
    nvm use 20
    npm install
    npm run start:local

  4. Log in with an Owner/Admin/Core Team/Software Development Team test account.

  5. Navigate to /hgnhelp before completing the HGN questionnaire and verify:

    • Eligibility returns false.
    • The main Submit button is disabled.
    • The user receives the eligibility message.
  6. Navigate to /hgnform, complete the questionnaire, and submit it.

  7. Verify the questionnaire request returns HTTP 201 before navigating to the success page.

  8. Return to /hgnhelp and verify:

    • Eligibility returns true.
    • questionnaireCompleted returns true.
    • The main Submit button is enabled.
  9. Select a help category and submit the request.

  10. Verify /api/helprequest/create returns HTTP 201 and the success notification is displayed.

  11. Verify the request payload does not contain a client-provided userId.

  12. Verify the Suggestions link and existing Suggestions submission functionality still work.

  13. Verify the functionality in both light and dark mode.

Screenshots or videos of changes:

Screenshot 2026-08-16 at 12 09 21 AM

Note:

This frontend PR requires the related backend PR for the complete eligibility and authentication flow. The backend is now responsible for determining the authenticated user's eligibility.

@netlify

netlify Bot commented Aug 16, 2026

Copy link
Copy Markdown

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 8229748
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6a813fed5582e30008585430
😎 Deploy Preview https://deploy-preview-5449--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant