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

MCR-2553: CMS can navigate to rate review q&a via sidebar #2847

Merged

Conversation

JasonLin0991
Copy link
Contributor

@JasonLin0991 JasonLin0991 commented Oct 18, 2024

Summary

MCR-2553

  • There is a side nav on the rate review page
  • Above the side nav there is a Go to dashboard link that takes the user to the rate dashboard
  • Q&A link switches the page to the rate Q&A page with header and an empty Q&A table ( see designs )
  • The url for the Q&A view is "https://mc-review.onemac.cms.gov/rates/:id:/question-and-answers".
  • There is a "Add question" button, that has no functionality.
  • CMS users without a division see a warning banner about division assignments. ( same as contract questions )
  • CMS users without a division do not see the “Add questions” buttons
  • If a CMS user visits "/submissions/:id:/rate/:rateID/question-and-answers" they are redirected to "/rate/:id/question-and-answers".
  • Features implemented in this ticket are behind the qa-by-rates feature flag

Extra work

  • Fixed page content shifting when a scroll bar appears
  • Fixed background on the settings page to match rest of the pages.

NOTES

  • I had to place the redirect in the RateSummartySideNav component instead of AppRoutes. I couldn't figure out how to get the URL params in AppRoutes in order to redirect to the correct rate.
    • Open to other suggestions.

Related issues

Screenshots

Test cases covered

RateQuestionResponse.test.tsx

  • 'CMS user tests'
    • 'renders error page if rate revision does not exist'
    • 'renders error page if rate is in draft'
    • 'renders waring banner if CMS user has no assigned division'

RateSummarySideNav.test.tsx

  • 'loads sidebar nav with expected links'
  • 'renders error page if rate status is DRAFT'
  • 'redirects to rate summary Q&A page'

QA guidance

Copy link
Contributor

@pearl-truss pearl-truss left a comment

Choose a reason for hiding this comment

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

Changes LGTM

const routeName = getRouteName(pathname)

const shouldRedirect = matchPath(
RoutesRecord.SUBMISSIONS_RATE_QUESTIONS_AND_ANSWERS,
Copy link
Contributor

@haworku haworku Oct 18, 2024

Choose a reason for hiding this comment

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

@JasonLin0991 I agree this is a little funky, we are setting up the route exclusively just to redirect in the rendered component, it is a little bit of a braintwister

Don't know the solution without pulling down code more, I can take a look though on Monday. Assuming from you PR description comment you tried <Redirect /> already in AppRoutes? Is the correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

With that said, no blocking, you can merge if you feel ready

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe was replaced with . The complication is the difference in the route paths and parameters between submission summary and rate summary. Summary page id param is the contract id where as rate summary it is the rate ID. So we would have had to add more logic in AppRoutes to handle getting the rate ID from the url to generate the redirect path. I decided to put this logic in the RateSummarySideNav since both routes are nested in this outlet.

I think if we refactored how we setup the routes to use createBrowserRouter, maybe loader can do the redirecting.

@JasonLin0991 JasonLin0991 merged commit dcdde77 into main Oct 19, 2024
28 checks passed
@JasonLin0991 JasonLin0991 deleted the jl-mcr-2553-cms-can-navigate-to-rate-review-Q&A-via-sidebar branch October 19, 2024 00:09
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