Skip to content

Commit

Permalink
Update Review page to reflect program changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Vega committed Dec 11, 2024
1 parent 41f1aa1 commit a398edb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/content/questionnaire/sections/Review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ReviewDataListingProperty, {
StyledValue,
} from "../../../components/Questionnaire/ReviewDataListingProperty";
import ReviewFileTypeTable from "../../../components/Questionnaire/ReviewFileTypeTable";
import { mapObjectWithKey, formatPhoneNumber, findProgram } from "../../../utils";
import { mapObjectWithKey, formatPhoneNumber } from "../../../utils";
import useFormMode from "../../../hooks/useFormMode";
import DataTypes from "../../../config/DataTypesConfig";
import SectionMetadata from "../../../config/SectionMetadata";
Expand Down Expand Up @@ -74,9 +74,7 @@ const FormSectionReview: FC<FormSectionProps> = ({ SectionOption, refs }: FormSe
);
const [fileTypes] = useState<KeyedFileTypeData[]>(data.files?.map(mapObjectWithKey) || []);
const [piAddressPart1, ...piAddressPart2] = pi?.address?.split(",") || [];
const [programOption] = useState<ProgramOption>(findProgram(data.program));
const predefinedProgram =
programOption && !programOption.editable && !programOption.notApplicable;

const showReviewTitle = formMode === "View Only" || formMode === "Review";

const getFormObject = (): FormObject | null => {
Expand Down Expand Up @@ -258,18 +256,18 @@ const FormSectionReview: FC<FormSectionProps> = ({ SectionOption, refs }: FormSe
<ReviewDataListingProperty
idPrefix="review-program-information-title"
label="Program Title"
value={predefinedProgram ? programOption.name : program?.name}
value={program?.name}
/>
<ReviewDataListingProperty
idPrefix="review-program-information-abbreviation"
label="Program Abbreviation"
value={predefinedProgram ? programOption.abbreviation : program?.abbreviation}
value={program?.abbreviation}
/>
<ReviewDataListingProperty
idPrefix="review-program-information-description"
gridWidth={12}
label="Program Description"
value={predefinedProgram ? programOption.description : program?.description}
value={program?.description}
valuePlacement="bottom"
/>
</ReviewDataListing>
Expand Down

0 comments on commit a398edb

Please sign in to comment.