Skip to content
New issue

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

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

Already on GitHub? # to your account

[new_profile] Prevent duplication when button is clicked repetitively #4364

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

ridz1208
Copy link
Collaborator

Brief summary of changes

Added safeguard for disabling button after first click while the request is being processed in the backend. this was copied from the next_stage change done a while back (see related PR)

#2358

This resolves issue...

Issue reported by collaborators at the CRU

To test this change...

  • before checking out the branch, try creating a candidate, fill out all the information on the form and click multiple times consecutively on the submission button. n new candidates will be created
  • after checking out this branch. as soon as you click the first time the button should be disabled and no additional candidates created

@ridz1208 ridz1208 added Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label) [branch] bugfix labels Feb 26, 2019
@ridz1208
Copy link
Collaborator Author

@zaliqarosli you seemed so interested, could you give it a try when you get a chance ?

@johnsaigle
Copy link
Contributor

Is this only an issue for tpl forms? Is it worth trying to make something generic (or at least adding this to other buttons also)?

@ridz1208
Copy link
Collaborator Author

@johnsaigle maybe worth just making this change on tpl forms until we move them to react

@kongtiaowang kongtiaowang added the Passed Manual Tests PR has undergone proper testing by at least one peer label Mar 4, 2019
Copy link
Contributor

@zaliqarosli zaliqarosli left a comment

Choose a reason for hiding this comment

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

passes my testing as well

@ridz1208
Copy link
Collaborator Author

ridz1208 commented Mar 4, 2019

@driusan MERGE MEEEE

@driusan
Copy link
Collaborator

driusan commented Mar 6, 2019

Seems hacky, but okay, if it works and it's just a stop gap until things are converted to React.

@driusan driusan merged commit e872851 into aces:bugfix Mar 6, 2019
@thomasbeaudry
Copy link

Seems hacky, but okay, if it works and it's just a stop gap until things are converted to React.

I'm surprised you think this is hacky, it's a pretty common practice for this issue.

@driusan
Copy link
Collaborator

driusan commented Mar 7, 2019

The non-hacky way to do it is a CSRF token (ie. view source on this page, the form has a hidden "authenticity_token", not javascript to disable the form.)

@ridz1208 ridz1208 added this to the 20.2.1 milestone Mar 14, 2019
kchatpar pushed a commit to kchatpar/Loris that referenced this pull request Apr 15, 2019
…aces#4364)

Added safeguard for disabling button after first click while the request is being processed in the backend. this was copied from the next_stage change done a while back (see related PR aces#2358.)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label) Passed Manual Tests PR has undergone proper testing by at least one peer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants