Skip to content

Commit

Permalink
Merge branch 'main' into lakesare/type-dashboard-2
Browse files Browse the repository at this point in the history
  • Loading branch information
lakesare authored Aug 2, 2024
2 parents bd83059 + b9582e1 commit 9508a84
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
5 changes: 0 additions & 5 deletions docs/uploader/aws-s3-multipart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,6 @@ upload as query parameters.
- Set it to `['name']` to only send the `name` field.
- Set it to `true` (the default) to send _all_ metadata fields.

<details>
<summary>Deprecated options</summary>

#### `getTemporarySecurityCredentials(options)`

:::note
Expand Down Expand Up @@ -484,8 +481,6 @@ uppy.use(AwsS3, {
});
```

</details>

[`gettemporarysecuritycredentials`]: #gettemporarysecuritycredentialsoptions
[`shouldusemultipart`]: #shouldusemultipartfile
[companion docs]: /docs/companion
Expand Down
3 changes: 1 addition & 2 deletions packages/@uppy/drag-drop/src/DragDrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ export default class DragDrop<M extends Meta, B extends Body> extends UIPlugin<
}}
name={this.opts.inputName}
multiple={restrictions.maxNumberOfFiles !== 1}
// @ts-expect-error We actually want to coerce the array to a string (or keep it as null/undefined)
accept={restrictions.allowedFileTypes}
accept={restrictions.allowedFileTypes?.join(', ')}
onChange={this.onInputChange}
/>
)
Expand Down
6 changes: 1 addition & 5 deletions packages/@uppy/file-input/src/FileInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ export default class FileInput<M extends Meta, B extends Body> extends UIPlugin<
} satisfies h.JSX.IntrinsicElements['input']['style']

const { restrictions } = this.uppy.opts
const accept =
restrictions.allowedFileTypes ?
restrictions.allowedFileTypes.join(',')
: undefined

return (
<div className="uppy-FileInput-container">
Expand All @@ -110,7 +106,7 @@ export default class FileInput<M extends Meta, B extends Body> extends UIPlugin<
name={this.opts.inputName}
onChange={this.handleInputChange}
multiple={restrictions.maxNumberOfFiles !== 1}
accept={accept}
accept={restrictions.allowedFileTypes?.join(', ')}
ref={(input) => {
this.input = input as HTMLFileInputElement
}}
Expand Down
10 changes: 9 additions & 1 deletion private/dev/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ function getCompanionKeysParams (name) {

export default () => {
const restrictions = undefined
// const restrictions = { requiredMetaFields: ['caption'], maxNumberOfFiles: 3 }
// const restrictions = {
// maxFileSize: 1 * 1000000, // 1mb
// minFileSize: 1 * 1000000, // 1mb
// maxTotalFileSize: 1 * 1000000, // 1mb
// maxNumberOfFiles: 3,
// minNumberOfFiles: 1,
// allowedFileTypes: ['image/*', '.jpg', '.jpeg', '.png', '.gif'],
// requiredMetaFields: ['caption'],
// }

const uppyDashboard = new Uppy({
logger: debugLogger,
Expand Down

0 comments on commit 9508a84

Please sign in to comment.