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

Add dashboard alert for credit transfer "Rejected by Transfer Partner" #496

Merged
merged 6 commits into from
Jan 11, 2021
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
4 changes: 4 additions & 0 deletions frontend/src/dashboard/DashboardContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const DashboardContainer = (props) => {
transfersAwaitingDirector: 0,
transfersAwaitingAnalyst: 0,
transfersRecorded: 0,
transfersRejectedByPartner: 0,
transfersRejected: 0,
});

Expand Down Expand Up @@ -120,13 +121,16 @@ const DashboardContainer = (props) => {
.filter((submission) => submission.status === 'VALIDATED');
const transfersRejected = transfersResponse.data
.filter((submission) => submission.status === 'REJECTED');
const transfersRejectedByTransferPartner = transfersResponse.data
.filter((submission) => submission.status === 'DISAPPROVED');

activityCount = {
...activityCount,
transfersAwaitingPartner: transfersAwaitingPartner.length,
transfersAwaitingGovernment: transfersAwaitingGovernment.length,
transfersRecorded: transfersRecorded.length,
transfersRejected: transfersRejected.length,
transfersRejectedByPartner: transfersRejectedByTransferPartner.length,
};
} else {
const transfersAwaitingPartner = transfersResponse.data
Expand Down
14 changes: 13 additions & 1 deletion frontend/src/dashboard/components/ActionsBceid.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@ const ActionsBceid = (props) => {
/>
)}
{CONFIG.FEATURES.CREDIT_TRANSFERS.ENABLED
&& activityCount.transfersRejectedByPartner > 0
&& user.hasPermission('VIEW_CREDIT_TRANSFERS')
&& (
<ActivityBanner
colour="red"
icon="exchange-alt"
boldText="Credit Transfer"
regularText={`${activityCount.transfersRejectedByPartner} rejected by Transfer Partner`}
linkTo={`${ROUTES_CREDIT_TRANSFERS.LIST}?status=Rejected By Transfer Partner`}
/>
)}
{CONFIG.FEATURES.CREDIT_TRANSFERS.ENABLED
&& activityCount.transfersRejected > 0
&& user.hasPermission('VIEW_CREDIT_TRANSFERS')
&& (
Expand All @@ -181,7 +193,7 @@ const ActionsBceid = (props) => {
icon="exchange-alt"
boldText="Credit Transfer"
regularText={`${activityCount.transfersRejected} rejected by Government of B.C.`}
linkTo={`${ROUTES_CREDIT_TRANSFERS.LIST}?status=Rejected`}
linkTo={`${ROUTES_CREDIT_TRANSFERS.LIST}?status=Rejected By Government`}
/>
)}
</div>
Expand Down