diff --git a/backend/db/migrations/R__reset-complaint-templates.sql b/backend/db/migrations/R__reset-complaint-templates.sql index 7c99ed3b9..089f08d5d 100644 --- a/backend/db/migrations/R__reset-complaint-templates.sql +++ b/backend/db/migrations/R__reset-complaint-templates.sql @@ -1,15 +1,3 @@ -- --- Reset the CDOGS template hashes every time the database scripts run --- this is to make sure that the most up to date template is used --- -UPDATE "configuration" -SET - configuration_value = '' -WHERE - configuration_code = 'HWCTMPLATE'; - -UPDATE "configuration" -SET - configuration_value = '' -WHERE - configuration_code = 'ERSTMPLATE'; \ No newline at end of file +-- Not Required +-- \ No newline at end of file diff --git a/backend/db/migrations/V0.22.1__CE-787.sql b/backend/db/migrations/V0.22.1__CE-787.sql new file mode 100644 index 000000000..ce9ab9e87 --- /dev/null +++ b/backend/db/migrations/V0.22.1__CE-787.sql @@ -0,0 +1,5 @@ +UPDATE "configuration" +SET + configuration_value = '' +WHERE + configuration_code = 'ERSTMPLATE'; \ No newline at end of file diff --git a/backend/package-lock.json b/backend/package-lock.json index 95988131a..2e285bb7c 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -33,6 +33,7 @@ "date-fns": "^3.6.0", "date-fns-tz": "^3.1.3", "dotenv": "^16.0.1", + "escape-html": "^1.0.3", "form-data": "^4.0.0", "geojson": "^0.5.0", "jest-mock": "^29.6.1", @@ -3409,11 +3410,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -5458,9 +5459,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -7266,9 +7267,9 @@ } }, "node_modules/jose": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.14.1.tgz", - "integrity": "sha512-SgjXLpP7jhQkUNKL6RpowoR/IF4QKE+WjLDMpNnh2vmhiFs67NftrNpvFtgbwpvRdtueFliahYYWz9E+XZZQlg==", + "version": "4.15.7", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.7.tgz", + "integrity": "sha512-L7ioP+JAuZe8v+T5+zVI9Tx8LtU8BL7NxkyDFVMv+Qr3JW0jSoYDedLtodaXwfqMpeCyx4WXFNyu9tJt4WvC1A==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -13769,11 +13770,11 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browserslist": { @@ -15284,9 +15285,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "requires": { "to-regex-range": "^5.0.1" } @@ -16587,9 +16588,9 @@ } }, "jose": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.14.1.tgz", - "integrity": "sha512-SgjXLpP7jhQkUNKL6RpowoR/IF4QKE+WjLDMpNnh2vmhiFs67NftrNpvFtgbwpvRdtueFliahYYWz9E+XZZQlg==" + "version": "4.15.7", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.7.tgz", + "integrity": "sha512-L7ioP+JAuZe8v+T5+zVI9Tx8LtU8BL7NxkyDFVMv+Qr3JW0jSoYDedLtodaXwfqMpeCyx4WXFNyu9tJt4WvC1A==" }, "js-sdsl": { "version": "4.4.0", diff --git a/backend/package.json b/backend/package.json index b934ef0f9..5fa883561 100644 --- a/backend/package.json +++ b/backend/package.json @@ -64,6 +64,7 @@ "date-fns": "^3.6.0", "date-fns-tz": "^3.1.3", "dotenv": "^16.0.1", + "escape-html": "^1.0.3", "form-data": "^4.0.0", "geojson": "^0.5.0", "jest-mock": "^29.6.1", diff --git a/backend/src/middleware/maps/automapper-entity-to-dto-maps.ts b/backend/src/middleware/maps/automapper-entity-to-dto-maps.ts index 7dbf0e56e..25d867d93 100644 --- a/backend/src/middleware/maps/automapper-entity-to-dto-maps.ts +++ b/backend/src/middleware/maps/automapper-entity-to-dto-maps.ts @@ -891,7 +891,12 @@ export const mapWildlifeReport = (mapper: Mapper, tz: string = "America/Vancouve ), forMember( (destination) => destination.reportedOn, - mapFrom((source) => source.complaint_identifier.incident_reported_utc_timestmp), + mapFrom((source) => { + const { + complaint_identifier: { incident_reported_utc_timestmp: reported }, + } = source; + return reported || ""; + }), ), forMember( (destination) => destination.updatedOn, @@ -1162,7 +1167,12 @@ export const mapAllegationReport = (mapper: Mapper, tz: string = "America/Vancou ), forMember( (destination) => destination.reportedOn, - mapFrom((source) => source.complaint_identifier.incident_reported_utc_timestmp), + mapFrom((source) => { + const { + complaint_identifier: { incident_reported_utc_timestmp: reported }, + } = source; + return reported || ""; + }), ), forMember( (destination) => destination.updatedOn, diff --git a/backend/src/v1/complaint/complaint.service.ts b/backend/src/v1/complaint/complaint.service.ts index 5f4de51cc..09d24dc0b 100644 --- a/backend/src/v1/complaint/complaint.service.ts +++ b/backend/src/v1/complaint/complaint.service.ts @@ -132,6 +132,8 @@ export class ComplaintService { case "violation_code": case "in_progress_ind": return "allegation"; + case "area_name": + return "cos_organization"; case "complaint_identifier": default: return "complaint"; @@ -1439,7 +1441,10 @@ export class ComplaintService { data.reportedOn = _applyTimezone(data.reportedOn, tz, "datetime"); data.updatedOn = _applyTimezone(data.updatedOn, tz, "datetime"); - if (data?.incidentDateTime) { + + //-- incidentDateTime may not be set, if there's no date + //-- don't try and apply the incident date + if (data.incidentDateTime) { data.incidentDateTime = _applyTimezone(data.incidentDateTime, tz, "datetime"); } diff --git a/backend/src/v1/document/document.controller.ts b/backend/src/v1/document/document.controller.ts index f87c51b95..9f26a7f50 100644 --- a/backend/src/v1/document/document.controller.ts +++ b/backend/src/v1/document/document.controller.ts @@ -8,6 +8,7 @@ import { Roles } from "../../auth/decorators/roles.decorator"; import { Token } from "../../auth/decorators/token.decorator"; import { COMPLAINT_TYPE } from "../../types/models/complaints/complaint-type"; import { format } from "date-fns"; +import { escape } from "escape-html"; @UseGuards(JwtRoleGuard) @ApiTags("document") @@ -27,8 +28,6 @@ export class DocumentController { @Res() res: Response, ): Promise { try { - this.logger.debug("TIMEZONE: ", tz); - const fileName = `Complaint-${id}-${type}-${format(new Date(), "yyyy-MM-dd")}.pdf`; const response = await this.service.exportComplaint(id, type, fileName, tz); @@ -47,7 +46,7 @@ export class DocumentController { res.end(buffer); } catch (error) { this.logger.error(`exception: unable to export document for complaint: ${id} - error: ${error}`); - res.status(500).send(`exception: unable to export document for complaint: ${id} - error: ${error}`); + res.status(500).send(`exception: unable to export document for complaint: ${escape(id)}`); } } } diff --git a/backend/templates/complaint/CDOGS-ERS-COMPLAINT-TEMPLATE-v1.docx b/backend/templates/complaint/CDOGS-ERS-COMPLAINT-TEMPLATE-v1.docx index a541fb577..6155f4ff7 100644 Binary files a/backend/templates/complaint/CDOGS-ERS-COMPLAINT-TEMPLATE-v1.docx and b/backend/templates/complaint/CDOGS-ERS-COMPLAINT-TEMPLATE-v1.docx differ diff --git a/frontend/cypress/e2e/allegation-details-edit.cy.ts b/frontend/cypress/e2e/allegation-details-edit.cy.ts index 488cc123e..2f367ddbc 100644 --- a/frontend/cypress/e2e/allegation-details-edit.cy.ts +++ b/frontend/cypress/e2e/allegation-details-edit.cy.ts @@ -470,7 +470,7 @@ describe("Complaint Edit Page spec - Edit Allegation View", () => { // Reffered by / Complaint Agency cy.get("#reported-pair-id label").should(($label) => { - expect($label).to.contain.text("Reporting Organization"); + expect($label).to.contain.text("Organization Reporting the Complaint"); }); cy.get("#reported-pair-id input").should("exist"); diff --git a/frontend/cypress/e2e/hwcr-details-edit.cy.ts b/frontend/cypress/e2e/hwcr-details-edit.cy.ts index 38acea240..b0237e60b 100644 --- a/frontend/cypress/e2e/hwcr-details-edit.cy.ts +++ b/frontend/cypress/e2e/hwcr-details-edit.cy.ts @@ -423,7 +423,7 @@ describe("Complaint Edit Page spec - Edit View", () => { // Reffered by / Complaint Agency cy.get("#reported-pair-id label").should(($label) => { - expect($label).to.contain.text("Reporting Organization"); + expect($label).to.contain.text("Organization Reporting the Complaint"); }); cy.get("#reported-pair-id input").should("exist"); }); diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 8502e1ae1..233a2daff 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -6620,11 +6620,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -8387,9 +8387,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dependencies": { "jake": "^10.8.5" }, @@ -10008,9 +10008,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -11215,9 +11215,9 @@ } }, "node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==" }, "node_modules/ipaddr.js": { "version": "2.0.1", @@ -12739,9 +12739,9 @@ } }, "node_modules/jest-environment-jsdom/node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "engines": { "node": ">=8.3.0" }, @@ -25348,9 +25348,9 @@ } }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "engines": { "node": ">=10.0.0" }, diff --git a/frontend/src/app/components/common/comp-select.tsx b/frontend/src/app/components/common/comp-select.tsx index e297cb300..a9756b13d 100644 --- a/frontend/src/app/components/common/comp-select.tsx +++ b/frontend/src/app/components/common/comp-select.tsx @@ -15,6 +15,7 @@ type Props = { value?: Option | null; onChange?: (selectedOption: Option | null) => void; isDisabled?: boolean; + isClearable?: boolean; }; export const CompSelect: FC = ({ @@ -30,6 +31,7 @@ export const CompSelect: FC = ({ classNamePrefix, errorMessage, isDisabled, + isClearable, }) => { let styles: StylesConfig = {}; @@ -46,6 +48,27 @@ export const CompSelect: FC = ({ ...provided, color: state.label === "None" || state.label === "Unassigned" ? "#a1a1a1" : "black", }), + //custom style for clear btn to match with DatePicker's clear btn + clearIndicator: (defaultStyles: any) => { + return { + ...defaultStyles, + background: "#216ba5", + borderRadius: "50%", + color: "#fff", + cursor: "pointer", + maxHeight: "20px", + maxWidth: "20px", + padding: "2px", + marginRight: "6px", + svg: { + width: "12px", + height: "12px", + }, + "&:hover": { + color: "#fff", + }, + }; + }, }; //-- pass through the onChange event @@ -71,6 +94,7 @@ export const CompSelect: FC = ({ isDisabled={isDisabled} menuPlacement="auto" menuPosition="fixed" + isClearable={isClearable ?? false} /> {enableValidation &&
{errorMessage}
} diff --git a/frontend/src/app/components/containers/complaints/complaint-filter.tsx b/frontend/src/app/components/containers/complaints/complaint-filter.tsx index dc99e9594..00cb9d2df 100644 --- a/frontend/src/app/components/containers/complaints/complaint-filter.tsx +++ b/frontend/src/app/components/containers/complaints/complaint-filter.tsx @@ -111,6 +111,7 @@ export const ComplaintFilter: FC = ({ type }) => { placeholder="Select" enableValidation={false} value={natureOfComplaint} + isClearable={true} /> @@ -130,6 +131,7 @@ export const ComplaintFilter: FC = ({ type }) => { placeholder="Select" enableValidation={false} value={species} + isClearable={true} /> @@ -154,6 +156,7 @@ export const ComplaintFilter: FC = ({ type }) => { placeholder="Select" enableValidation={false} value={violationType} + isClearable={true} /> @@ -237,6 +240,7 @@ export const ComplaintFilter: FC = ({ type }) => { placeholder="Select" enableValidation={false} value={status} + isClearable={true} /> @@ -267,6 +271,7 @@ export const ComplaintFilter: FC = ({ type }) => { placeholder="Select" enableValidation={false} value={region} + isClearable={true} /> @@ -287,6 +292,7 @@ export const ComplaintFilter: FC = ({ type }) => { placeholder="Select" enableValidation={false} value={zone} + isClearable={true} /> @@ -308,6 +314,7 @@ export const ComplaintFilter: FC = ({ type }) => { placeholder="Select" enableValidation={false} value={community} + isClearable={true} /> @@ -330,6 +337,7 @@ export const ComplaintFilter: FC = ({ type }) => { placeholder="Select" enableValidation={false} value={officer} + isClearable={true} /> diff --git a/frontend/src/app/components/containers/complaints/complaint-list.tsx b/frontend/src/app/components/containers/complaints/complaint-list.tsx index c36ae9793..64a52d40a 100644 --- a/frontend/src/app/components/containers/complaints/complaint-list.tsx +++ b/frontend/src/app/components/containers/complaints/complaint-list.tsx @@ -98,6 +98,7 @@ export const ComplaintList: FC = ({ type, searchQuery }) => { dispatch(getComplaints(type, payload)); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [filters, sortKey, sortDirection, page, pageSize]); useEffect(() => { @@ -107,6 +108,7 @@ export const ComplaintList: FC = ({ type, searchQuery }) => { payload = { ...payload, query: searchQuery }; dispatch(getComplaints(type, payload)); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [searchQuery]); useEffect(() => { @@ -120,6 +122,7 @@ export const ComplaintList: FC = ({ type, searchQuery }) => { return () => { dispatch(setComplaints({ type: { type }, data: [] })); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const handleSort = (sortInput: string) => { diff --git a/frontend/src/app/components/containers/complaints/details/caller-information.tsx b/frontend/src/app/components/containers/complaints/details/caller-information.tsx index d9d0d54ea..823fa7677 100644 --- a/frontend/src/app/components/containers/complaints/details/caller-information.tsx +++ b/frontend/src/app/components/containers/complaints/details/caller-information.tsx @@ -40,7 +40,7 @@ export const CallerInformation: FC = () => {
{email}
-
Reporting Organization
+
Organization Reporting the Complaint
{reportedByCode?.longDescription}
diff --git a/frontend/src/app/components/containers/complaints/details/complaint-details-create.tsx b/frontend/src/app/components/containers/complaints/details/complaint-details-create.tsx index 99b5c1729..eafbafd4c 100644 --- a/frontend/src/app/components/containers/complaints/details/complaint-details-create.tsx +++ b/frontend/src/app/components/containers/complaints/details/complaint-details-create.tsx @@ -35,7 +35,6 @@ import { ToggleError } from "../../../../common/toast"; import { ToastContainer } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; import { useNavigate } from "react-router-dom"; -import { ComplaintLocation } from "./complaint-location"; import { AttachmentsCarousel } from "../../../common/attachments-carousel"; import { COMSObject } from "../../../../types/coms/object"; import { @@ -1093,7 +1092,7 @@ export const CreateComplaint: FC = () => { className="comp-details-form-row" id="reported-pair-id" > - +
{ onSlideCountChange={handleSlideCountChange} /> - - { - - }
); diff --git a/frontend/src/app/components/containers/complaints/details/complaint-details-edit.tsx b/frontend/src/app/components/containers/complaints/details/complaint-details-edit.tsx index f6422da58..1bff4b11e 100644 --- a/frontend/src/app/components/containers/complaints/details/complaint-details-edit.tsx +++ b/frontend/src/app/components/containers/complaints/details/complaint-details-edit.tsx @@ -1078,62 +1078,6 @@ export const ComplaintDetailsEdit: FC = () => { -
- -
- handleReportedByChange(e)} - /> -
-
- - {/* Address */} -
- -
- handleAddressChange(e.target.value)} - maxLength={120} - /> -
-
- - {/* Email Address */} -
- -
- -
-
-
{ />
+ + {/* Address */} +
+ +
+ handleAddressChange(e.target.value)} + maxLength={120} + /> +
+
+ + {/* Email Address */} +
+ +
+ +
+
+ +
+ +
+ handleReportedByChange(e)} + /> +
+
{/* ERS - Subject of Complaint */} diff --git a/frontend/src/app/components/containers/complaints/headers/wildlife-complaint-list-header.tsx b/frontend/src/app/components/containers/complaints/headers/wildlife-complaint-list-header.tsx index c429b089e..88a6daae7 100644 --- a/frontend/src/app/components/containers/complaints/headers/wildlife-complaint-list-header.tsx +++ b/frontend/src/app/components/containers/complaints/headers/wildlife-complaint-list-header.tsx @@ -46,7 +46,7 @@ export const WildlifeComplaintListHeader: FC = ({ handleSort, sortKey, so diff --git a/frontend/src/app/components/mapping/leaflet-map-with-multiple-points.tsx b/frontend/src/app/components/mapping/leaflet-map-with-multiple-points.tsx index 36bc3ebe7..efa06172d 100644 --- a/frontend/src/app/components/mapping/leaflet-map-with-multiple-points.tsx +++ b/frontend/src/app/components/mapping/leaflet-map-with-multiple-points.tsx @@ -82,7 +82,7 @@ const LeafletMapWithMultiplePoints: React.FC = ({ complaintType, marke const bannerType = unmappedComplaints >= 1 ? "unmapped" : "no-results"; const info = unmappedComplaints >= 1 - ? `The exact location of ${unmappedComplaints} complaint${isPluralized} could not be determined.` + ? `${unmappedComplaints} complaint${isPluralized} could not be mapped` : "No complaints found."; return ( diff --git a/frontend/src/app/store/reducers/complaints.ts b/frontend/src/app/store/reducers/complaints.ts index b24bdbf2a..022352be2 100644 --- a/frontend/src/app/store/reducers/complaints.ts +++ b/frontend/src/app/store/reducers/complaints.ts @@ -577,11 +577,17 @@ export const selectComplaintsByType = export const selectTotalMappedComplaints = (state: RootState): number => { const { complaints: { - mappedItems: { items }, + mappedItems: { items, unmapped }, }, } = state; - return items ? items.length : 0; + if (items && unmapped) { + return items.length + unmapped; + } else if (!items && !unmapped) { + return 0; + } else { + return 0 + unmapped; + } }; export const selectTotalUnmappedComplaints = (state: RootState): number => { diff --git a/webeoc/package-lock.json b/webeoc/package-lock.json index 34233ab76..e8318cb4a 100644 --- a/webeoc/package-lock.json +++ b/webeoc/package-lock.json @@ -2796,11 +2796,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -4157,9 +4157,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" },