From 19f81433d75a6ffcaeb17a6213d7fe4d4ba5c020 Mon Sep 17 00:00:00 2001 From: Arnau Sanchez Date: Wed, 9 Feb 2022 09:31:20 +0100 Subject: [PATCH 1/3] Change message for recurring validator warning message --- i18n/en.pot | 9 +++++-- src/models/validators/RecurringValidator.ts | 26 +++++++++++++-------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index f060e2d8..759b5f3d 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2021-12-22T11:38:47.808Z\n" -"PO-Revision-Date: 2021-12-22T11:38:47.808Z\n" +"POT-Creation-Date: 2022-02-09T08:29:12.478Z\n" +"PO-Revision-Date: 2022-02-09T08:29:12.478Z\n" msgid "Name" msgstr "" @@ -627,6 +627,11 @@ msgstr "" msgid "Global indicator with sub-indicators values cannot be empty: {{- name}}" msgstr "" +msgid "" +"Returning value ({{returningFormula}}) is greater than the sum of New " +"values for past periods: {{pastFormula}}" +msgstr "" + msgid "" "Returning value ({{returningFormula}}) cannot be greater than the sum of " "New values for past periods: {{pastFormula}}" diff --git a/src/models/validators/RecurringValidator.ts b/src/models/validators/RecurringValidator.ts index 150f4f91..becab76d 100644 --- a/src/models/validators/RecurringValidator.ts +++ b/src/models/validators/RecurringValidator.ts @@ -232,16 +232,22 @@ export class RecurringValidator { if (isValid) { return []; } else if (this.data.allProjectsInPlatform) { - const msg = i18n.t( - "Returning value ({{returningFormula}}) cannot be greater than the sum of New values for past periods: {{pastFormula}}", - { - returningFormula: returningAggr.formula, - pastFormula: newAggr.formula, - nsSeparator: false, - } - ); - const validationLevel: ValidationLevel = dataSetType === "target" ? "warning" : "error"; - return [[validationLevel, msg]]; + const returningFormula = returningAggr.formula; + const pastFormula = newAggr.formula; + + if (dataSetType === "target") { + const msg = i18n.t( + "Returning value ({{returningFormula}}) is greater than the sum of New values for past periods: {{pastFormula}}", + { nsSeparator: false, returningFormula, pastFormula } + ); + return [["warning", msg]]; + } else { + const msg = i18n.t( + "Returning value ({{returningFormula}}) cannot be greater than the sum of New values for past periods: {{pastFormula}}", + { nsSeparator: false, returningFormula, pastFormula } + ); + return [["error", msg]]; + } } else { const msg = i18n.t( "Returning value ({{returningFormula}}) is greater than the sum of New values for past periods in projects stored in Platform: {{pastFormula}} (there is no {{missingProjects}} version(s) of this project)", From 27f06f4a59ad4b54e626dc9c42d27c598e87c89a Mon Sep 17 00:00:00 2001 From: Arnau Sanchez Date: Wed, 9 Feb 2022 14:19:48 +0100 Subject: [PATCH 2/3] Fix lint warning for ValidationLevel --- src/models/validators/RecurringValidator.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/models/validators/RecurringValidator.ts b/src/models/validators/RecurringValidator.ts index becab76d..056757b7 100644 --- a/src/models/validators/RecurringValidator.ts +++ b/src/models/validators/RecurringValidator.ts @@ -14,7 +14,6 @@ import { formatPeriod, isSuperset, getDataValueFromD2, - ValidationLevel, } from "./validator-common"; import { Config } from "../Config"; import { Maybe } from "../../types/utils"; From 30c810f9c178f317943e40d378b056336ff99a20 Mon Sep 17 00:00:00 2001 From: Adrian Quintana Date: Fri, 11 Feb 2022 09:26:40 +0000 Subject: [PATCH 3/3] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc5642f0..45ab6e62 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "data-management-app", "description": "DHIS2 Data Management App", - "version": "1.0.1", + "version": "1.0.2", "license": "GPL-3.0", "author": "EyeSeeTea team", "homepage": ".",