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

Allow uploading multiple files #11687

Merged
merged 4 commits into from Feb 14, 2022
Merged

Allow uploading multiple files #11687

merged 4 commits into from Feb 14, 2022

Conversation

balloob
Copy link
Member

@balloob balloob commented Feb 14, 2022

Breaking change

Proposed change

  • Fix styling of the upload button
  • Allow uploading multiple files
  • Show upload progress on button
  • Highlight add media button when no local media found
CleanShot.2022-02-14.at.10.22.34.mp4

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@matthiasdebaat
Copy link
Collaborator

Really nice! When uploading, can we make the icon into an animated spinner?

@balloob
Copy link
Member Author

balloob commented Feb 14, 2022

done.

CleanShot.2022-02-14.at.10.54.29.mp4

const files = input.files!;
const target = this._currentItem!.media_content_id!;

try {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will this try catch, as the try inside the loop will catch everything?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use it for the finally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The finally isn't needed then right? If it will not throw anyway?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if an error happens in the inner try, we do a return.

So now in both error case + when finished will we set uploading to 0 and refresh.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return and not break?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@balloob balloob enabled auto-merge (squash) February 14, 2022 23:21
@balloob balloob merged commit 8bb2374 into dev Feb 14, 2022
@delete-merged-branch delete-merged-branch bot deleted the allow-upload-multiple branch February 14, 2022 23:25
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants