Skip to content

Commit

Permalink
MHV-61461 MR: Update the title tags for all the details pages in the …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
oleksii-morgun authored Dec 12, 2024
1 parent aab02d5 commit ecc6a66
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ const AdmissionAndDischargeDetails = props => {
useEffect(
() => {
focusElement(document.querySelector('h1'));
updatePageTitle(
`${record.name} - ${pageTitles.CARE_SUMMARIES_AND_NOTES_PAGE_TITLE}`,
);
},
[record],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ const ProgressNoteDetails = props => {
useEffect(
() => {
focusElement(document.querySelector('h1'));
updatePageTitle(
`${record.name} - ${pageTitles.CARE_SUMMARIES_AND_NOTES_PAGE_TITLE}`,
);
},
[record],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ const MicroDetails = props => {
useEffect(
() => {
focusElement(document.querySelector('h1'));
updatePageTitle(
`${record.name} - ${pageTitles.LAB_AND_TEST_RESULTS_PAGE_TITLE}`,
);
},
[record],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ const PathologyDetails = props => {
useEffect(
() => {
focusElement(document.querySelector('h1'));
updatePageTitle(
`${record.name} - ${pageTitles.LAB_AND_TEST_RESULTS_PAGE_TITLE}`,
);
},
[record],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ const RadiologyDetails = props => {
useEffect(
() => {
focusElement(document.querySelector('h1'));
updatePageTitle(
`${record.name} - ${pageTitles.LAB_AND_TEST_RESULTS_PAGE_TITLE}`,
);
},
[record],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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';
Expand Down Expand Up @@ -40,6 +42,7 @@ const CareSummariesDetails = () => {
if (summaryId) {
dispatch(getCareSummaryAndNotesDetails(summaryId, careSummariesList));
}
updatePageTitle(pageTitles.CARE_SUMMARIES_AND_NOTES_DETAILS_PAGE_TITLE);
},
[summaryId, careSummariesList, dispatch],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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';
Expand Down Expand Up @@ -44,6 +46,7 @@ const LabAndTestDetails = () => {
if (labId) {
dispatch(getlabsAndTestsDetails(labId, labAndTestList));
}
updatePageTitle(pageTitles.LAB_AND_TEST_RESULTS_DETAILS_PAGE_TITLE);
},
[labId, labAndTestList, dispatch],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}`,
);

Expand Down
10 changes: 10 additions & 0 deletions src/applications/mhv-medical-records/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit ecc6a66

Please sign in to comment.