From 2bedcee17287459d858568b77f0ce04181cb2ba6 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Sat, 12 Oct 2024 20:41:12 +0200 Subject: [PATCH] : --- .../FormField/components/FileuploadAsync/index.js | 1 + src/components/UnsavedChangesDetector/index.js | 2 +- src/pages/AddCompany/index.js | 2 +- src/pages/BandoApplication/index.js | 6 +++--- .../BandoEdit/components/BandoEditFormStep2/index.js | 8 +++++++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/FormField/components/FileuploadAsync/index.js b/src/components/FormField/components/FileuploadAsync/index.js index 56ecc77..a9ad614 100644 --- a/src/components/FormField/components/FileuploadAsync/index.js +++ b/src/components/FormField/components/FileuploadAsync/index.js @@ -35,6 +35,7 @@ const FileuploadAsync = ({ source = 'application', disabled = false }) => { + // eslint-disable-next-line no-unused-vars const [stateFieldData, setStateFieldData] = useState([]); const [acceptFormats, setAcceptFormats] = useState(''); const [formatsForInput, setFormatsForInput] = useState(''); diff --git a/src/components/UnsavedChangesDetector/index.js b/src/components/UnsavedChangesDetector/index.js index 428a0a9..71c967e 100644 --- a/src/components/UnsavedChangesDetector/index.js +++ b/src/components/UnsavedChangesDetector/index.js @@ -1,7 +1,7 @@ import { useEffect } from 'react'; import { __ } from '@wordpress/i18n'; import equal from 'fast-deep-equal'; -import { diff } from 'deep-object-diff'; +//import { diff } from 'deep-object-diff'; // store import { storeGet } from '../../store'; diff --git a/src/pages/AddCompany/index.js b/src/pages/AddCompany/index.js index ac29844..82af8ac 100644 --- a/src/pages/AddCompany/index.js +++ b/src/pages/AddCompany/index.js @@ -1,6 +1,6 @@ import React, { useEffect, useRef } from 'react'; import { __ } from '@wordpress/i18n'; -import { isEmpty, isNil, head } from 'ramda'; +import { isEmpty, head } from 'ramda'; import { klona } from 'klona'; import { useDebounce } from 'primereact/hooks'; import { useNavigate } from 'react-router-dom'; diff --git a/src/pages/BandoApplication/index.js b/src/pages/BandoApplication/index.js index cee9bfd..1a0a631 100644 --- a/src/pages/BandoApplication/index.js +++ b/src/pages/BandoApplication/index.js @@ -43,7 +43,7 @@ const BandoApplication = () => { const [bandoTitle, setBandoTitle] = useState(''); const [formId, setFormId] = useState(''); const [totalSteps, setTotalSteps] = useState(0); - const [completedSteps, setCompletedSteps] = useState(0); + //const [completedSteps, setCompletedSteps] = useState(0); const [visibleConfirmation, setVisibleConfirmation] = useState(false); const [applicationStatus, setApplicationStatus] = useState(''); const [activeStep, setActiveStep] = useState(1); @@ -265,7 +265,7 @@ const BandoApplication = () => { setFormData(data.data.applicationFormResponse.content); setFormId(data.data.formId); setTotalSteps(data.data.totalFormSteps); - setCompletedSteps(data.data.completedSteps); + //setCompletedSteps(data.data.completedSteps); setApplicationStatus(data.data.applicationStatus) setActiveStep(data.data.currentStep); @@ -302,7 +302,7 @@ const BandoApplication = () => { const getStatusCheckCallback = (data) => { if (data.status === 'SUCCESS') { - setCompletedSteps(data.data.completedSteps); + //setCompletedSteps(data.data.completedSteps); } } diff --git a/src/pages/BandoEdit/components/BandoEditFormStep2/index.js b/src/pages/BandoEdit/components/BandoEditFormStep2/index.js index 2bd04bf..b4c1eaa 100644 --- a/src/pages/BandoEdit/components/BandoEditFormStep2/index.js +++ b/src/pages/BandoEdit/components/BandoEditFormStep2/index.js @@ -21,6 +21,7 @@ import LookupdataService from '../../../../service/lookupdata-service'; // store import { storeSet } from '../../../../store'; import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString'; +import { mimeTypes } from '../../../../configData'; const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors, status }, ref) { const navigate = useNavigate(); @@ -211,6 +212,11 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors, st return values.status === 'PUBLISH' } + const acceptAllFormats = () => { + console.log(mimeTypes.map(o => o.code)) + return mimeTypes.map(o => o.code); + } + return (
@@ -243,7 +249,7 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors, st errors={errors} defaultValue={values['docs']} config={{ required: __('È obbligatorio', 'gepafin') }} - accept={["application/pdf", "application/vnd.ms-excel"]} + accept={acceptAllFormats()} chooseLabel={__('Aggiungi documento', 'gepafin')} multiple={true} doctype='document'