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: disable save button upon submitting #6250

Conversation

sabrina-bongiovanni
Copy link
Contributor

When submitting the Add form upon creating a new Content Type, if the connection is too slow, the button will start loading and the spinner will appear, but it will remain clickable, thus allowing to submit the form and trigger the query multiple times, which in turn results in creating more instances of the same CT.

Adding the disabled prop to the button when the query is still loading prevents this issue from happening.

@davisagli
Copy link
Member

Please also submit a PR to fix this on the main branch. Otherwise the fix will be missing in Volto 18 and later.

@davisagli davisagli added the backport A backport PR to a numbered branch label Aug 12, 2024
@sabrina-bongiovanni
Copy link
Contributor Author

sabrina-bongiovanni commented Aug 13, 2024

It seems there are some broken acceptance tests. I tried to run them locally and it appears that the issues where the tests break are not related to the code I changed in this PR.

I tried to run the test locally and it seems that the only wrong thing with that test is that the breaking line should be:

cy.get( '[style="transition: opacity 500ms;"] > :nth-child(2) > .ui', ).click();

as the style tag actually only has that attribute.
However, I've seen all other PR not having any issues with that, so I don't know whether I should fix that and it's something limited to Volto 17 or if I should just leave it as it is.
If anyone has any suggestions, I'll gladly look into it further.

@stevepiercy
Copy link
Collaborator

@sabrina-bongiovanni some tests are known to be flaky. I triggered a rerun of failed jobs in CI. Let's see if the 5 failed ones pass this time.

@ichim-david
Copy link
Member

@sabrina-bongiovanni some tests are known to be flaky. I triggered a rerun of failed jobs in CI. Let's see if the 5 failed ones pass this time.

@stevepiercy Remember that you changed the upload action to v4 within https://github.com/plone/volto/pull/6242/files but that is only for main. That change should be backported also to 17

@ichim-david ichim-david self-requested a review August 13, 2024 18:20
@stevepiercy
Copy link
Collaborator

@sabrina-bongiovanni @ichim-david PR to bump actions/upload-artifact created in #6253.

@davisagli davisagli merged commit 3f116b2 into plone:17.x.x Aug 14, 2024
24 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport A backport PR to a numbered branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants