diff --git a/package.json b/package.json index 85e27d0..9baab70 100644 --- a/package.json +++ b/package.json @@ -4,52 +4,51 @@ "private": true, "dependencies": { "@babel/plugin-proposal-private-property-in-object": "7.21.11", - "@babel/preset-react": "7.24.7", - "@date-fns/tz": "1.1.2", - "@emailjs/browser": "^4.4.1", - "@emotion/styled": "11.13.0", - "@number-flow/react": "0.2.0", + "@babel/preset-react": "7.25.9", + "@date-fns/tz": "1.2.0", + "@emailjs/browser": "4.4.1", + "@emotion/styled": "11.13.5", + "@number-flow/react": "0.4.1", "@sentry/browser": "^8.41.0", "@tanstack/react-table": "^8.20.5", - "@wordpress/i18n": "5.8.0", - "@wordpress/react-i18n": "4.8.0", - "@xyflow/react": "12.3.1", + "@wordpress/i18n": "5.13.0", + "@wordpress/react-i18n": "4.13.0", "codice-fiscale-js": "2.3.22", - "copy-to-clipboard": "^3.3.3", - "deep-object-diff": "^1.1.9", - "dompurify": "3.1.7", + "copy-to-clipboard": "3.3.3", + "deep-object-diff": "1.1.9", + "dompurify": "3.2.2", "fast-deep-equal": "3.1.3", - "hotkeys-js": "^3.13.7", - "html-react-parser": "5.1.16", + "hotkeys-js": "3.13.7", + "html-react-parser": "5.1.18", "jwt-decode": "4.0.0", "klona": "2.0.6", - "leader-line": "^1.0.7", + "leader-line": "1.0.7", "luxon": "3.5.0", "object-path-immutable": "4.1.2", "primeicons": "7.0.0", - "primereact": "10.8.4", - "quill": "2.0.2", + "primereact": "10.8.5", + "quill": "2.0.3", "ramda": "0.30.1", "react": "18.3.1", "react-dnd": "16.0.1", "react-dnd-html5-backend": "16.0.1", "react-dom": "18.3.1", - "react-hook-form": "7.53.0", - "react-router-dom": "6.26.2", + "react-hook-form": "7.53.2", + "react-router-dom": "7.0.1", "react-scripts": "5.0.1", "validate.js": "0.13.1", "zustand": "4.5.4", "zustand-x": "3.0.4" }, "devDependencies": { - "@babel/cli": "7.25.6", - "@babel/core": "7.25.2", - "@babel/plugin-syntax-jsx": "7.24.7", - "@wordpress/babel-plugin-makepot": "6.8.0", + "@babel/cli": "7.25.9", + "@babel/core": "7.26.0", + "@babel/plugin-syntax-jsx": "7.25.9", + "@wordpress/babel-plugin-makepot": "6.13.0", "babel-plugin-macros": "3.1.0", - "node-wp-i18n": "^1.2.7", - "sass": "1.79.3", - "sass-loader": "16.0.2" + "node-wp-i18n": "1.2.7", + "sass": "1.81.0", + "sass-loader": "16.0.3" }, "scripts": { "start": "GENERATE_SOURCEMAP=false react-scripts start", diff --git a/src/assets/scss/components/flowBuilder.scss b/src/assets/scss/components/flowBuilder.scss index a4456ec..98c6d03 100644 --- a/src/assets/scss/components/flowBuilder.scss +++ b/src/assets/scss/components/flowBuilder.scss @@ -51,9 +51,36 @@ .flowContainer__flowItem { display: flex; flex-direction: column; - gap: 20px; + width: 100%; + max-width: 280px; + padding: 15px; + border: 1px solid var(--panel-content-borderColor); +} + +.flowContainer__flowItemInner { + display: flex; + flex-direction: column; + gap: 10px; width: 100%; max-width: 250px; - padding: 7px; - border: 1px solid var(--table-border-color); + border: 1px solid var(--panel-content-borderColor); + + label { + display: flex; + justify-content: center; + padding: 10px 0 5px; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 18px; + } + + &.initialForm, &.finalForm { + border-color: var(--card-full-background-color-3); + background-color: var(--card-full-background-color-3); + + label { + color: white; + } + } } \ No newline at end of file diff --git a/src/assets/scss/theme.scss b/src/assets/scss/theme.scss index 2bd1bad..42d7cfb 100644 --- a/src/assets/scss/theme.scss +++ b/src/assets/scss/theme.scss @@ -21,6 +21,7 @@ --message-warning-color: #cc8925; --message-info-background: rgba(183, 183, 183, 0.7); --message-info-color: #3B82F6; + --panel-content-borderColor: #E5E7EB; --card-full-background-color-2: #EEC137; --card-full-background-color-3: #FA8E42; diff --git a/src/components/FlowBuilder/index.js b/src/components/FlowBuilder/index.js index fdb2d7f..3bf66de 100644 --- a/src/components/FlowBuilder/index.js +++ b/src/components/FlowBuilder/index.js @@ -8,7 +8,7 @@ import { isEmpty } from 'ramda'; import '@xyflow/react/dist/style.css'; // store -import { useStore, storeSet, storeGet } from '../../store'; +import { useStore, storeSet } from '../../store'; // nodes import NodeInitialForm from './components/NodeInitialForm'; diff --git a/src/components/FormField/components/DatepickerRange/index.js b/src/components/FormField/components/DatepickerRange/index.js index 00d5394..5c9fa75 100644 --- a/src/components/FormField/components/DatepickerRange/index.js +++ b/src/components/FormField/components/DatepickerRange/index.js @@ -1,6 +1,6 @@ import React from 'react'; import { classNames } from 'primereact/utils'; -import { isEmpty, isNil } from 'ramda'; +import { isNil } from 'ramda'; // components import { Controller } from 'react-hook-form'; diff --git a/src/pages/BandoApplicationPreview/index.js b/src/pages/BandoApplicationPreview/index.js index 74b79d4..1fc5493 100644 --- a/src/pages/BandoApplicationPreview/index.js +++ b/src/pages/BandoApplicationPreview/index.js @@ -39,7 +39,7 @@ const BandoApplicationPreview = () => { const [formData, setFormData] = useState([]); const [formInitialData, setFormInitialData] = useState(null); const [bandoTitle, setBandoTitle] = useState(''); - const [bandoId, setBandoId] = useState(0); + const [, setBandoId] = useState(0); const [formId, setFormId] = useState(''); const [totalSteps, setTotalSteps] = useState(0); const [applicationStatus, setApplicationStatus] = useState(''); diff --git a/src/pages/BandoFlowEdit/index.js b/src/pages/BandoFlowEdit/index.js index 5efc13a..f730bab 100644 --- a/src/pages/BandoFlowEdit/index.js +++ b/src/pages/BandoFlowEdit/index.js @@ -15,7 +15,6 @@ import set404FromErrorResponse from '../../helpers/set404FromErrorResponse'; // components import { Button } from 'primereact/button'; import { Dropdown } from 'primereact/dropdown'; -import FlowBuilder from '../../components/FlowBuilder'; import { Messages } from 'primereact/messages'; import FlowService from '../../service/flow-service'; import { confirmPopup, ConfirmPopup } from 'primereact/confirmpopup'; @@ -223,6 +222,10 @@ const BandoFlowEdit = () => { const initialFormObj = head(flowForms.filter(o => String(o.id) === String(initialForm))); let finalFormObj = null; + if (!initialFormObj) { + return; + } + const relevantFields = initialFormObj ? initialFormObj.content .filter(o => ['radio', 'select'].includes(o.name)) @@ -323,60 +326,6 @@ const BandoFlowEdit = () => {
-
- {forms.length >= 2 && isFlowAllowed - ?
-
-
- - updateInitialForm(e.value)} - optionDisabled={(opt) => finalForm === opt.value || isEmpty(opt.value)} - options={formOptions} - optionLabel="label" - optionValue="value" - placeholder={__('Scegli il form', 'gepafin')}/> - {initialForm && forms.length > 2 && mainFieldOptions - ?
- - setMainField(e.value)} - optionDisabled={(opt) => isEmpty(opt.value)} - options={mainFieldOptions} - optionLabel="label" - optionValue="value" - placeholder={__('Scegli il campo', 'gepafin')}/> -
: null} -
-
- - {forms.length >= 2 && initialForm - ?
-
- - setFinalForm(e.value)} - optionDisabled={(opt) => initialForm === opt.value || isEmpty(opt.value)} - options={formOptions} - optionLabel="label" - optionValue="value" - placeholder={__('Scegli il form', 'gepafin')}/> -
-
: null} -
: null} -
- -
- {/*
@@ -440,11 +389,61 @@ const BandoFlowEdit = () => {
- {/*{forms.length >= 2 && isFlowAllowed - ? : null}*/} + + {forms.length >= 2 && isFlowAllowed + ?
+
+
+
+ + updateInitialForm(e.value)} + optionDisabled={(opt) => finalForm === opt.value || isEmpty(opt.value)} + options={formOptions} + optionLabel="label" + optionValue="value" + placeholder={__('Scegli il form', 'gepafin')}/> + {initialForm && forms.length > 2 && mainFieldOptions + ?
+ + setMainField(e.value)} + optionDisabled={(opt) => isEmpty(opt.value)} + options={mainFieldOptions} + optionLabel="label" + optionValue="value" + placeholder={__('Scegli il campo', 'gepafin')}/> +
: null} +
+
+
+ + {forms.length >= 2 && initialForm + ?
+
+
+ + setFinalForm(e.value)} + optionDisabled={(opt) => initialForm === opt.value || isEmpty(opt.value)} + options={formOptions} + optionLabel="label" + optionValue="value" + placeholder={__('Scegli il form', 'gepafin')}/> +
+
+
: null} +
: null}
diff --git a/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js b/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js index 4a093dd..e0124e5 100644 --- a/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js +++ b/src/pages/DomandaEditPreInstructor/components/ArchiveDocument/index.js @@ -50,7 +50,8 @@ const ArchiveDocument = ({ ndg = '', fileId = 0 }) => { } const submitData = () => { - console.log('submitData', modalData) + console.log('submitData', modalData); + //setLoading(true); } useEffect(() => { diff --git a/src/pages/DomandaEditPreInstructor/index.js b/src/pages/DomandaEditPreInstructor/index.js index ad8e506..c5ef10f 100644 --- a/src/pages/DomandaEditPreInstructor/index.js +++ b/src/pages/DomandaEditPreInstructor/index.js @@ -181,6 +181,7 @@ const DomandaEditPreInstructor = () => { motivation } + setLoading(true); ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateStatusCallback, errUpdateStatusCallback); } @@ -194,6 +195,7 @@ const DomandaEditPreInstructor = () => { motivation } + setLoading(true); ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateStatusCallback, errUpdateStatusCallback); } @@ -207,7 +209,7 @@ const DomandaEditPreInstructor = () => { }); } } - storeSet.main.unsetAsyncRequest(); + setLoading(false); } const errUpdateStatusCallback = (data) => { @@ -219,7 +221,7 @@ const DomandaEditPreInstructor = () => { }); } set404FromErrorResponse(data); - storeSet.main.unsetAsyncRequest(); + setLoading(false); } const displayCriterionData = (id) => { @@ -377,6 +379,7 @@ const DomandaEditPreInstructor = () => { && !isEmpty(appointmentData.duration) && appointmentData.duration !== 0 && appointmentData.amount !== 0 ) { console.log(appointmentData); + //setLoading(true); } }