Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@uppy/transloadit: simplify plugin to always run a single assembly #5158

Merged
merged 26 commits into from
Jun 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
69e6c26
Only create one assembly
Murderlon May 9, 2024
cd65aa2
TransloaditState.assemblies->assembly
Murderlon May 9, 2024
d8c7f07
Remove AssemblyOptions
Murderlon May 9, 2024
59e8c9c
Fix import
Murderlon May 13, 2024
728573a
rename assembly in state to assemblyResponse
Murderlon May 13, 2024
14db62b
make watcher and assemblies singular
Murderlon May 13, 2024
6002d69
Remove redundant uploadsAssemblies from state
Murderlon May 14, 2024
f3084ad
Merge branch '4.x' into transloadit-single-assembly
Murderlon May 14, 2024
2547da9
Merge branch '4.x' into transloadit-single-assembly
Murderlon May 27, 2024
383a520
Fix e2e test
Murderlon May 28, 2024
8b34b13
Remove test
Murderlon May 28, 2024
bdb40c2
test clean up
Murderlon May 29, 2024
f7f8c07
remove updateNumberOfFilesInAssembly
Murderlon May 29, 2024
c733d93
Remove AssemblyResponse from TransloaditState
Murderlon May 29, 2024
6f9fe8f
Apply feedback
Murderlon May 30, 2024
f4a9d0c
Make watcher private
Murderlon Jun 3, 2024
ce6ded7
Merge branch '4.x' into transloadit-single-assembly
Murderlon Jun 4, 2024
23911d0
Send along all metadata to Transloadit
Murderlon Jun 4, 2024
d32e0ab
Merge branch '4.x' into transloadit-single-assembly
Murderlon Jun 5, 2024
75e86ea
Improve tests
Murderlon Jun 5, 2024
2c4c0d9
Update getPlugin
Murderlon Jun 17, 2024
a939de8
Merge branch '4.x' into transloadit-single-assembly
Murderlon Jun 17, 2024
28e5e2a
Merge branch 'transloadit-single-assembly' of https://github.com/tran…
Murderlon Jun 17, 2024
023709d
Fix restoring files during upload
Murderlon Jun 17, 2024
d41063a
Fix test
Murderlon Jun 17, 2024
a6e74c8
Remove timeout
Murderlon Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch '4.x' into transloadit-single-assembly
* 4.x:
  meta: fix AWS test suite (#5229)
  Release: uppy@4.0.0-beta.10 (#5225)
  Release: uppy@3.26.0 (#5223)
  meta: remove Companion's `prepublishOnly` (#5220)
  docs: document clearUploadedFiles (#5204)
  @uppy/webcam: add missing types for `recordedVideo` (#5208)
  @uppy/core: check capabilities in clearUploadedFiles (#5201)
  PartialTree - change the `maxTotalFileSize` error (#5203)
  @uppy/transloadit: remove `updateNumberOfFilesInAssembly` (#5202)
  @uppy/aws-s3: resolve all headers on response (#5195)
  Improve provider docs: OneDrive (#5196)
  • Loading branch information
Murderlon committed Jun 5, 2024
commit d32e0ab6d89565ea2cc74b72fefd488c4fe0abd8
58 changes: 20 additions & 38 deletions e2e/cypress/integration/dashboard-transloadit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,58 +170,40 @@ describe('Dashboard with Transloadit', () => {
})
})

// Not working, the upstream changes have not landed yet.
it.skip('should create assembly if there is still one file to upload', () => {
cy.get('@file-input').selectFile(
[
'cypress/fixtures/images/cat.jpg',
'cypress/fixtures/images/traffic.jpg',
],
{ force: true },
)
cy.get('.uppy-StatusBar-actionBtn--upload').click()

it('should not create assembly when all individual files have been cancelled', () => {
cy.window().then(({ uppy }) => {
cy.get('@file-input').selectFile(
[
'cypress/fixtures/images/cat.jpg',
'cypress/fixtures/images/traffic.jpg',
],
{ force: true },
)
// eslint-disable-next-line
// @ts-ignore fix me
expect(
Object.values(uppy.getPlugin('Transloadit').activeAssemblies).length,
).to.equal(0)

cy.get('.uppy-StatusBar-actionBtn--upload').click()

const { files } = uppy.getState()
const [fileID] = Object.keys(files)
uppy.removeFile(fileID)
// eslint-disable-next-line
// @ts-ignore fix me
uppy.removeFiles(Object.keys(files))

cy.wait('@createAssemblies').then(() => {
cy.wait('@resumable')
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Complete')
// eslint-disable-next-line
// @ts-ignore fix me
expect(
Object.values(uppy.getPlugin('Transloadit').activeAssemblies).some(
(a: any) => a.pollInterval,
),
).to.equal(false)
})
})
})

// Not working, the upstream changes have not landed yet.
it.skip('should complete upload if one gets cancelled mid-flight', () => {
cy.get('@file-input').selectFile(
[
'cypress/fixtures/images/cat.jpg',
'cypress/fixtures/images/traffic.jpg',
],
{ force: true },
)
cy.get('.uppy-StatusBar-actionBtn--upload').click()

cy.wait('@createAssemblies')
cy.wait('@resumable')

cy.window().then(({ uppy }) => {
const { files } = uppy.getState()
const [fileID] = Object.keys(files)
uppy.removeFile(fileID)

cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Complete')
})
})

it('should not emit error if upload is cancelled right away', () => {
cy.intercept({ path: '/assemblies', method: 'POST' }).as('createAssemblies')

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.