Skip to content

Commit 5640f62

Browse files
authored
COMP-686: Record Approved by disappears when the next step in the Rec… (#605)
* COMP-686: Record Approved by disappears when the next step in the Record Stepper is selected * COMP-689: change label on the Record prepared by * COMP-687: Label change: Findings to Inspection Details
1 parent 528ea49 commit 5640f62

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

compliance-web/cypress/components/_components/_App/_Inspections/_Requirements/mockData.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const baseRequirement: InspectionRequirement = {
1616
is_active: true,
1717
requirement_source_details: [
1818
{
19-
requirement_source: { id: "1", name: "Test Source" },
19+
requirement_source: { id: "1", name: "Test Source", source_title: "Test Source Title" },
2020
requirement_source_id: 1,
2121
section_number: "1.1",
2222
condition_number: null,
@@ -26,14 +26,24 @@ export const baseRequirement: InspectionRequirement = {
2626
is_active: true,
2727
id: 1,
2828
requirement_id: 1,
29+
source_title: "Test Source Title",
30+
appendix_id: 1,
31+
appendix: { id: 1, appendix_no: "A", document_title: "Test Document Title", inspection_id: 1 },
32+
images: [],
33+
order_id: 1,
34+
order: { id: 1, order_number: "1", inspection_id: 1, where_as: "Test Where As", now_therefore: "Test Now Therefore", is_active: true },
2935
documents: [
30-
{ id: 1, req_detail_id: 1, document_type: { id: "1", name: "Test Document" },
36+
{
37+
id: 1, req_detail_id: 1, document_type: { id: "1", name: "Test Document" },
3138
document_type_id: 1,
3239
document_title: "Test Document",
3340
section_number: "1.1",
3441
section_title: "Test Section",
3542
description: "Test Description",
3643
is_active: true,
44+
appendix: { id: 1, appendix_no: "A", document_title: "Test Document Title", inspection_id: 1 },
45+
appendix_id: 1,
46+
images: [],
3747
},
3848
],
3949
},
@@ -73,4 +83,5 @@ export const mockInspection: Inspection = {
7383
project_status: null,
7484
project: null,
7585
initiation: null,
86+
debrief_date: "2021-01-01",
7687
};

compliance-web/src/components/App/Inspections/Profile/Reports/OfficerSteppr/RegPartyResponse.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,13 @@ const RegPartyResponse: React.FC<RegPartyResponseProps> = ({
121121
}}
122122
>
123123
{responseReceived === "yes" && (
124-
<ControlledDateField
125-
name="responseDate"
126-
label="Preliminary IR Response Date"
127-
height="2rem"
128-
width="40%"
129-
/>
124+
<Box maxWidth="270px">
125+
<ControlledDateField
126+
name="responseDate"
127+
label="Preliminary IR Response Date"
128+
height="2rem"
129+
/>
130+
</Box>
130131
)}
131132
<Box
132133
sx={{

compliance-web/src/components/App/Inspections/Profile/Reports/ReportTabContents/IROverview/PreparedByPopover.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const preparedByFormSchema = yup.object().shape({
1717
primaryOfficer: yup
1818
.object<StaffUser>()
1919
.nullable()
20-
.required("Primary Officer is required"),
20+
.required("Record Prepared By is required"),
2121
});
2222

2323
type PreparedBySchemaType = yup.InferType<typeof preparedByFormSchema>;
@@ -79,8 +79,8 @@ const PreparedByPopover: React.FC<PreparedByPopoverProps> = ({
7979
<Box display="flex" flexDirection="column" px={2} pt={2}>
8080
<ControlledAutoComplete
8181
name="primaryOfficer"
82-
label="Primary Officer"
83-
placeholder="Select Primary Officer"
82+
label="Record Prepared By"
83+
placeholder="Select Record Prepared By"
8484
options={staffUserList ?? []}
8585
getOptionLabel={(option) => option.name}
8686
getOptionKey={(option) => option.id}

compliance-web/src/components/App/Inspections/Profile/Reports/ReportTabContents/IROverview/ProjectOverview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ const ProjectOverview = () => {
116116
const getApprovedBy = () => {
117117
const isApproved = [
118118
IRProgressEnum.PRELIMINARY_APPROVED,
119+
IRProgressEnum.HOLDER_PRELIMINARY_REVIEW,
119120
IRProgressEnum.FINAL_APPROVED,
120121
IRProgressEnum.ISSUED,
121122
].includes(inspectionReportsData?.ir_progress?.id as IRProgressEnum);

compliance-web/src/components/App/Inspections/Profile/Requirements/RequirementFormLeft.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@ Changing it will delete the existing document so you can create a new one`;
382382
/>
383383
)}
384384
<ControlledLexicalEditor
385-
label="Findings"
385+
label="Inspection Details"
386386
name="findings"
387-
placeholder="Enter Findings..."
387+
placeholder="Enter Inspection Details..."
388388
height={`calc(100vh - ${appHeaderHeight + 363}px)`}
389389
isAdvanced
390390
mentionsList={mentionDataList}

0 commit comments

Comments
 (0)