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-1014 update web eoc filter to include complaints with a violation type of waste or pesticide in any region #649

Open
wants to merge 39 commits into
base: release/orca
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
39 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
ed9bedc
Loosen webeoc filter
barrfalk Sep 19, 2024
a0a36dc
Update webeoc-scheduler.service.ts
barrfalk Sep 19, 2024
aa65e16
Merge branch 'release/orca' into CE-1014-Update-WebEOC-Filter-to-incl…
barrfalk Sep 19, 2024
8d89731
Added actions taken filter to include waste and pesticide
barrfalk Sep 20, 2024
f51cab2
Updated filtering for complaint updates
barrfalk Sep 20, 2024
3c9380d
Update webeoc-scheduler.service.ts
barrfalk Sep 20, 2024
fc7ffc6
Removed duplication
barrfalk Sep 20, 2024
1e7dc45
Update R__update-insert-complaint-from-staging.sql
barrfalk Sep 20, 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
1 change: 1 addition & 0 deletions webeoc/src/types/complaint-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ export interface Complaint {
back_number_of_days: string;
back_number_of_hours: string;
back_number_of_minutes: string;
flag_COS: string;
}
31 changes: 22 additions & 9 deletions webeoc/src/webeoc-scheduler/webeoc-scheduler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,36 @@ export class WebEocScheduler {
},
};

// default filter grabs complaints that are newer than a specific date
const filterItems = [dateFilter];

// construct the body of the request
const body = {
customFilter: {
boolean: "and",
items: [
dateFilter,
{
fieldname: flagName,
operator: "Equals",
fieldvalue: "Yes",
},
],
items: filterItems,
},
};

try {
const response = await axios.post(url, body, config);
return response.data as Complaint[];
const complaints = response.data as Complaint[];
let filteredComplaints: Complaint[];
if (flagName === WEBEOC_FLAGS.COMPLAINTS) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is incorrect. It will only work for complaints but not Updates, Actions Taken or Updates to Actions Taken.

As a result Complaints are being filtered properly but all other messages are going through regardless of if the flag is set or not. E.g. if I create an update for a complaint in Victoria, the complaint is properly filtered out but the update is staged (and promptly errors because it can't find the complaint)

// if we're looking for complaints, only get
// complaints that have flag_COS (to indicate that we want the complaints in the Peace region),
// or complaints that have a violation type of Waste or Pesticide (for CEEB complaints, even those
// outside the Peace region)
filteredComplaints = complaints.filter(
(complaint) =>
complaint.flag_COS === "Yes" ||
complaint.violation_type === "Waste" ||
complaint.violation_type === "Pesticide",
);
return filteredComplaints;
} else {
return complaints;
}
} catch (error) {
this.logger.error(`Error fetching data from WebEOC at ${urlPath}:`, error);
throw error;
Expand Down
Loading