Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CE-936 Add privacy indication field to complaint #647

Merged
merged 47 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f9f3cd0
feat: CE-202-Complaint-Type-doesnt-automatically-reclassify-as-an-Enf…
dmitri-korin-bcps Aug 26, 2024
b05a0ca
fix: CE-1008 - WebEOC complaints with very long Suspect and Witness D…
marqueone-ps Aug 26, 2024
96b8c51
feat: CE 981 hide zone and tabs for CEEB users (#597)
gregorylavery Aug 26, 2024
e3dd991
fix: CE-1023 Few layout fixes to actions taken. (#603)
gregorylavery Aug 26, 2024
b2cf910
feat: CE-1004 outcome attachments for CEEB (#606)
Scarlett-Truong Aug 30, 2024
e2a12f0
feat: CE-1013 - Update to Logic that Displays Agency Icon (#600)
marqueone-ps Aug 30, 2024
bd20923
fix: CE-1004 add plus icon to button (#608)
barrfalk Aug 30, 2024
1cac931
fix: CE-1004-fix-attachment-text-casing (#609)
barrfalk Aug 30, 2024
b072e01
feat: CE-976 Admin screen for CEEB (#605)
Scarlett-Truong Aug 30, 2024
8a4bd67
feat: CE-1029 - UI Updates to Complaints Tables (#614)
jeznorth Sep 5, 2024
aff15a7
chore(deps): update jest monorepo (#611)
renovate[bot] Sep 5, 2024
9c17f3f
fix: CE-1036-revert-hwcr-tab-rename (#617)
afwilcox Sep 6, 2024
18f3ebc
fix: Makes the naming in the list consistent. (#618)
gregorylavery Sep 6, 2024
d011ecb
feat: CE-977 create ceeb decison (#607)
marqueone-ps Sep 6, 2024
ba0cfb9
fix: CE-1049 Remove GIR Officer Initials (#622)
afwilcox Sep 9, 2024
beb8193
feat: CE-776 - Keyboard Navigation Improvements - Complaints List Pag…
jeznorth Sep 9, 2024
927ccb6
feat: CE-1003 Add notes to CEEB complaint outcome (#621)
Scarlett-Truong Sep 9, 2024
2c562aa
chore(deps): update postgis/postgis:15-master docker digest to 9e03ed…
renovate[bot] Sep 10, 2024
ccbb38c
feat: CE-1028 - Add Close Button to Desktop Filters (#615)
jeznorth Sep 10, 2024
d891013
fix: CE 1052 Reapply the button styling for Species (#624)
gregorylavery Sep 10, 2024
cb1e766
fix: CE 1017 (#619)
gregorylavery Sep 11, 2024
b28a168
fix: Modifies how the contstraint is added to the feature_agency_xref…
gregorylavery Sep 11, 2024
49d8048
fix: CE-1055 Remove Margins from decision HR (#625)
afwilcox Sep 11, 2024
a937a6d
feat: CE-996-Add Method complaint was received field to Complaint (#626)
barrfalk Sep 12, 2024
4a59540
feat: CE-1002 Allow CEEB users to capture authorization number (#620)
marqueone-ps Sep 13, 2024
c3eedad
feat: CE-946-Allow-assignment-of-ceeb-complaints-to-ceeb-officers (#610)
dmitri-korin-bcps Sep 13, 2024
4abcce5
fix: CE-1073 and CE-1074 Proper Focus and Validation for Input Groups…
afwilcox Sep 13, 2024
a6fbb03
fix: CE-1073: Delay UA transition out effect (#631)
afwilcox Sep 16, 2024
cab1982
fix: CE-1056 default filters not showing (#643)
Scarlett-Truong Sep 17, 2024
6d6be66
fix: CE-1059 Unable to save Decision section without entering all fie…
marqueone-ps Sep 17, 2024
4ae0f79
fix: Image Deletion Issue in Update pr-open.yml (#644)
barrfalk Sep 17, 2024
aaa39e6
feat: initial check in
Sep 17, 2024
428cc30
complaint updates
Sep 19, 2024
f0dc224
feat: updated components to reflect change in business rules
Sep 20, 2024
6afccb5
Merge branch 'release/orca' into feat/CE-936
marqueone-ps Sep 20, 2024
b1f659f
feat: updated complaints components to enable feature flagging
Sep 20, 2024
8bd187f
fix: code smell
Sep 20, 2024
b9a2172
feat: updated export template to include new privacy requested value
Sep 23, 2024
d8064f9
codesmell clean up
Sep 23, 2024
c686997
Merge branch 'release/orca' into feat/CE-936
marqueone-ps Sep 24, 2024
8be8e67
fix: updates to database change as per code review
Sep 24, 2024
b6bf78e
Merge remote-tracking branch 'origin/feat/CE-936' into feat/CE-936
Sep 24, 2024
25ba338
Merge branch 'release/orca' into feat/CE-936
afwilcox Sep 24, 2024
e6bc786
fix: missed update to caller information, incorrectly not displaying …
Sep 24, 2024
916a81e
Merge remote-tracking branch 'origin/feat/CE-936' into feat/CE-936
Sep 24, 2024
908be05
Merge branch 'release/orca' into feat/CE-936
marqueone-ps Sep 24, 2024
b1d297a
fix: added missing conflict from insert statements
Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions backend/src/middleware/maps/automapper-dto-to-entity-maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export const mapComplaintDtoToComplaint = (mapper: Mapper) => {
return null; // This will be handled in the service
}),
),
forMember(
(dest) => dest.is_privacy_requested,
mapFrom((src) => src.isPrivacyRequested),
),
);
};

Expand Down Expand Up @@ -333,6 +337,10 @@ export const mapWildlifeComplaintDtoToHwcrComplaint = (mapper: Mapper) => {
return record;
}),
),
forMember(
(dest) => dest.complaint_identifier.is_privacy_requested,
mapFrom((src) => src.isPrivacyRequested),
),
);
};

Expand Down Expand Up @@ -490,6 +498,10 @@ export const mapAllegationComplaintDtoToAllegationComplaint = (mapper: Mapper) =
(dest) => dest.suspect_witnesss_dtl_text,
mapFrom((src) => src.violationDetails),
),
forMember(
(dest) => dest.complaint_identifier.is_privacy_requested,
mapFrom((src) => src.isPrivacyRequested),
),
);
};

Expand Down Expand Up @@ -593,6 +605,10 @@ export const mapGirComplaintDtoToGirComplaint = (mapper: Mapper) => {
(dest) => dest.gir_complaint_guid,
mapFrom((src) => src.girId),
),
forMember(
(dest) => dest.complaint_identifier.is_privacy_requested,
mapFrom((src) => src.isPrivacyRequested),
),
);
};

Expand Down
28 changes: 28 additions & 0 deletions backend/src/middleware/maps/automapper-entity-to-dto-maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ export const complaintToComplaintDtoMap = (mapper: Mapper) => {
return null;
}),
),
forMember(
(destination) => destination.isPrivacyRequested,
mapFrom((source) => source.is_privacy_requested),
),
);
};

Expand Down Expand Up @@ -702,6 +706,10 @@ export const applyWildlifeComplaintMap = (mapper: Mapper) => {
return null;
}),
),
forMember(
(destination) => destination.isPrivacyRequested,
mapFrom((source) => source.complaint_identifier.is_privacy_requested),
),
);
};

Expand Down Expand Up @@ -921,6 +929,10 @@ export const applyAllegationComplaintMap = (mapper: Mapper) => {
return null;
}),
),
forMember(
(destination) => destination.isPrivacyRequested,
mapFrom((source) => source.complaint_identifier.is_privacy_requested),
),
);
};
export const applyGeneralInfomationComplaintMap = (mapper: Mapper) => {
Expand Down Expand Up @@ -1120,6 +1132,10 @@ export const applyGeneralInfomationComplaintMap = (mapper: Mapper) => {
return complaint_method_received_code?.complaint_method_received_code || null;
}),
),
forMember(
(destination) => destination.isPrivacyRequested,
mapFrom((source) => source.complaint_identifier.is_privacy_requested),
),
);
};

Expand Down Expand Up @@ -1667,6 +1683,18 @@ export const mapAllegationReport = (mapper: Mapper, tz: string = "America/Vancou
return "";
}),
),
forMember(
(destination) => destination.privacyRequested,
mapFrom((source) => {
if (source.complaint_identifier.is_privacy_requested === "Y") {
return "Yes";
} else if (source.complaint_identifier.is_privacy_requested === "N") {
return "No";
} else {
return null;
}
}),
),

//--
forMember(
Expand Down
6 changes: 6 additions & 0 deletions backend/src/middleware/maps/dto-to-table-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ export const mapComplaintDtoToComplaintTable = (mapper: Mapper) => {
};
}),
),
forMember(
(dest) => dest.is_privacy_requested,
mapFrom((src) => {
return src.isPrivacyRequested;
}),
),
);
};

Expand Down
1 change: 1 addition & 0 deletions backend/src/types/models/complaints/complaint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ export interface ComplaintDto {
delegates: Array<DelegateDto>;
webeocId: string;
complaintMethodReceivedCode: string;
isPrivacyRequested: string;
}
7 changes: 7 additions & 0 deletions backend/src/types/models/complaints/update-complaint.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,11 @@ export class UpdateComplaintDto {
description: "Method in which the complaint was created",
})
comp_mthd_recv_cd_agcy_cd_xref: CompMthdRecvCdAgcyCdXref;

@ApiProperty({
example: "true",
description:
"flag to represent that the caller has asked for special care when handling their personal information",
})
is_privacy_requested: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface ComplaintReportData {
complaintMethodReceivedCode: string;

//-- caller information
privacyRequested: string;
name: string;
phone1: string;
phone2: string;
Expand Down
5 changes: 5 additions & 0 deletions backend/src/v1/complaint/complaint.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,11 @@ export class ComplaintService {
"AllegationReportData",
);

//-- this is a bit of a hack to hide and show the privacy requested row
if (data.privacyRequested) {
data = { ...data, privacy: [{ value: data.privacyRequested }] };
}

break;
}
}
Expand Down
14 changes: 10 additions & 4 deletions backend/src/v1/complaint/entities/complaint.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ export class Complaint {
})
location_geometry_point: Point;

/*
@Column()
location_geometry_point: string;
*/
@ApiProperty({
example: "Near Golden",
description: "The summary text for the location of the complaint",
Expand Down Expand Up @@ -205,6 +201,14 @@ export class Complaint {
@Column()
update_utc_timestamp: Date;

@ApiProperty({
example: "true",
description:
"flag to represent that the caller has asked for special care when handling their personal information",
})
@Column()
is_privacy_requested: string;

constructor(
detail_text?: string,
caller_name?: string,
Expand Down Expand Up @@ -232,6 +236,7 @@ export class Complaint {
person_complaint_xref?: PersonComplaintXref[],
webeoc_identifier?: string,
comp_mthd_recv_cd_agcy_cd_xref?: CompMthdRecvCdAgcyCdXref,
is_privacy_requested?: string,
) {
this.detail_text = detail_text;
this.caller_name = caller_name;
Expand Down Expand Up @@ -259,5 +264,6 @@ export class Complaint {
this.person_complaint_xref = person_complaint_xref;
this.webeoc_identifier = webeoc_identifier;
this.comp_mthd_recv_cd_agcy_cd_xref = comp_mthd_recv_cd_agcy_cd_xref;
this.is_privacy_requested = is_privacy_requested;
}
}
Binary file modified backend/templates/complaint/CDOGS-ERS-COMPLAINT-TEMPLATE-v1.docx
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,33 @@ import { useAppSelector } from "../../../../hooks/hooks";
import { selectComplaintCallerInformation } from "../../../../store/reducers/complaints";
import { formatPhoneNumber } from "react-phone-number-input/input";
import { Card } from "react-bootstrap";
import { FEATURE_TYPES } from "../../../../constants/feature-flag-types";
import { isFeatureActive } from "../../../../store/reducers/app";

export const CallerInformation: FC = () => {
const { name, primaryPhone, secondaryPhone, alternatePhone, address, email, reportedByCode } = useAppSelector(
selectComplaintCallerInformation,
);
const { name, primaryPhone, secondaryPhone, alternatePhone, address, email, reportedByCode, isPrivacyRequested } =
useAppSelector(selectComplaintCallerInformation);
const enablePrivacyFeature = useAppSelector(isFeatureActive(FEATURE_TYPES.PRIV_REQ));

let privacy = "";
if (isPrivacyRequested === "Y") {
privacy = "Yes";
} else if (isPrivacyRequested === "N") {
privacy = "No";
}

return (
<section className="comp-details-section">
<h3>Caller Information</h3>
<Card>
<Card.Body>
<dl>
{enablePrivacyFeature && (
<div>
<dt>Privacy requested</dt>
<dd id="comp-details-name">{privacy}</dd>
</div>
)}
<div>
<dt>Name</dt>
<dd id="comp-details-name">{name}</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ValidationInput } from "../../../../common/validation-input";
import Option from "../../../../types/app/option";
import { Coordinates } from "../../../../types/app/coordinate-type";
import { useAppDispatch, useAppSelector } from "../../../../hooks/hooks";
import { openModal, selectActiveTab, userId } from "../../../../store/reducers/app";
import { openModal, selectActiveTab, userId, isFeatureActive } from "../../../../store/reducers/app";
import notificationInvalid from "../../../../../assets/images/notification-invalid.png";

import {
Expand All @@ -22,6 +22,7 @@ import {
selectComplaintReceivedMethodDropdown,
selectCreatableComplaintTypeDropdown,
selectHwcrNatureOfComplaintCodeDropdown,
selectPrivacyDropdown,
selectReportedByDropdown,
selectSpeciesCodeDropdown,
selectViolationCodeDropdown,
Expand Down Expand Up @@ -60,6 +61,7 @@ import AttachmentEnum from "../../../../constants/attachment-enum";
import { getUserAgency } from "../../../../service/user-service";
import { useSelector } from "react-redux";
import { ComplaintDetails } from "../../../../types/complaints/details/complaint-details";
import { FEATURE_TYPES } from "../../../../constants/feature-flag-types";

export const CreateComplaint: FC = () => {
const dispatch = useAppDispatch();
Expand Down Expand Up @@ -95,6 +97,9 @@ export const CreateComplaint: FC = () => {
{ value: "No", label: "No" },
];

const privacyDropdown = useAppSelector(selectPrivacyDropdown);
const enablePrivacyFeature = useAppSelector(isFeatureActive(FEATURE_TYPES.PRIV_REQ));

const currentDate = useMemo(() => new Date(), []);

const [complaintData, applyComplaintData] = useState<ComplaintAlias>();
Expand Down Expand Up @@ -170,6 +175,7 @@ export const CreateComplaint: FC = () => {
createdBy: userid,
updatedBy: userid,
complaintMethodReceivedCode: "",
isPrivacyRequested: "U",
};

applyComplaintData(model);
Expand Down Expand Up @@ -358,6 +364,14 @@ export const CreateComplaint: FC = () => {
}
};

const handlePrivacyRequestedChange = (selected: Option | null) => {
if (selected) {
const { value } = selected;
const complaint = { ...complaintData, isPrivacyRequested: value } as ComplaintDto;
applyComplaintData(complaint);
}
};

const handleLocationChange = (value: string) => {
const complaint = { ...complaintData, locationSummary: value?.trim() } as ComplaintDto;
applyComplaintData(complaint);
Expand Down Expand Up @@ -1026,6 +1040,30 @@ export const CreateComplaint: FC = () => {

<fieldset>
<legend>Caller Information</legend>
{enablePrivacyFeature && (
<div
className="comp-details-form-row"
id="privacy-requested-id"
>
<label
id="complaint-caller-info-privacy-label-id"
className="col-auto"
htmlFor="caller-privacy-id"
>
Privacy requested
</label>
<div className="comp-details-edit-input">
<Select
options={privacyDropdown}
placeholder="Select"
id="caller-privacy-id"
classNamePrefix="comp-select"
onChange={(e) => handlePrivacyRequestedChange(e)}
/>
</div>
</div>
)}

<div
className="comp-details-form-row"
id="name-pair-id"
Expand Down
Loading
Loading