@eqproject/eqp-dynamic-module 2.9.17 → 2.9.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/private/field-templates/action-button-field-template/action-button-field-template.component.mjs +11 -12
- package/fesm2015/eqproject-eqp-dynamic-module.mjs +10 -11
- package/fesm2015/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/fesm2020/eqproject-eqp-dynamic-module.mjs +10 -11
- package/fesm2020/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -5621,26 +5621,25 @@ class ActionButtonFieldTemplateComponent {
|
|
|
5621
5621
|
this.evaluateFormulasAndFireTrigger(fireTrigger);
|
|
5622
5622
|
}
|
|
5623
5623
|
evaluateFormulasAndFireTrigger(triggerToFire) {
|
|
5624
|
-
|
|
5625
|
-
|
|
5624
|
+
const formulas = JSON.parse(JSON.stringify(triggerToFire.formulas));
|
|
5625
|
+
const evaluatedFormulas = {}; // Oggetto associativo
|
|
5626
5626
|
GlobalService.debugLog("checkTriggers - evaluate formulas ", formulas);
|
|
5627
|
-
if (formulas
|
|
5627
|
+
if (formulas && Object.keys(formulas).length > 0) {
|
|
5628
5628
|
Object.keys(formulas).forEach((key) => {
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5629
|
+
const formulaObj = formulas[key];
|
|
5630
|
+
const formula = formulaObj.value;
|
|
5631
|
+
let temp;
|
|
5632
|
+
GlobalService.debugLog("checkTriggers - formulas[key] ", formulaObj);
|
|
5633
|
+
if (formulaObj.type === TriggerPropertyTypeEnum.DMMODULE) {
|
|
5633
5634
|
temp = formula;
|
|
5634
5635
|
}
|
|
5635
5636
|
else {
|
|
5636
5637
|
temp = UtilityHelperService.EvaluateFieldFormula(formula, this.record, null);
|
|
5637
5638
|
}
|
|
5638
|
-
|
|
5639
|
+
evaluatedFormulas[formulaObj.key] = temp;
|
|
5639
5640
|
});
|
|
5640
5641
|
}
|
|
5641
|
-
|
|
5642
|
-
triggerToFire.formulas = formulas;
|
|
5643
|
-
// Sparo il trigger all'esterno
|
|
5642
|
+
triggerToFire.formulas = evaluatedFormulas;
|
|
5644
5643
|
this.fireTrigger.emit(triggerToFire);
|
|
5645
5644
|
}
|
|
5646
5645
|
}
|