Skip to content

Commit

Permalink
Metadata dropzone: disable click, fix JSON drop
Browse files Browse the repository at this point in the history
  • Loading branch information
fiskus committed Aug 31, 2023
1 parent 56425e7 commit 2fefa84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions catalog/app/containers/Bucket/PackageDialog/MetaInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export const MetaInput = React.forwardRef<HTMLDivElement, MetaInputProps>(
onChange(contents)
} else {
try {
JSON.parse(contents as string)
onChange(JSON.parse(contents as string))

Check warning on line 287 in catalog/app/containers/Bucket/PackageDialog/MetaInput.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Bucket/PackageDialog/MetaInput.tsx#L287

Added line #L287 was not covered by tests
} catch (e) {
notify('The file does not contain valid JSON')
}
Expand Down Expand Up @@ -318,7 +318,11 @@ export const MetaInput = React.forwardRef<HTMLDivElement, MetaInputProps>(

const isDragging = useDragging()

const { getRootProps, isDragActive } = useDropzone({ onDrop })
const { getRootProps, isDragActive } = useDropzone({

Check warning on line 321 in catalog/app/containers/Bucket/PackageDialog/MetaInput.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Bucket/PackageDialog/MetaInput.tsx#L321

Added line #L321 was not covered by tests
onDrop,
noClick: true,
noKeyboard: true,
})

return (
<div className={className}>
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Entries inside each section should be ordered by type:
* [Fixed] Fix Header's orange flash on load ([#3487](https://github.com/quiltdata/quilt/pull/3487))
* [Fixed] Fix code sample for package push ([#3499](https://github.com/quiltdata/quilt/pull/3499))
* [Fixed] Make bookmarks optional (and fix Embed listings broken in #3697) ([#3705](https://github.com/quiltdata/quilt/pull/3705))
* [Fixed] Disable opening file picker on metadata click ([#3707](https://github.com/quiltdata/quilt/pull/3707))
* [Added] Add filter for users and buckets tables in Admin dashboards ([#3480](https://github.com/quiltdata/quilt/pull/3480))
* [Added] Add links to documentation and re-use code samples ([#3496](https://github.com/quiltdata/quilt/pull/3496))
* [Added] Show S3 Object tags ([#3515](https://github.com/quiltdata/quilt/pull/3515))
Expand Down

0 comments on commit 2fefa84

Please sign in to comment.