From b99693d6d4595c247715c12f38e1ae0b26decd02 Mon Sep 17 00:00:00 2001 From: Victoria Saleem <59583325+vsaleem@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:57:03 -0600 Subject: [PATCH] Mhv 64927 imaging breadcrumb update mr (#33484) * first push for Radiology images * swapped from hardcoding the studyId to Mike's useSelector method * updated loading bar to work with redux * MHV-44894 Fixed alert headers, refactored JSX * MHV-44894 Replaced imageReqData state w/ memoized studyJob * MHV-44894 Used va-button components and fixed some logic * MHV-44894 Added notification status * MHV-44894 Added image count and better match designs * MHV-44894 Fixed polling logic and implemented dynamic backoff * MHV-44894 Added dynamic end date for image request * MHV-44894 Fixed link and other cleanup * MHV-44894 Added DICOM zip download * MHV-44894 Removed print functionality, moved DICOM block * MHV-44894 Replaced mock record with live data, refactored some bits * MHV-44894 Check status after request; account for NEW status * MHV-44894 Tidied up pagination * MHV-44894 Placeholder for error handling * MHV-44894 Implemented API error handling * MHV-44894 Fixed external link to MHV * MHV-44894 Fixed unit tests * MHV-44894 Modified hash to work on non-https connections * MHV-44894 Fixed alerts and header levels * MHV-44894 Skipped e2e test for deprecated functionality; added intercepts * MHV-44894 Updated error handling * MHV-44894 Updated error header * [MHV-64927] Initial p1 breadcrumb update * [MHV-64927] Cleanup, updates breadcrumb is display Back on imaging pages --------- Co-authored-by: Justin Lattimore Co-authored-by: Mike Moyer <87040148+mmoyer-va@users.noreply.github.com> --- .../components/MrBreadcrumbs.jsx | 44 ++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx b/src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx index e74b44d94acc..a93a00502da7 100644 --- a/src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx +++ b/src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx @@ -1,7 +1,7 @@ import { VaBreadcrumbs } from '@department-of-veterans-affairs/component-library/dist/react-bindings'; import React, { useEffect, useMemo } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { Link, useHistory, useLocation } from 'react-router-dom'; +import { Link, useHistory, useLocation, useParams } from 'react-router-dom'; import { Breadcrumbs, Paths } from '../util/constants'; import { setBreadcrumbs } from '../actions/breadcrumbs'; import { clearPageNumber, setPageNumber } from '../actions/pageTracker'; @@ -28,6 +28,7 @@ const MrBreadcrumbs = () => { const textContent = document.querySelector('h1')?.textContent; const searchIndex = new URLSearchParams(window.location.search); const page = searchIndex.get('page'); + const { labId } = useParams(); useEffect( () => { @@ -75,6 +76,10 @@ const MrBreadcrumbs = () => { history.push(href); }; + const backToImagesBreadcrumb = location.pathname.includes('/images') + ? crumbsList[crumbsList.length - 1].href + : `/${locationBasePath}`; + if (!phase0p5Flag) { if (location.pathname === '/' || !crumbsList) { return
; @@ -94,17 +99,36 @@ const MrBreadcrumbs = () => {
); } + if ( + phase0p5Flag && + location.pathname.includes(`/${locationBasePath}/${labId}`) + ) { + return ( +
+ + + + Back +
+ ); + } return ( - + <> + + ); };