diff --git a/frontend/cypress/e2e/change-complaint-status-details-view.cy.ts b/frontend/cypress/e2e/change-complaint-status-details-view.cy.ts index 5d6f41881..5e8910e15 100644 --- a/frontend/cypress/e2e/change-complaint-status-details-view.cy.ts +++ b/frontend/cypress/e2e/change-complaint-status-details-view.cy.ts @@ -35,9 +35,11 @@ describe("Complaint Change Status spec - Details View", () => { it("Changes status of closeable complaint to open, closed, and back to open", () => { if ("#hwcr-tab".includes(complaintTypes[index])) { cy.navigateToDetailsScreen(COMPLAINT_TYPES.HWCR, "23-000076", true); + cy.assignSelfToComplaint(); fillInAssessmentSection(); } else { cy.navigateToDetailsScreen(COMPLAINT_TYPES.ERS, "23-006888", true); + cy.assignSelfToComplaint(); } cy.get("#details-screen-update-status-button").click({ force: true }); @@ -70,6 +72,7 @@ describe("Complaint Change Status spec - Details View", () => { it("Changes status of unclosable hwcr complaint from open to closed", () => { cy.navigateToDetailsScreen(COMPLAINT_TYPES.HWCR, "23-000078", true); + cy.assignSelfToComplaint(); cy.get("#details-screen-update-status-button").click({ force: true }); diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index 8f02d868c..926a3b56d 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -448,4 +448,12 @@ Cypress.Commands.add( }, ); +Cypress.Commands.add( + "assignSelfToComplaint", + () => { + cy.get("#details-screen-assign-button").click(); + cy.get("#self_assign_button").click(); + cy.waitForSpinner(); +}); + module.exports = {}; diff --git a/frontend/cypress/support/index.ts b/frontend/cypress/support/index.ts index 2d9e159b1..dc147fde5 100644 --- a/frontend/cypress/support/index.ts +++ b/frontend/cypress/support/index.ts @@ -31,5 +31,6 @@ declare namespace Cypress { fillInHWCSection(section: HwcSection): Chainable; validateHWCSection(section: HwcSection): Chainable; hasErrorMessage(inputs: Array, toastText?: string): Chainable; + assignSelfToComplaint(): Chainable; } } diff --git a/frontend/src/app/components/containers/complaints/details/complaint-header.tsx b/frontend/src/app/components/containers/complaints/details/complaint-header.tsx index 7807b99d1..cb75d13ff 100644 --- a/frontend/src/app/components/containers/complaints/details/complaint-header.tsx +++ b/frontend/src/app/components/containers/complaints/details/complaint-header.tsx @@ -63,6 +63,7 @@ export const ComplaintHeader: FC = ({ complaint_identifier: id, complaint_type: complaintType, complaint_status: statusCode, + is_officer_assigned: officerAssigned !== "Not Assigned", }, }), ); diff --git a/frontend/src/app/components/containers/complaints/outcomes/hwcr-complaint-assessment.tsx b/frontend/src/app/components/containers/complaints/outcomes/hwcr-complaint-assessment.tsx index 63be3441f..f7bcf0f73 100644 --- a/frontend/src/app/components/containers/complaints/outcomes/hwcr-complaint-assessment.tsx +++ b/frontend/src/app/components/containers/complaints/outcomes/hwcr-complaint-assessment.tsx @@ -3,13 +3,14 @@ import { Button, Card, Alert } from "react-bootstrap"; import { Link } from "react-router-dom"; import Option from "@apptypes/app/option"; import { useAppDispatch, useAppSelector } from "@hooks/hooks"; -import { selectOfficerListByAgency, selectOfficersByAgency } from "@store/reducers/officer"; +import { selectOfficerListByAgency, selectOfficersByAgency, assignComplaintToOfficer } from "@store/reducers/officer"; import { selectComplaintCallerInformation, selectComplaintAssignedBy, selectComplaintLargeCarnivoreInd, selectLinkedComplaints, selectComplaintViewMode, + selectComplaint, } from "@store/reducers/complaints"; import { selectAssessmentCat1Dropdown, @@ -39,6 +40,7 @@ import { OptionLabels } from "@constants/option-labels"; import { HWCRComplaintAssessmentLinkComplaintSearch } from "./hwcr-complaint-assessment-link-complaint-search"; import { CompRadioGroup } from "@/app/components/common/comp-radiogroup"; import useValidateComplaint from "@hooks/validate-complaint"; +import { Officer } from "@/app/types/person/person"; type Props = { id: string; @@ -65,6 +67,7 @@ export const HWCRComplaintAssessment: FC = ({ const [editable, setEditable] = useState(true); const [validateOnChange, setValidateOnChange] = useState(false); const [selectedContacted, setSelectedContacted] = useState("No"); + const [selectedOfficerData, setSelectedOfficerData] = useState(); const [selectedAttended, setSelectedAttended] = useState("No"); const [selectedLocation, setSelectedLocation] = useState