Skip to content

Commit

Permalink
update display text
Browse files Browse the repository at this point in the history
  • Loading branch information
gmrabian committed Jan 8, 2025
1 parent d0b9605 commit f69cffa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
10 changes: 1 addition & 9 deletions services/app-api/forms/naaar.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,20 +284,12 @@
}
]
},
"dashboardTitle": "",
"dashboardTitle": "Analysis method <br/> Frequency and plan utilization",
"addEntityButtonText": "Add other analysis method",
"editEntityButtonText": "",
"readOnlyEntityButtonText": "",
"tableHeader": "Analysis method <br/> Frequency and plan utilization",
"addEditModalAddTitle": "Analysis method: Add other",
"addEditModalEditTitle": "Analysis method: Edit other",
"deleteEntityButtonAltText": "Delete other analysis method",
"deleteModalTitle": "Are you sure you want to delete this analysis method?",
"deleteModalConfirmButtonText": "Yes, delete method",
"deleteModalWarning": "Are you sure you want to proceed? You will lose all information entered for this analysis method in the NAAAR. The method will remain in previously submitted NAAAR reports if applicable.",
"entityUnfinishedMessage": "Complete the remaining indicators for this access measure by entering details.",
"enterEntityDetailsButtonText": "Enter",
"readOnlyEntityDetailsButtonText": "View",
"drawerTitle": "Analysis method: "
},
"drawerForm": {
Expand Down
20 changes: 17 additions & 3 deletions services/ui-src/src/components/reports/DrawerReportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ export const DrawerReportPage = ({ route, validateOnRender }: Props) => {
const enterButton = (entity: EntityShape, isEntityCompleted: boolean) => {
let disabled = false;
let style = sx.enterButton;
const buttonText = userIsEndUser
? isEntityCompleted
? "Edit"
: "Enter"
: "View";

if (
(route.path === "/mcpar/plan-level-indicators/ilos" && !hasIlos) ||
Expand All @@ -189,7 +194,7 @@ export const DrawerReportPage = ({ route, validateOnRender }: Props) => {
variant="outline"
disabled={disabled}
>
{isEntityCompleted ? "Edit" : "Enter"}
{buttonText}
</Button>
);
};
Expand Down Expand Up @@ -266,6 +271,15 @@ export const DrawerReportPage = ({ route, validateOnRender }: Props) => {
);
});
};
const getDrawerTitle = () => {
let name = "Add other";
if (selectedEntity?.name) {
name = selectedEntity.name;
} else if (selectedEntity?.custom_analysis_method_name) {
name = selectedEntity.custom_analysis_method_name;
}
return `${verbiage.drawerTitle} ${name}`;
};

return (
<Box>
Expand Down Expand Up @@ -294,7 +308,7 @@ export const DrawerReportPage = ({ route, validateOnRender }: Props) => {
)}
<Box>
<Heading as="h3" sx={sx.dashboardTitle}>
{verbiage.dashboardTitle}
{parseCustomHtml(verbiage.dashboardTitle)}
</Heading>
{isMcparReport && reportingOnIlos && !hasPlans && !hasIlos ? (
// if there are no plans and no ILOS added, display this message
Expand Down Expand Up @@ -324,7 +338,7 @@ export const DrawerReportPage = ({ route, validateOnRender }: Props) => {
<ReportDrawer
selectedEntity={selectedEntity!}
verbiage={{
drawerTitle: `${verbiage.drawerTitle} ${selectedEntity?.name}`,
drawerTitle: getDrawerTitle(),
drawerInfo: verbiage.drawerInfo,
}}
form={selectedIsCustomEntity ? addEntityDrawerForm : form}
Expand Down

0 comments on commit f69cffa

Please sign in to comment.