diff --git a/src/components/@shared/FormInput/InputElement/FilesInput/index.tsx b/src/components/@shared/FormInput/InputElement/FilesInput/index.tsx index 720b0f027..b3353cce6 100644 --- a/src/components/@shared/FormInput/InputElement/FilesInput/index.tsx +++ b/src/components/@shared/FormInput/InputElement/FilesInput/index.tsx @@ -21,6 +21,14 @@ export default function FilesInput(props: InputProps): ReactElement { ? props.form?.values?.services[0].providerUrl.url : asset.services[0].serviceEndpoint setIsLoading(true) + + // TODO: handled on provider + if (url.includes('drive.google')) { + throw Error( + 'Google Drive is not a supported hosting service. Please use an alternative.' + ) + } + const checkedFile = await getFileUrlInfo(url, providerUrl) // error if something's not right from response diff --git a/src/components/Asset/Edit/FormEditMetadata.tsx b/src/components/Asset/Edit/FormEditMetadata.tsx index f218ec4bd..6bcfc8e43 100644 --- a/src/components/Asset/Edit/FormEditMetadata.tsx +++ b/src/components/Asset/Edit/FormEditMetadata.tsx @@ -60,7 +60,16 @@ export default function FormEditMetadata({ asset?.metadata?.links?.[0] && getFileUrlInfo(asset.metadata.links[0], providerUrl).then( (checkedFile) => { - console.log(checkedFile) + // set valid false if url is using google drive + if (asset.metadata.links[0].includes('drive.google')) { + setFieldValue('links', [ + { + url: asset.metadata.links[0], + valid: false + } + ]) + return + } // initiate link with values from asset metadata setFieldValue('links', [ {