From ecc6a66bab56edfaee5045e3b34179eb501f4d8e Mon Sep 17 00:00:00 2001 From: Alex Morgun <87077843+oleksii-morgun@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:43:33 -0500 Subject: [PATCH] MHV-61461 MR: Update the title tags for all the details pages in the Medical Record (#33371) * MHV-61461 lab and test details * MHV-61461 care summaries title * MHV-61461 redo lab and test details * MHV-61461 vaccine details * MHV-61461 allergy details * MHV-61461 conditions details * MHV-61461 vital details --- .../CareSummaries/AdmissionAndDischargeDetails.jsx | 3 --- .../components/CareSummaries/ProgressNoteDetails.jsx | 3 --- .../components/LabsAndTests/ChemHemDetails.jsx | 3 --- .../components/LabsAndTests/EkgDetails.jsx | 3 --- .../components/LabsAndTests/MicroDetails.jsx | 3 --- .../components/LabsAndTests/PathologyDetails.jsx | 3 --- .../components/LabsAndTests/RadiologyDetails.jsx | 3 --- .../mhv-medical-records/containers/AllergyDetails.jsx | 4 +--- .../containers/CareSummariesDetails.jsx | 3 +++ .../containers/ConditionDetails.jsx | 4 +--- .../containers/LabAndTestDetails.jsx | 3 +++ .../mhv-medical-records/containers/VaccineDetails.jsx | 2 +- .../mhv-medical-records/containers/VitalDetails.jsx | 4 ++-- src/applications/mhv-medical-records/util/constants.js | 10 ++++++++++ 14 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/applications/mhv-medical-records/components/CareSummaries/AdmissionAndDischargeDetails.jsx b/src/applications/mhv-medical-records/components/CareSummaries/AdmissionAndDischargeDetails.jsx index e4dc14d45a86..a5cef5fef70e 100644 --- a/src/applications/mhv-medical-records/components/CareSummaries/AdmissionAndDischargeDetails.jsx +++ b/src/applications/mhv-medical-records/components/CareSummaries/AdmissionAndDischargeDetails.jsx @@ -43,9 +43,6 @@ const AdmissionAndDischargeDetails = props => { useEffect( () => { focusElement(document.querySelector('h1')); - updatePageTitle( - `${record.name} - ${pageTitles.CARE_SUMMARIES_AND_NOTES_PAGE_TITLE}`, - ); }, [record], ); diff --git a/src/applications/mhv-medical-records/components/CareSummaries/ProgressNoteDetails.jsx b/src/applications/mhv-medical-records/components/CareSummaries/ProgressNoteDetails.jsx index e9dab3f2d5c8..5a2f6dee3cc5 100644 --- a/src/applications/mhv-medical-records/components/CareSummaries/ProgressNoteDetails.jsx +++ b/src/applications/mhv-medical-records/components/CareSummaries/ProgressNoteDetails.jsx @@ -43,9 +43,6 @@ const ProgressNoteDetails = props => { useEffect( () => { focusElement(document.querySelector('h1')); - updatePageTitle( - `${record.name} - ${pageTitles.CARE_SUMMARIES_AND_NOTES_PAGE_TITLE}`, - ); }, [record], ); diff --git a/src/applications/mhv-medical-records/components/LabsAndTests/ChemHemDetails.jsx b/src/applications/mhv-medical-records/components/LabsAndTests/ChemHemDetails.jsx index 7150f6d2b877..7832a881e19c 100644 --- a/src/applications/mhv-medical-records/components/LabsAndTests/ChemHemDetails.jsx +++ b/src/applications/mhv-medical-records/components/LabsAndTests/ChemHemDetails.jsx @@ -48,9 +48,6 @@ const ChemHemDetails = props => { useEffect( () => { focusElement(document.querySelector('h1')); - updatePageTitle( - `${record.name} - ${pageTitles.LAB_AND_TEST_RESULTS_PAGE_TITLE}`, - ); }, [record.date, record.name], ); diff --git a/src/applications/mhv-medical-records/components/LabsAndTests/EkgDetails.jsx b/src/applications/mhv-medical-records/components/LabsAndTests/EkgDetails.jsx index 06576ef41a3d..21317e8ec282 100644 --- a/src/applications/mhv-medical-records/components/LabsAndTests/EkgDetails.jsx +++ b/src/applications/mhv-medical-records/components/LabsAndTests/EkgDetails.jsx @@ -41,9 +41,6 @@ const EkgDetails = props => { useEffect( () => { focusElement(document.querySelector('h1')); - updatePageTitle( - `${record.name} - ${pageTitles.LAB_AND_TEST_RESULTS_PAGE_TITLE}`, - ); }, [record.date, record.name], ); diff --git a/src/applications/mhv-medical-records/components/LabsAndTests/MicroDetails.jsx b/src/applications/mhv-medical-records/components/LabsAndTests/MicroDetails.jsx index ef29a2b1cb52..c82604188d45 100644 --- a/src/applications/mhv-medical-records/components/LabsAndTests/MicroDetails.jsx +++ b/src/applications/mhv-medical-records/components/LabsAndTests/MicroDetails.jsx @@ -46,9 +46,6 @@ const MicroDetails = props => { useEffect( () => { focusElement(document.querySelector('h1')); - updatePageTitle( - `${record.name} - ${pageTitles.LAB_AND_TEST_RESULTS_PAGE_TITLE}`, - ); }, [record], ); diff --git a/src/applications/mhv-medical-records/components/LabsAndTests/PathologyDetails.jsx b/src/applications/mhv-medical-records/components/LabsAndTests/PathologyDetails.jsx index 8339515bbbec..84abfd20653b 100644 --- a/src/applications/mhv-medical-records/components/LabsAndTests/PathologyDetails.jsx +++ b/src/applications/mhv-medical-records/components/LabsAndTests/PathologyDetails.jsx @@ -44,9 +44,6 @@ const PathologyDetails = props => { useEffect( () => { focusElement(document.querySelector('h1')); - updatePageTitle( - `${record.name} - ${pageTitles.LAB_AND_TEST_RESULTS_PAGE_TITLE}`, - ); }, [record], ); diff --git a/src/applications/mhv-medical-records/components/LabsAndTests/RadiologyDetails.jsx b/src/applications/mhv-medical-records/components/LabsAndTests/RadiologyDetails.jsx index c93b7829bc56..252916bd473b 100644 --- a/src/applications/mhv-medical-records/components/LabsAndTests/RadiologyDetails.jsx +++ b/src/applications/mhv-medical-records/components/LabsAndTests/RadiologyDetails.jsx @@ -113,9 +113,6 @@ const RadiologyDetails = props => { useEffect( () => { focusElement(document.querySelector('h1')); - updatePageTitle( - `${record.name} - ${pageTitles.LAB_AND_TEST_RESULTS_PAGE_TITLE}`, - ); }, [record], ); diff --git a/src/applications/mhv-medical-records/containers/AllergyDetails.jsx b/src/applications/mhv-medical-records/containers/AllergyDetails.jsx index d30b0d22ac06..ac37aed9e605 100644 --- a/src/applications/mhv-medical-records/containers/AllergyDetails.jsx +++ b/src/applications/mhv-medical-records/containers/AllergyDetails.jsx @@ -93,9 +93,7 @@ const AllergyDetails = props => { () => { if (allergyData) { focusElement(document.querySelector('h1')); - updatePageTitle( - `${allergyData.name} - ${pageTitles.ALLERGIES_PAGE_TITLE}`, - ); + updatePageTitle(pageTitles.ALLERGY_DETAILS_PAGE_TITLE); } }, [dispatch, allergyData], diff --git a/src/applications/mhv-medical-records/containers/CareSummariesDetails.jsx b/src/applications/mhv-medical-records/containers/CareSummariesDetails.jsx index 77dc971893c9..d3ae3d141b2f 100644 --- a/src/applications/mhv-medical-records/containers/CareSummariesDetails.jsx +++ b/src/applications/mhv-medical-records/containers/CareSummariesDetails.jsx @@ -1,6 +1,7 @@ import React, { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useParams } from 'react-router-dom'; +import { updatePageTitle } from '@department-of-veterans-affairs/mhv/exports'; import { getCareSummaryAndNotesDetails, clearCareSummariesDetails, @@ -11,6 +12,7 @@ import { ALERT_TYPE_ERROR, accessAlertTypes, loincCodes, + pageTitles, } from '../util/constants'; import useAlerts from '../hooks/use-alerts'; import AccessTroubleAlertBox from '../components/shared/AccessTroubleAlertBox'; @@ -40,6 +42,7 @@ const CareSummariesDetails = () => { if (summaryId) { dispatch(getCareSummaryAndNotesDetails(summaryId, careSummariesList)); } + updatePageTitle(pageTitles.CARE_SUMMARIES_AND_NOTES_DETAILS_PAGE_TITLE); }, [summaryId, careSummariesList, dispatch], ); diff --git a/src/applications/mhv-medical-records/containers/ConditionDetails.jsx b/src/applications/mhv-medical-records/containers/ConditionDetails.jsx index 1e8bb5f2f638..767588c40e81 100644 --- a/src/applications/mhv-medical-records/containers/ConditionDetails.jsx +++ b/src/applications/mhv-medical-records/containers/ConditionDetails.jsx @@ -78,9 +78,7 @@ const ConditionDetails = props => { () => { if (record?.name) { focusElement(document.querySelector('h1')); - updatePageTitle( - `${record.name} - ${pageTitles.HEALTH_CONDITIONS_PAGE_TITLE}`, - ); + updatePageTitle(pageTitles.HEALTH_CONDITIONS_DETAILS_PAGE_TITLE); } }, [record], diff --git a/src/applications/mhv-medical-records/containers/LabAndTestDetails.jsx b/src/applications/mhv-medical-records/containers/LabAndTestDetails.jsx index 78e69ea0dfb7..cd3d1f5c5d5f 100644 --- a/src/applications/mhv-medical-records/containers/LabAndTestDetails.jsx +++ b/src/applications/mhv-medical-records/containers/LabAndTestDetails.jsx @@ -1,6 +1,7 @@ import React, { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useParams } from 'react-router-dom'; +import { updatePageTitle } from '@department-of-veterans-affairs/mhv/exports'; import { clearLabsAndTestDetails, getlabsAndTestsDetails, @@ -14,6 +15,7 @@ import { ALERT_TYPE_ERROR, accessAlertTypes, labTypes, + pageTitles, } from '../util/constants'; import useAlerts from '../hooks/use-alerts'; import AccessTroubleAlertBox from '../components/shared/AccessTroubleAlertBox'; @@ -44,6 +46,7 @@ const LabAndTestDetails = () => { if (labId) { dispatch(getlabsAndTestsDetails(labId, labAndTestList)); } + updatePageTitle(pageTitles.LAB_AND_TEST_RESULTS_DETAILS_PAGE_TITLE); }, [labId, labAndTestList, dispatch], ); diff --git a/src/applications/mhv-medical-records/containers/VaccineDetails.jsx b/src/applications/mhv-medical-records/containers/VaccineDetails.jsx index 4f5ed4e00d17..b4c13d39bac6 100644 --- a/src/applications/mhv-medical-records/containers/VaccineDetails.jsx +++ b/src/applications/mhv-medical-records/containers/VaccineDetails.jsx @@ -72,7 +72,7 @@ const VaccineDetails = props => { () => { if (record) { focusElement(document.querySelector('h1')); - updatePageTitle(`${record.name} - ${pageTitles.VACCINES_PAGE_TITLE}`); + updatePageTitle(pageTitles.VACCINE_DETAILS_PAGE_TITLE); } }, [dispatch, record], diff --git a/src/applications/mhv-medical-records/containers/VitalDetails.jsx b/src/applications/mhv-medical-records/containers/VitalDetails.jsx index 55cf3ab50f7f..238736e7c777 100644 --- a/src/applications/mhv-medical-records/containers/VitalDetails.jsx +++ b/src/applications/mhv-medical-records/containers/VitalDetails.jsx @@ -142,8 +142,8 @@ const VitalDetails = props => { () => { if (records?.length) { updatePageTitle( - `${vitalTypeDisplayNames[records[0].type]} - ${ - pageTitles.VITALS_PAGE_TITLE + `${vitalTypeDisplayNames[records[0].type]} Details - ${ + pageTitles.MEDICAL_RECORDS_PAGE_TITLE }`, ); diff --git a/src/applications/mhv-medical-records/util/constants.js b/src/applications/mhv-medical-records/util/constants.js index 8431a34c96a4..1ac7e2e3c909 100644 --- a/src/applications/mhv-medical-records/util/constants.js +++ b/src/applications/mhv-medical-records/util/constants.js @@ -218,13 +218,23 @@ export const pageTitles = { MEDICAL_RECORDS_PAGE_TITLE: 'Medical Records | Veterans Affairs', LAB_AND_TEST_RESULTS_PAGE_TITLE: 'Lab And Test Results - Medical Records | Veterans Affairs', + LAB_AND_TEST_RESULTS_DETAILS_PAGE_TITLE: + 'Lab And Test Results Details - Medical Records | Veterans Affairs', CARE_SUMMARIES_AND_NOTES_PAGE_TITLE: 'Care Summaries And Notes - Medical Records | Veterans Affairs', + CARE_SUMMARIES_AND_NOTES_DETAILS_PAGE_TITLE: + 'Care Summaries And Notes Details - Medical Records | Veterans Affairs', VACCINES_PAGE_TITLE: 'Vaccines - Medical Records | Veterans Affairs', + VACCINE_DETAILS_PAGE_TITLE: + 'Vaccine Details - Medical records | Veterans Affairs', ALLERGIES_PAGE_TITLE: 'Allergies and Reactions - Medical Records | Veterans Affairs', + ALLERGY_DETAILS_PAGE_TITLE: + 'Allergies And Reactions Details - Medical Records | Veterans Affairs', HEALTH_CONDITIONS_PAGE_TITLE: 'Health Conditions - Medical Records | Veterans Affairs', + HEALTH_CONDITIONS_DETAILS_PAGE_TITLE: + 'Health Condition Details - Medical Records | Veterans Affairs', VITALS_PAGE_TITLE: 'Vitals - Medical Records | Veterans Affairs', DOWNLOAD_PAGE_TITLE: 'Download All Medical Records - Medical Records | Veterans Affairs',