- updated modal window, added texts/choices by default;
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
@@ -20,23 +20,32 @@ import { InputText } from 'primereact/inputtext';
|
||||
import { Toast } from 'primereact/toast';
|
||||
|
||||
import { classificationType, protocolType } from '../../../../configData';
|
||||
import { useStore } from '../../../../store';
|
||||
|
||||
const ArchiveDocument = ({ applicationId, ndg = '', fileId = 0, docAttachmentId = null, updateFn = () => {} }) => {
|
||||
const ArchiveDocument = ({
|
||||
applicationId,
|
||||
ndg = '',
|
||||
fileId = 0,
|
||||
fileDescr = '',
|
||||
docAttachmentId = null,
|
||||
updateFn = () => {}
|
||||
}) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [isVisibleDialog, setIsVisibleDialog] = useState(false);
|
||||
const [modalData, setModalData] = useState({});
|
||||
const [types, setTypes] = useState([]);
|
||||
const [categories, setCategories] = useState([]);
|
||||
const toast = useRef(null);
|
||||
const userData = useStore().main.userData();
|
||||
|
||||
const openArchivationModal = () => {
|
||||
setIsVisibleDialog(true);
|
||||
setModalData({
|
||||
descrizione: '',
|
||||
idTipoProtocollo: 0,
|
||||
descrizione: fileDescr,
|
||||
idTipoProtocollo: 1,
|
||||
idClassificazione: 0,
|
||||
flagDaFirmare: false,
|
||||
email: '',
|
||||
email: userData.email,
|
||||
fileId
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ const ListOfFiles = ({ files, updateFn, shouldDisableFieldFn, name, ndg, applica
|
||||
<ArchiveDocument
|
||||
ndg={ndg}
|
||||
applicationId={applicationId}
|
||||
fileDescr={renderHtmlContent(o.label)}
|
||||
fileId={o.fileDetail[0].id}
|
||||
updateFn={(val) => updateFn(
|
||||
val,
|
||||
|
||||
Reference in New Issue
Block a user