Skip to content

Commit

Permalink
Merge pull request #427 from EyeSeeTea/development
Browse files Browse the repository at this point in the history
Release 1.0.2
  • Loading branch information
adrianq authored Feb 22, 2022
2 parents 2652ffa + 7ff9485 commit 6cd996f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
9 changes: 7 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down Expand Up @@ -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}}"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": ".",
Expand Down
27 changes: 16 additions & 11 deletions src/models/validators/RecurringValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
formatPeriod,
isSuperset,
getDataValueFromD2,
ValidationLevel,
} from "./validator-common";
import { Config } from "../Config";
import { Maybe } from "../../types/utils";
Expand Down Expand Up @@ -232,16 +231,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)",
Expand Down

0 comments on commit 6cd996f

Please sign in to comment.