- updated modal window, added texts/choices by default;

This commit is contained in:
Vitalii Kiiko
2025-03-25 16:03:09 +01:00
parent a4d66127cf
commit 6cba18da06
3 changed files with 17 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { head, isEmpty, isNil } from 'ramda';
import { head, isEmpty, isNil, uniq } from 'ramda';
import { __, sprintf } from '@wordpress/i18n';
import { klona } from 'klona';
import { wrap } from 'object-path-immutable';
@@ -76,6 +76,7 @@ const BuilderElementSettings = ({ closeSettingsFn, callStatus, context }) => {
newActiveElementData = wrap(newActiveElementData).set(['dynamicData'], dynamicData).value();
newActiveElementData = wrap(newActiveElementData).set(['criteria'], criteria).value();
const newElements = elements.map(o => o.id === newActiveElementData.id ? newActiveElementData : o);
storeSet.main.formElements(newElements);
closeSettingsFn();
}
@@ -123,7 +124,7 @@ const BuilderElementSettings = ({ closeSettingsFn, callStatus, context }) => {
});
}
settings = settings.filter(o => context === 'call'
settings = uniq([...settings, ...chosen.settings]).filter(o => context === 'call'
? !['isRequestedAmount', 'isDelegation', ''].includes(o.name)
: !['isChecklistItem'].includes(o.name));