- added updating status for initiating evaluation process;

- fixed issues with displaying and calcuating decimals in appl form;
This commit is contained in:
Vitalii Kiiko
2025-01-29 11:00:55 +01:00
parent 2187e4a36d
commit 457194812b
15 changed files with 449 additions and 51 deletions

View File

@@ -19,6 +19,8 @@ const BuilderElement = ({ id, name, label, index, bandoStatus }) => {
const element = head(elements.filter(o => o.id === id));
const [isVariable, setIsVariable] = useState('secondary');
const [isFormula, setIsFormula] = useState('secondary');
const [isRequestedAmount, setIsRequestedAmount] = useState(false);
const [isDelegation, setIsDelegation] = useState(false);
const [{ handlerId }, drop] = useDrop({
accept: ItemTypes.FIELD,
@@ -105,6 +107,8 @@ const BuilderElement = ({ id, name, label, index, bandoStatus }) => {
useEffect(() => {
const variable = head(element.settings.filter(o => o.name === 'variable'));
const formula = head(element.settings.filter(o => o.name === 'formula'));
const isRequestedAmount = head(element.settings.filter(o => o.name === 'isRequestedAmount'));
const isDelegation = head(element.settings.filter(o => o.name === 'isDelegation'));
if (variable && !isEmpty(variable.value)) {
setIsVariable('warning');
@@ -113,6 +117,14 @@ const BuilderElement = ({ id, name, label, index, bandoStatus }) => {
if (formula && !isEmpty(formula.value)) {
setIsFormula('warning');
}
if (isRequestedAmount && !isEmpty(isRequestedAmount.value) && isRequestedAmount.value) {
setIsRequestedAmount('tertiary');
}
if (isDelegation && !isEmpty(isDelegation.value) && isDelegation.value) {
setIsDelegation('tertiary');
}
}, [elements]);
return (
@@ -128,6 +140,10 @@ const BuilderElement = ({ id, name, label, index, bandoStatus }) => {
? <Tag value="var" severity={isVariable}/> : null}
{name === 'numberinput'
? <Tag value="f(x)" severity={isFormula}/> : null}
{isRequestedAmount
? <Tag value="importo" severity={isRequestedAmount}/> : null}
{isDelegation
? <Tag value="delega" severity={isDelegation}/> : null}
</div>
<BuilderElementProperLabel id={id} defaultLabel={label}/>
</div>