- updated modal window, added texts/choices by default;
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
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 { __, sprintf } from '@wordpress/i18n';
|
||||||
import { klona } from 'klona';
|
import { klona } from 'klona';
|
||||||
import { wrap } from 'object-path-immutable';
|
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(['dynamicData'], dynamicData).value();
|
||||||
newActiveElementData = wrap(newActiveElementData).set(['criteria'], criteria).value();
|
newActiveElementData = wrap(newActiveElementData).set(['criteria'], criteria).value();
|
||||||
const newElements = elements.map(o => o.id === newActiveElementData.id ? newActiveElementData : o);
|
const newElements = elements.map(o => o.id === newActiveElementData.id ? newActiveElementData : o);
|
||||||
|
|
||||||
storeSet.main.formElements(newElements);
|
storeSet.main.formElements(newElements);
|
||||||
closeSettingsFn();
|
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)
|
? !['isRequestedAmount', 'isDelegation', ''].includes(o.name)
|
||||||
: !['isChecklistItem'].includes(o.name));
|
: !['isChecklistItem'].includes(o.name));
|
||||||
|
|
||||||
|
|||||||
@@ -20,23 +20,32 @@ import { InputText } from 'primereact/inputtext';
|
|||||||
import { Toast } from 'primereact/toast';
|
import { Toast } from 'primereact/toast';
|
||||||
|
|
||||||
import { classificationType, protocolType } from '../../../../configData';
|
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 [loading, setLoading] = useState(false);
|
||||||
const [isVisibleDialog, setIsVisibleDialog] = useState(false);
|
const [isVisibleDialog, setIsVisibleDialog] = useState(false);
|
||||||
const [modalData, setModalData] = useState({});
|
const [modalData, setModalData] = useState({});
|
||||||
const [types, setTypes] = useState([]);
|
const [types, setTypes] = useState([]);
|
||||||
const [categories, setCategories] = useState([]);
|
const [categories, setCategories] = useState([]);
|
||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
|
const userData = useStore().main.userData();
|
||||||
|
|
||||||
const openArchivationModal = () => {
|
const openArchivationModal = () => {
|
||||||
setIsVisibleDialog(true);
|
setIsVisibleDialog(true);
|
||||||
setModalData({
|
setModalData({
|
||||||
descrizione: '',
|
descrizione: fileDescr,
|
||||||
idTipoProtocollo: 0,
|
idTipoProtocollo: 1,
|
||||||
idClassificazione: 0,
|
idClassificazione: 0,
|
||||||
flagDaFirmare: false,
|
flagDaFirmare: false,
|
||||||
email: '',
|
email: userData.email,
|
||||||
fileId
|
fileId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ const ListOfFiles = ({ files, updateFn, shouldDisableFieldFn, name, ndg, applica
|
|||||||
<ArchiveDocument
|
<ArchiveDocument
|
||||||
ndg={ndg}
|
ndg={ndg}
|
||||||
applicationId={applicationId}
|
applicationId={applicationId}
|
||||||
|
fileDescr={renderHtmlContent(o.label)}
|
||||||
fileId={o.fileDetail[0].id}
|
fileId={o.fileDetail[0].id}
|
||||||
updateFn={(val) => updateFn(
|
updateFn={(val) => updateFn(
|
||||||
val,
|
val,
|
||||||
|
|||||||
Reference in New Issue
Block a user