- updated flow of appl submission;
- updated max file size across the app;
This commit is contained in:
@@ -9,22 +9,22 @@ import { Button } from 'primereact/button';
|
||||
// api
|
||||
import ApplicationService from '../../service/application-service';
|
||||
|
||||
import { mimeTypes } from '../../configData';
|
||||
import { defaultMaxFileSize, mimeTypes } from '../../configData';
|
||||
|
||||
const FileuploadApplicationSignedPdf = ({
|
||||
fieldName,
|
||||
setDataFn,
|
||||
defaultValue = [],
|
||||
accept = [],
|
||||
maxSize = 100000000,
|
||||
emptyText = __('Trascina qui il tuo file', 'gepafin'),
|
||||
chooseLabel = __('Aggiungi documento', 'gepafin'),
|
||||
uploadLabel = __('Salva documento', 'gepafin'),
|
||||
cancelLabel = __('Cancella documento', 'gepafin'),
|
||||
multiple = false,
|
||||
applicationId = 0,
|
||||
disabled = false
|
||||
}) => {
|
||||
fieldName,
|
||||
setDataFn,
|
||||
defaultValue = [],
|
||||
accept = [],
|
||||
maxSize = defaultMaxFileSize,
|
||||
emptyText = __('Trascina qui il tuo file', 'gepafin'),
|
||||
chooseLabel = __('Aggiungi documento', 'gepafin'),
|
||||
uploadLabel = __('Salva documento', 'gepafin'),
|
||||
cancelLabel = __('Cancella documento', 'gepafin'),
|
||||
multiple = false,
|
||||
applicationId = 0,
|
||||
disabled = false
|
||||
}) => {
|
||||
const [stateFieldData, setStateFieldData] = useState([]);
|
||||
const [acceptFormats, setAcceptFormats] = useState('');
|
||||
const [formatsForInput, setFormatsForInput] = useState('');
|
||||
@@ -145,19 +145,19 @@ const FileuploadApplicationSignedPdf = ({
|
||||
useEffect(() => {
|
||||
const properMime = accept.map
|
||||
? accept
|
||||
.map(v => {
|
||||
const found = head(mimeTypes.filter(o => o.code.includes(v)));
|
||||
let res = v;
|
||||
.map(v => {
|
||||
const found = head(mimeTypes.filter(o => o.code.includes(v)));
|
||||
let res = v;
|
||||
|
||||
if (found) {
|
||||
res = found.code;
|
||||
}
|
||||
if (found) {
|
||||
res = found.code;
|
||||
}
|
||||
|
||||
return res;
|
||||
}) : [];
|
||||
return res;
|
||||
}) : [];
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
setAcceptFormats(properMime.join(',').replace(/\*/g, '.\*').replace(/,/g, '|'));
|
||||
setFormatsForInput(properMime.join(','))
|
||||
setFormatsForInput(properMime.join(','));
|
||||
}, [accept]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user