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

Ndt 351 email notification system for analysts assigned to screening assessments #3548

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## [1.195.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.195.0...v1.195.1) (2024-10-01)

# [1.195.0](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.194.2...v1.195.0) (2024-10-01)

### Features
Expand Down
4 changes: 2 additions & 2 deletions app/backend/lib/emails/templates/assessmentAssigneeChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ const assessmentAssigneeChange: EmailTemplateProvider = async (
};
});
return {
assignors: ccbcAssignorUserList[assignor],
assignors: ccbcAssignorUserList?.[assignor] || 'A CCBC Analyst',
alerts,
};
}
);
// Get the list of assignors for the email
const assignorList = Object.keys(assignmentsByAssignor).map(
(key) => ccbcAssignorUserList[key]
(key) => ccbcAssignorUserList?.[key] || 'A CCBC Analyst'
);

return {
Expand Down
7 changes: 7 additions & 0 deletions app/components/AnalystDashboard/AssessmentAssignmentTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ const AssessmentAssignmentTable: React.FC<Props> = ({ query }) => {
application.allAssessments.edges,
'screening'
),
screeningNotification: findNotification(
application.assessmentNotifications.edges,
'assignment_screening'
),
financialRiskAssessment: findAssessment(
application.allAssessments.edges,
'financialRisk'
Expand Down Expand Up @@ -509,6 +513,7 @@ const AssessmentAssignmentTable: React.FC<Props> = ({ query }) => {

const assessmentChanged =
jsonData?.assignedTo &&
jsonData.assignedTo !== 'Unassigned' &&
jsonData.assignedTo !== notification?.jsonData?.to;

if (new Date(updatedAt) >= lastNotificationSentAt && assessmentChanged) {
Expand Down Expand Up @@ -537,10 +542,12 @@ const AssessmentAssignmentTable: React.FC<Props> = ({ query }) => {
'pm',
'projectManagement'
);
const screeningAssignment = createAssignment(application, 'screening');

if (techAssignment) assignmentsList.push(techAssignment);
if (financialAssignment) assignmentsList.push(financialAssignment);
if (pmAssignment) assignmentsList.push(pmAssignment);
if (screeningAssignment) assignmentsList.push(screeningAssignment);

return assignmentsList;
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('assessmentAssigneeChange template', () => {
},
{
applicationId: 2,
assessmentType: 'technical',
assessmentType: 'screening',
assignedTo: 'Tester 2',
assigneeEmail: 'tester2@mail.com',
ccbcNumber: 'CCBC-000002',
Expand Down Expand Up @@ -106,8 +106,8 @@ describe('assessmentAssigneeChange template', () => {
{
ccbcNumber: 'CCBC-000002',
applicationId: 2,
type: 'Technical assessment',
url: 'http://mock_host.ca/analyst/application/2/assessments/technical',
type: 'Eligibility Screening',
url: 'http://mock_host.ca/analyst/application/2/assessments/screening',
},
],
assignors: 'Assignor 2',
Expand Down
1 change: 1 addition & 0 deletions db/sqitch.plan
Original file line number Diff line number Diff line change
Expand Up @@ -691,3 +691,4 @@ computed_columns/cbc_history 2024-09-03T15:16:07Z Anthony Bushara <anthony@butto
@1.194.1 2024-10-01T17:34:06Z CCBC Service Account <ccbc@button.is> # release v1.194.1
@1.194.2 2024-10-01T17:35:28Z CCBC Service Account <ccbc@button.is> # release v1.194.2
@1.195.0 2024-10-01T18:17:16Z CCBC Service Account <ccbc@button.is> # release v1.195.0
@1.195.1 2024-10-01T19:32:15Z CCBC Service Account <ccbc@button.is> # release v1.195.1
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CONN-CCBC-portal",
"version": "1.195.0",
"version": "1.195.1",
"main": "index.js",
"repository": "https://github.com/bcgov/CONN-CCBC-portal.git",
"author": "Romer, Meherzad CITZ:EX <Meherzad.Romer@gov.bc.ca>",
Expand Down
Loading