- added preview of application for beneficiary;
- added isRequestedAmount setting;
This commit is contained in:
@@ -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 : []);
|
||||
|
||||
Reference in New Issue
Block a user