From 79af3184e93a75790ca7b45690efcd78a41139d9 Mon Sep 17 00:00:00 2001 From: Matt Kingston Date: Fri, 10 Dec 2021 13:48:02 +0000 Subject: [PATCH] Use correct sign when comparing balance (#77) * Don't display 0 when there are no settlement finalization report warnings * Display a tick for a validated report * Reset validation results when selecting a different report * Use correct sign when comparing balance and improve message to user --- helm/finance-portal-v2-ui/Chart.yaml | 4 +- helm/finance-portal-v2-ui/values.yaml | 2 +- package.json | 2 +- .../SettlementFinalizingModal/connectors.ts | 6 ++- .../SettlementFinalizingModal/index.tsx | 37 ++++++++++--------- src/App/Settlements/helpers.ts | 12 +++--- 6 files changed, 35 insertions(+), 28 deletions(-) diff --git a/helm/finance-portal-v2-ui/Chart.yaml b/helm/finance-portal-v2-ui/Chart.yaml index e3b363e3..8f37ffed 100644 --- a/helm/finance-portal-v2-ui/Chart.yaml +++ b/helm/finance-portal-v2-ui/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "v3.0.0" +appVersion: "v3.0.1" description: Mojaloop Finance Portal UI v2 name: finance-portal-v2-ui -version: 3.0.0 +version: 3.0.1 diff --git a/helm/finance-portal-v2-ui/values.yaml b/helm/finance-portal-v2-ui/values.yaml index 2b8f87bb..5ba68023 100644 --- a/helm/finance-portal-v2-ui/values.yaml +++ b/helm/finance-portal-v2-ui/values.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: repository: ghcr.io/mojaloop/finance-portal-v2-ui - tag: v3.0.0 + tag: v3.0.1 pullPolicy: IfNotPresent imagePullCredentials: diff --git a/package.json b/package.json index e345822a..11dbe1f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "finance-portal-v2-ui", - "version": "3.0.0", + "version": "3.0.1", "description": "", "main": "index.js", "scripts": { diff --git a/src/App/Settlements/SettlementFinalizingModal/connectors.ts b/src/App/Settlements/SettlementFinalizingModal/connectors.ts index 81110159..b8065f9b 100644 --- a/src/App/Settlements/SettlementFinalizingModal/connectors.ts +++ b/src/App/Settlements/SettlementFinalizingModal/connectors.ts @@ -45,7 +45,11 @@ const dispatchProps = (dispatch: Dispatch) => ({ dispatch(actions.setSettlementFinalizingInProgress(true)); dispatch(actions.finalizeSettlement(settlement)); }, - onSelectSettlementReport: (report: SettlementReport) => dispatch(actions.setSettlementReport(report || null)), + onSelectSettlementReport: (report: SettlementReport) => { + dispatch(actions.setSettlementReportValidationErrors(null)); + dispatch(actions.setSettlementReportValidationWarnings(null)); + dispatch(actions.setSettlementReport(report || null)); + }, onSettlementReportProcessingError: (err: string) => dispatch(actions.setSettlementReportError(err)), onSetFundsInOutChange: (e: React.ChangeEvent) => { dispatch(actions.setFinalizeProcessFundsInOut(e.target.checked)); diff --git a/src/App/Settlements/SettlementFinalizingModal/index.tsx b/src/App/Settlements/SettlementFinalizingModal/index.tsx index 5ca63909..ca1b7d3c 100644 --- a/src/App/Settlements/SettlementFinalizingModal/index.tsx +++ b/src/App/Settlements/SettlementFinalizingModal/index.tsx @@ -268,6 +268,7 @@ const SettlementFinalizingModal: FC = ({ } }} /> + {settlementReportValidationErrors?.length === 0 ? <> ✅ : <>}