- updated zustand and react libraries;

- added 'put in draft' btn;
This commit is contained in:
Vitalii Kiiko
2025-04-10 12:36:19 +02:00
parent 44ba9036cb
commit 7dcf932819
90 changed files with 677 additions and 587 deletions

View File

@@ -5,7 +5,7 @@ import { klona } from 'klona';
import { wrap } from 'object-path-immutable';
// store
import { storeGet, storeSet, useStore } from '../../../../store';
import { storeGet, storeSet, useStoreValue } from '../../../../store';
// components
import { InputText } from 'primereact/inputtext';
@@ -20,9 +20,9 @@ import { MultiSelect } from 'primereact/multiselect';
import { dynamicDataOptions } from '../../../../configData';
const BuilderElementSettings = ({ closeSettingsFn, callStatus, context }) => {
const elements = useStore().main.formElements();
const activeElement = useStore().main.activeElement();
const criteriaOptions = useStore().main.bandoCriteria();
const elements = useStoreValue('formElements');
const activeElement = useStoreValue('activeElement');
const criteriaOptions = useStoreValue('bandoCriteria');
const [activeElementData, setActiveElementData] = useState({});
const [settings, setSettings] = useState([]);
const [validators, setValidators] = useState({});
@@ -77,7 +77,7 @@ const BuilderElementSettings = ({ closeSettingsFn, callStatus, context }) => {
newActiveElementData = wrap(newActiveElementData).set(['criteria'], criteria).value();
const newElements = elements.map(o => o.id === newActiveElementData.id ? newActiveElementData : o);
storeSet.main.formElements(newElements);
storeSet('formElements', newElements);
closeSettingsFn();
}
@@ -113,7 +113,7 @@ const BuilderElementSettings = ({ closeSettingsFn, callStatus, context }) => {
useEffect(() => {
const chosen = head(elements.filter(o => o.id === activeElement));
const elementItems = storeGet.main.elementItems();
const elementItems = storeGet('elementItems');
const chosenElementItemCfg = head(elementItems.filter(o => o.name === chosen.name));
let settings = [];