- updated https url;
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState, useRef } from 'react';
|
||||
import { classNames } from 'primereact/utils';
|
||||
import { head } from 'ramda'
|
||||
import { head, isEmpty } from 'ramda'
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
import FileUploadService from '../../../../service/file-upload-service';
|
||||
@@ -111,7 +111,15 @@ const Fileupload = ({
|
||||
}
|
||||
|
||||
const onBeforeDrop = (e) => {
|
||||
return validateFileInputType(e.dataTransfer.files);
|
||||
return !isEmpty(e.dataTransfer.files) ? validateFileInputType(e.dataTransfer.files) : false;
|
||||
}
|
||||
|
||||
const onBeforeSelect = (e) => {
|
||||
if (e.originalEvent.target.files) {
|
||||
return !isEmpty(e.originalEvent.target.files)
|
||||
? validateFileInputType(e.originalEvent.target.files)
|
||||
: false;
|
||||
}
|
||||
}
|
||||
|
||||
const validateFileInputType = (files) => {
|
||||
@@ -178,6 +186,7 @@ const Fileupload = ({
|
||||
itemTemplate={itemTemplate}
|
||||
customUpload
|
||||
onBeforeDrop={onBeforeDrop}
|
||||
onBeforeSelect={onBeforeSelect}
|
||||
uploadHandler={customBase64Uploader}/>
|
||||
{infoText ? <small>{infoText}</small> : null}
|
||||
</>
|
||||
|
||||
@@ -7,7 +7,7 @@ import FileUploadService from '../../../../service/file-upload-service';
|
||||
import { FileUpload } from 'primereact/fileupload';
|
||||
import { Tag } from 'primereact/tag';
|
||||
import { Button } from 'primereact/button';
|
||||
import { head } from 'ramda';
|
||||
import { head, isEmpty } from 'ramda';
|
||||
import { mimeTypes } from '../../../../configData';
|
||||
|
||||
const FileuploadAsync = ({
|
||||
@@ -112,7 +112,15 @@ const FileuploadAsync = ({
|
||||
}
|
||||
|
||||
const onBeforeDrop = (e) => {
|
||||
return validateFileInputType(e.dataTransfer.files);
|
||||
return !isEmpty(e.dataTransfer.files) ? validateFileInputType(e.dataTransfer.files) : false;
|
||||
}
|
||||
|
||||
const onBeforeSelect = (e) => {
|
||||
if (e.originalEvent.target.files) {
|
||||
return !isEmpty(e.originalEvent.target.files)
|
||||
? validateFileInputType(e.originalEvent.target.files)
|
||||
: false;
|
||||
}
|
||||
}
|
||||
|
||||
const validateFileInputType = (files) => {
|
||||
@@ -179,6 +187,7 @@ const FileuploadAsync = ({
|
||||
itemTemplate={itemTemplate}
|
||||
customUpload
|
||||
onBeforeDrop={onBeforeDrop}
|
||||
onBeforeSelect={onBeforeSelect}
|
||||
uploadHandler={customBase64Uploader}/>
|
||||
{infoText ? <small>{infoText}</small> : null}
|
||||
</>
|
||||
|
||||
@@ -20,7 +20,7 @@ const NumberInput = ({
|
||||
min,
|
||||
max,
|
||||
disabled = false,
|
||||
useGrouping = false
|
||||
useGrouping = true
|
||||
}) => {
|
||||
const input = <Controller
|
||||
name={fieldName}
|
||||
|
||||
Reference in New Issue
Block a user