Skip to content

Commit

Permalink
#1226 | Use program.operationalProgramName instead of name
Browse files Browse the repository at this point in the history
  • Loading branch information
himeshr committed May 14, 2024
1 parent 2cc4acf commit 5c34f4e
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/adminApp/WorkFlow/ShowSubjectType.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,24 @@ import RemoveIcon from "@material-ui/icons/Remove";
export const ShowSubjectType = props => {
const existMapping = props.formMapping.filter(l => l[props.entityUUID] === props.rowDetails.uuid);

const subjectType =
existMapping.length !== 0
? props.subjectType.filter(l => l.uuid === existMapping[0].subjectTypeUUID)
: [];
const subjectType = existMapping.length !== 0 ? props.subjectType.filter(l => l.uuid === existMapping[0].subjectTypeUUID) : [];

return (
<>
{existMapping.length !== 0 && subjectType.length !== 0 && (
<span>
{props.subjectType.filter(l => l.uuid === existMapping[0].subjectTypeUUID)[0].name}
</span>
<span>{props.subjectType.filter(l => l.uuid === existMapping[0].subjectTypeUUID)[0].name}</span>
)}
</>
);
};

export const ShowPrograms = props => {
const existMapping = props.formMapping.filter(l => l.encounterTypeUUID === props.rowDetails.uuid);
const program =
existMapping.length !== 0
? props.program.filter(l => l.uuid === existMapping[0].programUUID)
: [];
const program = existMapping.length !== 0 ? props.program.filter(l => l.uuid === existMapping[0].programUUID) : [];

return (
<>
{existMapping.length !== 0 && program.length !== 0 && (
<span>{props.program.filter(l => l.uuid === existMapping[0].programUUID)[0].name}</span>
)}
{existMapping.length !== 0 && program.length !== 0 && <span>{program[0].operationalProgramName || program[0].name}</span>}
{(existMapping.length === 0 || program.length === 0) && <RemoveIcon />}
</>
);
Expand Down

0 comments on commit 5c34f4e

Please sign in to comment.