- added preview of application for beneficiary;

- added isRequestedAmount setting;
This commit is contained in:
Vitalii Kiiko
2025-01-02 12:34:07 +01:00
parent be4ab1e1bd
commit 63cb275ae9
9 changed files with 49 additions and 46 deletions

View File

@@ -5,7 +5,7 @@ import { klona } from 'klona';
import { wrap } from 'object-path-immutable';
// store
import { storeSet, useStore } from '../../../../store';
import { storeGet, storeSet, useStore } from '../../../../store';
// components
import { InputText } from 'primereact/inputtext';
@@ -128,10 +128,20 @@ const BuilderElementSettings = ({ closeSettingsFn, bandoStatus }) => {
useEffect(() => {
const chosen = head(elements.filter(o => o.id === activeElement));
const elementItems = storeGet.main.elementItems();
const chosenElementItemCfg = head(elementItems.filter(o => o.name === chosen.name));
let settings = [];
if (chosenElementItemCfg) {
settings = chosenElementItemCfg.settings.map((o) => {
const setting = head(chosen.settings.filter(s => s.name === o.name));
return setting ? klona(setting) : klona(o)
});
}
if (chosen) {
setActiveElementData(klona(chosen));
setSettings(klona(chosen.settings));
setSettings(settings);
setValidators(klona(chosen.validators));
setDynamicData(chosen.dynamicData ? chosen.dynamicData : '');
setCriteria(chosen.criteria ? chosen.criteria : []);