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

[backend] Disable customer returns buttons after first click #3550

Merged

Conversation

AlessioRocco
Copy link
Contributor

@AlessioRocco AlessioRocco commented Mar 12, 2020

Description
This PR continue the work started with #3342:

It may happen that admin users click multiple times (purposely or not) on submit buttons in the backend area.

This can be a problem as at times it may silently generate unwanted duplicate records, or show an error page due to duplicate records. This is much more likely to happen on real shops when unanticipated server load makes the application unresponsive (at first click nothing seems to happen, so then why not click again?) and where some controller create actions may be patched and be slower.

By changing button_tag to f.submit or submit_tag the button gets disabled after the first click, thanks to the automatically added attribute data-disable-with="Create"

by disabling the missing submit buttons in the customer returns backend page.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change (if needed)

@AlessioRocco AlessioRocco changed the title Disable reimbursement creation button after click Disable submit buttons after click Mar 12, 2020
@AlessioRocco AlessioRocco changed the title Disable submit buttons after click [backend] Disable submit buttons after first click Mar 12, 2020
@AlessioRocco AlessioRocco force-pushed the backend-customer-returns-disable-submit branch 2 times, most recently from b2ff9ba to b6ce00e Compare March 12, 2020 14:14
@AlessioRocco AlessioRocco changed the title [backend] Disable submit buttons after first click [backend] Disable missing submit buttons after first click Mar 12, 2020
@AlessioRocco AlessioRocco changed the title [backend] Disable missing submit buttons after first click [backend] Disable missing customer returns submit buttons after first click Mar 12, 2020
@AlessioRocco AlessioRocco changed the title [backend] Disable missing customer returns submit buttons after first click [backend] Disable customer returns submit buttons after first click Mar 12, 2020
@AlessioRocco AlessioRocco changed the title [backend] Disable customer returns submit buttons after first click [backend] Disable customer returns buttons after first click Mar 12, 2020
@AlessioRocco AlessioRocco force-pushed the backend-customer-returns-disable-submit branch 5 times, most recently from 34b84c9 to 3997cff Compare April 4, 2020 13:03
@AlessioRocco AlessioRocco force-pushed the backend-customer-returns-disable-submit branch from 3997cff to 9168eb6 Compare April 4, 2020 13:05
@aldesantis
Copy link
Member

@AlessioRocco do you have a second to finish this? 🙏

@waiting-for-dev waiting-for-dev added type:enhancement Proposed or newly added feature changelog:solidus_backend Changes to the solidus_backend gem labels Aug 25, 2022
@spaghetticode spaghetticode marked this pull request as ready for review October 26, 2022 07:48
@elia elia self-assigned this Jun 9, 2023
Disabling the button prevents multiple form submissions that would
result in unwanted duplicated records.
Disabling the button prevents multiple form submissions that would
result in unwanted duplicated records.
Disabling the button prevents multiple form submissions that would
result in unwanted duplicated records.
@elia elia force-pushed the backend-customer-returns-disable-submit branch from 9168eb6 to 318d907 Compare June 9, 2023 18:57
@elia elia requested a review from a team as a code owner June 9, 2023 18:57
@elia elia requested review from waiting-for-dev and kennyadsl June 9, 2023 19:11
@elia elia requested a review from rainerdema June 9, 2023 19:11
Copy link
Contributor

@rainerdema rainerdema left a comment

Choose a reason for hiding this comment

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

👏

@waiting-for-dev waiting-for-dev merged commit a03f443 into solidusio:main Jun 13, 2023
@waiting-for-dev waiting-for-dev deleted the backend-customer-returns-disable-submit branch June 13, 2023 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants