Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Stepan Kiryakov <[email protected]>
  • Loading branch information
Stepan-Kirjakov committed Dec 18, 2024
1 parent c79e0c4 commit 63df3fa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/src/import-export/policy-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@
<button
*ngIf="!validator.isNext()"
(click)="onSubmit()"
[disabled]="!result?.valid"
class="guardian-button guardian-button-primary">Publish</button>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 63df3fa

Please sign in to comment.