From 6cba18da06c86d3ca10791715278d2671d7ecbeb Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Tue, 25 Mar 2025 16:03:09 +0100 Subject: [PATCH 1/2] - updated modal window, added texts/choices by default; --- .../components/BuilderElementSettings/index.js | 5 +++-- .../components/ArchiveDocument/index.js | 17 +++++++++++++---- .../components/ListOfFiles/index.js | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js b/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js index d7fc321..3a787ae 100644 --- a/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js +++ b/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js @@ -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)); diff --git a/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js b/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js index 0660dba..d69bd38 100644 --- a/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js +++ b/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js @@ -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 }); } diff --git a/src/pages/DomandaEditPreInstructor/components/ListOfFiles/index.js b/src/pages/DomandaEditPreInstructor/components/ListOfFiles/index.js index 992619d..2127fbe 100644 --- a/src/pages/DomandaEditPreInstructor/components/ListOfFiles/index.js +++ b/src/pages/DomandaEditPreInstructor/components/ListOfFiles/index.js @@ -25,6 +25,7 @@ const ListOfFiles = ({ files, updateFn, shouldDisableFieldFn, name, ndg, applica updateFn( val, From 4a491b1329a879d515f61488cfe3328cff7cb496 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Tue, 25 Mar 2025 16:13:45 +0100 Subject: [PATCH 2/2] - added search for dropdown; --- .../DomandaEditPreInstructor/components/ArchiveDocument/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js b/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js index d69bd38..ee6a352 100644 --- a/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js +++ b/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js @@ -174,6 +174,7 @@ const ArchiveDocument = ({ {__('Classificazione', 'gepafin')}* setValue('idClassificazione', e.value)}