Skip to content

Commit

Permalink
Merge stable branch
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jul 2, 2024
2 parents bc809ec + 937107a commit cb4e5c7
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 10 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,25 @@ Released: 2024-03-28
- @uppy/vue: [v4.x] remove manual types (Antoine du Hamel / #4803)
- meta: prepare release workflow for beta versions (Antoine du Hamel)

## 3.27.2

Released: 2024-07-02

| Package | Version | Package | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/companion | 4.15.0 | @uppy/drag-drop | 3.1.1 |
| @uppy/companion-client | 3.8.2 | @uppy/form | 3.2.2 |
| @uppy/core | 3.13.1 | uppy | 3.27.2 |

- @uppy/form: do not emit `'submit'` event more than once (Merlijn Vos / #5299)
- @uppy/companion: add `s3.forcePathStyle` option (Nadeem Reinhardt / #5066)
- meta: fix broken workflow status badges in README (Alexander Zaytsev / #5298)
- @uppy/core: add `clearUploadedFiles` to type definition (Augustine Smith / #5295)
- @uppy/companion: add `oauthOrigin` option (Antoine du Hamel / #5297)
- meta: add dark-mode Transloadit logo in README (Alexander Zaytsev / #5291)
- docs,@uppy/drag-drop: `uppy.io/docs` - fix typos/broken links (Evgenia Karunus / #5296)
- meta: Bump docker/build-push-action from 6.1.0 to 6.2.0 (dependabot[bot] / #5290)


## 3.27.1

Expand Down
8 changes: 8 additions & 0 deletions packages/@uppy/companion/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ Included in: Uppy v4.0.0-beta.1
- @uppy/companion: improve error msg (Mikael Finstad / #5010)
- @uppy/companion: crash if trying to set path to / (Mikael Finstad / #5003)

## 4.15.0

Released: 2024-07-02
Included in: Uppy v3.27.2

- @uppy/companion: add `s3.forcePathStyle` option (Nadeem Reinhardt / #5066)
- @uppy/companion: add `oauthOrigin` option (Antoine du Hamel / #5297)

## 4.14.0

Released: 2024-06-18
Expand Down
7 changes: 7 additions & 0 deletions packages/@uppy/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ Included in: Uppy v4.0.0-beta.1
- @uppy/core: various type fixes (Antoine du Hamel / #4995)
- @uppy/core,@uppy/provider-views: Fix breadcrumbs (Evgenia Karunus / #4986)

## 3.13.1

Released: 2024-07-02
Included in: Uppy v3.27.2

- @uppy/core: add `clearUploadedFiles` to type definition (Augustine Smith / #5295)

## 3.12.0

Released: 2024-06-04
Expand Down
7 changes: 7 additions & 0 deletions packages/@uppy/drag-drop/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ Included in: Uppy v4.0.0-beta.1
- @uppy/drag-drop,@uppy/progress-bar: add missing exports (Antoine du Hamel / #5009)
- @uppy/drag-drop: refactor to TypeScript (Antoine du Hamel / #4983)

## 3.1.1

Released: 2024-07-02
Included in: Uppy v3.27.2

- docs,@uppy/drag-drop: `uppy.io/docs` - fix typos/broken links (Evgenia Karunus / #5296)

## 3.1.0

Released: 2024-03-27
Expand Down
7 changes: 7 additions & 0 deletions packages/@uppy/form/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ Included in: Uppy v4.0.0-beta.4

- @uppy/form: fix `submitOnSuccess` and `triggerUploadOnSubmit` combination (Merlijn Vos / #5058)

## 3.2.2

Released: 2024-07-02
Included in: Uppy v3.27.2

- @uppy/form: do not emit `'submit'` event more than once (Merlijn Vos / #5299)

## 3.2.1

Released: 2024-04-29
Expand Down
17 changes: 7 additions & 10 deletions packages/@uppy/form/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ export default class Form<M extends Meta, B extends Body> extends BasePlugin<

#form!: HTMLFormElement

/**
* Unfortunately Uppy isn't a state machine in which we can guarantee it's
* currently in one state and one state only so we use this completed property which is set on `upload-success'.
*/
#completed = false

constructor(uppy: Uppy<M, B>, opts?: FormOptions) {
super(uppy, { ...defaultOptions, ...opts })
this.type = 'acquirer'
Expand All @@ -71,25 +65,28 @@ export default class Form<M extends Meta, B extends Body> extends BasePlugin<
}

handleUploadStart(): void {
this.#completed = false
if (this.opts.getMetaFromForm) {
this.getMetaFromForm()
}
}

handleSuccess(result: Result<M, B>): void {
this.#completed = true
if (this.opts.addResultToForm) {
this.addResultToForm(result)
}

if (this.opts.submitOnSuccess) {
this.#form.requestSubmit()
// Returns true if the element's child controls satisfy their validation constraints.
// When false is returned, cancelable invalid events are fired for each invalid child
// and validation problems are reported to the user.
if (this.#form.reportValidity()) {
this.#form.submit()
}
}
}

handleFormSubmit(ev: Event): void {
if (this.opts.triggerUploadOnSubmit && !this.#completed) {
if (this.opts.triggerUploadOnSubmit) {
ev.preventDefault()
const elements = toArray((ev.target as HTMLFormElement).elements)
const disabledByUppy: HTMLButtonElement[] = []
Expand Down

0 comments on commit cb4e5c7

Please sign in to comment.