1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Merge branch 'main' into feature/compute

This commit is contained in:
Matthias Kretschmann 2021-04-14 15:31:36 +02:00
commit fff5699c67
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 32 additions and 3 deletions

View File

@ -18,9 +18,15 @@ export default function FileInput({
return ( return (
<InputGroup> <InputGroup>
<input className={styles.input} {...props} type="url" /> <input
className={styles.input}
{...props}
type="url"
onBlur={(e: React.SyntheticEvent) => handleButtonClick(e, field.value)}
/>
<Button <Button
style="primary"
size="small" size="small"
onClick={(e: React.SyntheticEvent) => handleButtonClick(e, field.value)} onClick={(e: React.SyntheticEvent) => handleButtonClick(e, field.value)}
disabled={ disabled={

View File

@ -15,7 +15,9 @@ export const validationSchema: Yup.SchemaOf<MetadataPublishFormDataset> = Yup.ob
symbol: Yup.string() symbol: Yup.string()
}) })
.required('Required'), .required('Required'),
files: Yup.array<FileMetadata>().required('Required').nullable(), files: Yup.array<FileMetadata>()
.required('Enter a valid URL and click "ADD FILE"')
.nullable(),
description: Yup.string().min(10).required('Required'), description: Yup.string().min(10).required('Required'),
timeout: Yup.string().required('Required'), timeout: Yup.string().required('Required'),
access: Yup.string() access: Yup.string()

View File

@ -21,8 +21,29 @@ export async function fileinfo(
return return
} }
if (!response.data[0] || !response.data[0].valid) { if (!response.data[0] || !response.data[0].valid) {
toast.error('Could not fetch file info. Please check URL and try again') toast.error(
'The data file URL you entered apears to be invalid. Please check URL and try again',
{
autoClose: false,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined
}
)
return return
} else {
toast.dismiss() // Remove any existing error message
toast.success('Great! That dataset looks good 🐳', {
position: 'bottom-right',
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined
})
} }
const { contentLength, contentType } = response.data[0] const { contentLength, contentType } = response.data[0]