Skip to content

Commit

Permalink
Merge branch 'CE-1076-Add-Method-Complaint-Recvd' of https://github.c…
Browse files Browse the repository at this point in the history
…om/bcgov/nr-compliance-enforcement into CE-1076-Add-Method-Complaint-Recvd
  • Loading branch information
afwilcox committed Oct 15, 2024
2 parents fc2fca3 + 308f185 commit 0206dd5
Show file tree
Hide file tree
Showing 28 changed files with 198 additions and 239 deletions.
10 changes: 8 additions & 2 deletions backend/src/v1/staging_complaint/staging_complaint.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,14 @@ export class StagingComplaintService {
// Given two WebEOCComplaint objects, compare them and return true if they're the same. This function
// ignores some attributes (specifically the back_number_of* attributes)
_compareWebEOCComplaints = (complaint1: WebEOCComplaint, complaint2: WebEOCComplaint): boolean => {
// Attributes to ignore
const attributesToIgnore = ["back_number_of_days", "back_number_of_hours", "back_number_of_minutes", "entrydate"];
// Attributes to ignore, if these are changed we don't consider it an edit
const attributesToIgnore = [
"back_number_of_days",
"back_number_of_hours",
"back_number_of_minutes",
"entrydate",
"status",
];

// Omit the attributes to ignore
const complaint1Filtered = omit(complaint1, attributesToIgnore);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ export const CreateComplaint: FC = () => {
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const ComplaintDetailsEdit: FC = () => {
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed: resetErrorMessages,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const AuthoizationOutcomeForm: FC<props> = ({ id, type, value, leadIdenti
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed: () => {
//-- reset the form to its original state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ export const DecisionForm: FC<props> = ({

useEffect(() => {
if (sector && schedule) {
let options = scheduleSectorType.filter((item) => item.schedule === schedule).map(item => {
const record: Option = { label: item.longDescription, value: item.sector };
return record
});
let options = scheduleSectorType
.filter((item) => item.schedule === schedule)
.map((item) => {
const record: Option = { label: item.longDescription, value: item.sector };
return record;
});
setSectorList(options);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -196,10 +198,12 @@ export const DecisionForm: FC<props> = ({
};

const handleScheduleChange = (schedule: string) => {
let options = scheduleSectorType.filter((item) => item.schedule === schedule).map(item => {
const record: Option = { label: item.longDescription, value: item.sector };
return record
});
let options = scheduleSectorType
.filter((item) => item.schedule === schedule)
.map((item) => {
const record: Option = { label: item.longDescription, value: item.sector };
return record;
});
const model = { ...data, sector: "", schedule: schedule };
setData(model);
setSectorList(options);
Expand All @@ -218,7 +222,7 @@ export const DecisionForm: FC<props> = ({
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed: () => {
//-- reset the form to its original state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const HWCRComplaintAssessment: FC = () => {
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export const EquipmentForm: FC<EquipmentFormProps> = ({ equipment, assignedOffic
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const HWCRFileReview: FC = () => {
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed: () => {
setReviewRequired(isReviewRequired);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const HWCROutcomeByAnimalv2: FC<props> = () => {
data: {
caseFileId: id,
outcomeId, //-- this is the id of the animal outcome thats being deleted
title: "Delete Animal Outcome",
title: "Delete animal outcome",
description: "All the data in this section will be lost.",
ok: "Yes, delete animal outcome",
cancel: "No, go back",
Expand Down Expand Up @@ -116,7 +116,7 @@ export const HWCROutcomeByAnimalv2: FC<props> = () => {
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed: () => {
setShowForm(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const HWCRComplaintPrevention: FC = () => {
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export const EditOutcome: FC<props> = ({ id, index, outcome, assignedOfficer: of
return (
<>
<StandaloneConfirmCancelModal
title="Cancel Changes?"
title="Cancel changes?"
description="Your changes will be lost."
show={showModal}
closeAndCancel={cancel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const OutcomeAttachments: FC<props> = ({ showAddButton = false }) => {
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const SupplementalNote: FC = () => {
modalSize: "md",
modalType: DELETE_NOTE,
data: {
title: "Delete Supplemental Note",
title: "Delete supplemental note",
description: "All the data in this section will be lost.",
caseIdentifier: id,
ok: "Yes, delete note",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const SupplementalNotesInput: FC<props> = ({ id, complaintType, notes, cu
modalSize: "md",
modalType: CANCEL_CONFIRM,
data: {
title: "Cancel Changes?",
title: "Cancel changes?",
description: "Your changes will be lost.",
cancelConfirmed: () => {
setCurrentNotes(notes);
Expand Down
118 changes: 57 additions & 61 deletions frontend/src/app/components/modal/instances/assign-officer-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChangeEvent, FC, useState } from "react";
import { Modal, Button } from "react-bootstrap";
import { Modal, Button, CloseButton, ListGroup, ListGroupItem, Card } from "react-bootstrap";
import { useAppDispatch, useAppSelector } from "../../../hooks/hooks";
import {
profileDisplayName,
Expand Down Expand Up @@ -121,26 +121,21 @@ export const AssignOfficerModal: FC<AssignOfficerModalProps> = ({ close, submit,
// don't display the current user in the list since we already have the current user at the top of the modal
if (authUserId === undefined || !compareUuidToString(authUserId, idir)) {
return (
<div
className={`${
selectedAssignee === personId
? "assign_officer_modal_profile_card_selected"
: "assign_officer_modal_profile_card"
}`}
<ListGroupItem
action
className={`${selectedAssignee === personId ? "comp-profile-card comp-profile-card-selected" : "comp-profile-card"}`}
key={personId}
onClick={() => handleAssigneeClick(personId)}
>
<div className="assign_officer_modal_profile_card_column">
<div className="assign_officer_modal_profile_card_profile-picture">
<div data-initials-modal={officerInitials}></div>
</div>
</div>
<div className="assign_officer_modal_profile_card_column">
<div className="comp-profile-card-info">
<div
className="comp-avatar comp-avatar-sm comp-avatar-orange"
data-initials-modal={officerInitials}
></div>
<div className="assign_officer_modal_profile_card_row_1">{displayName}</div>
{showExperimentalFeature && <div className="assign_officer_modal_profile_card_row_2">Officer</div>}
</div>
<div className="assign_officer_modal_profile_card_column"></div>
</div>
</ListGroupItem>
);
} else {
return <></>;
Expand All @@ -161,66 +156,67 @@ export const AssignOfficerModal: FC<AssignOfficerModalProps> = ({ close, submit,
return (
<>
{title && (
<Modal.Header
closeButton={true}
className="border-0"
>
<Modal.Title style={{ fontSize: "20px" }}>{title}</Modal.Title>
<Modal.Header closeButton={true}>
<Modal.Title as="h3">{title}</Modal.Title>
</Modal.Header>
)}
<Modal.Body>
<div className="assign_officer_modal_profile_card self-assign">
<div className="assign_officer_modal_profile_card_column">
<div className="assign_officer_modal_profile_card_profile-picture">
<div
data-initials-modal={initials}
className="comp-profile-avatar"
></div>
</div>
</div>
<div className="assign_officer_modal_profile_card_column">
<Card
className="comp-profile-card"
style={{ marginBottom: "24px" }}
>
<div className="comp-profile-card-info">
<div
className="comp-avatar comp-avatar-sm comp-avatar-orange"
data-initials-modal={initials}
></div>

<div className="assign_officer_modal_profile_card_row_1">{displayName}</div>
{showExperimentalFeature && <div className="assign_officer_modal_profile_card_row_2">Officer</div>}
</div>
<div className="assign_officer_modal_profile_card_column">
<div className="profile-card-actions">
<Button
id="self_assign_button"
title="Self Assign Button"
title="Self assign Button"
onClick={handleSelfAssign}
>
Self assign
</Button>
</div>
</div>
<hr className="modal_hr" />
<div id="assign_officer_modal_search">
<div className="assign_officer_modal_subtitle">Everyone</div>
<div className="input_row">
<BsPerson className="icon" />
<input
id="officer-search"
className="comp-form-control"
placeholder="Type name to search"
type="input"
aria-label="Search"
aria-describedby="basic-addon2"
onChange={(evt) => handleInputChange(evt)}
onFocus={() => handleInputFocus()}
value={searchInput}
/>
{searchInput && (
<button
type="reset"
onClick={() => setSearchInput("")}
>
&times;
</button>
)}
</Card>

<section
style={{ marginBottom: "24px" }}
id="assign_officer_modal_search"
>
<h4 style={{ marginBottom: "8px", fontSize: "16px", fontWeight: 700 }}>Everyone</h4>
<div className="assign-officer-search-container">
<div className="comp-search-input">
<BsPerson className="icon" />
<input
id="officer-search"
className="comp-form-control"
placeholder="Type name to search"
type="input"
aria-label="Search"
aria-describedby="basic-addon2"
onChange={(evt) => handleInputChange(evt)}
onFocus={() => handleInputFocus()}
value={searchInput}
/>
{searchInput && (
<CloseButton
onClick={() => setSearchInput("")}
tabIndex={0}
></CloseButton>
)}
</div>
</div>
</div>
<hr className="modal_hr" />
<div className="assign_officer_modal_subtitle">{renderHeading()}</div>
<div className="modal-scroll">{renderOfficers()}</div>
</section>
<section>
<h4 style={{ marginBottom: "8px", fontSize: "16px", fontWeight: 700 }}>{renderHeading()}</h4>
<ListGroup>{renderOfficers()}</ListGroup>
</section>
</Modal.Body>
<Modal.Footer>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ export const CancelConfirmModal: FC<CancelConfirmProps> = ({ close, submit, canc
</Modal.Header>
)}
<Modal.Body>
<div className="cancel_confirm_modal_description">
<Row>
<Col>
<label>{description}</label>
</Col>
</Row>
</div>
<p>{description}</p>
</Modal.Body>
<Modal.Footer>
<Button
Expand Down
Loading

0 comments on commit 0206dd5

Please sign in to comment.