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

fix[Op#52098]: Invalidate form validity when direct upload is too large #15411

Merged
merged 7 commits into from May 13, 2024

Conversation

akabiru
Copy link
Member

@akabiru akabiru commented Apr 29, 2024

https://community.openproject.org/wp/52098

Follows #15280

On direct upload, client side JQuery overrides the form submission to the "direct" storage provider. This PR intercepts this submission by attaching form validity via HTMLObjectElement.setCustomValidity()

See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity

  • add feature test
  • add request test
  • Fix failing test
ifc-direct-upload-fix.mp4

@akabiru akabiru self-assigned this Apr 29, 2024
See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity

On direct upload, client side JQuery overrides the form submission to
the _"direct"_ storage provider. This PR intercepts this submission by
attaching form validity via [`HTMLObjectElement.setCustomValidity()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity)

----

Co-authored-by: Eric Schubert <e.schubert@openproject.com>
@akabiru akabiru force-pushed the bug/52098-misleading-error-message-ifc-direct-upload branch from 994ba4d to 43dd5e5 Compare April 29, 2024 13:08
@akabiru akabiru added the bugfix label Apr 29, 2024
Copy link
Member

@Kharonus Kharonus left a comment

Choose a reason for hiding this comment

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

I love it, simple and direct solution for this bug.

Eventually we will get rid of the jQuery here, maybe when we rework that whole form to primer.

@akabiru akabiru marked this pull request as ready for review May 13, 2024 15:05
@akabiru akabiru merged commit 48503ed into dev May 13, 2024
8 of 9 checks passed
@akabiru akabiru deleted the bug/52098-misleading-error-message-ifc-direct-upload branch May 13, 2024 15:19
akabiru added a commit that referenced this pull request May 14, 2024
…-ifc-direct-upload

fix[Op#52098]: Invalidate form validity when direct upload is too large
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants