diff --git a/common/src/import-export/policy-label.ts b/common/src/import-export/policy-label.ts index 83fdb4a337..3b50011002 100644 --- a/common/src/import-export/policy-label.ts +++ b/common/src/import-export/policy-label.ts @@ -243,7 +243,7 @@ export class PolicyLabelImportExport { const config: IStatisticConfig = { variables: PolicyStatisticImportExport.validateVariables(data?.variables), scores: PolicyStatisticImportExport.validateScores(data?.scores), - formulas: PolicyStatisticImportExport.validateFormulas(data?.formulas) + formulas: PolicyStatisticImportExport.validateFormulasWithRule(data?.formulas) } return config; } diff --git a/frontend/src/app/modules/statistics/policy-labels/policy-label-document-configuration/policy-label-document-configuration.component.html b/frontend/src/app/modules/statistics/policy-labels/policy-label-document-configuration/policy-label-document-configuration.component.html index b926a1151c..422c2b24db 100644 --- a/frontend/src/app/modules/statistics/policy-labels/policy-label-document-configuration/policy-label-document-configuration.component.html +++ b/frontend/src/app/modules/statistics/policy-labels/policy-label-document-configuration/policy-label-document-configuration.component.html @@ -312,6 +312,7 @@ \ No newline at end of file diff --git a/interfaces/src/validators/label-validator/item-rule-validator.ts b/interfaces/src/validators/label-validator/item-rule-validator.ts index 146a98a298..90b1dd144a 100644 --- a/interfaces/src/validators/label-validator/item-rule-validator.ts +++ b/interfaces/src/validators/label-validator/item-rule-validator.ts @@ -75,10 +75,15 @@ export class RuleItemValidator { } public updateScores() { - return; + for (const variable of this.variables) { + this.scope.setVariable(variable.id, variable.value); + } } public updateFormulas() { + for (const variable of this.variables) { + this.scope.setVariable(variable.id, variable.value); + } for (const score of this.scores) { this.scope.setVariable(score.id, score.value); } diff --git a/interfaces/src/validators/label-validator/item-statistic-validator.ts b/interfaces/src/validators/label-validator/item-statistic-validator.ts index 44f49f5dcf..fcc1e86bb0 100644 --- a/interfaces/src/validators/label-validator/item-statistic-validator.ts +++ b/interfaces/src/validators/label-validator/item-statistic-validator.ts @@ -73,10 +73,15 @@ export class StatisticItemValidator { } public updateScores() { - return; + for (const variable of this.variables) { + this.scope.setVariable(variable.id, variable.value); + } } public updateFormulas() { + for (const variable of this.variables) { + this.scope.setVariable(variable.id, variable.value); + } for (const score of this.scores) { this.scope.setVariable(score.id, score.value); }