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

[SOL-2077] Prevent 'Change Background' button from forcing form submission #105

Merged

Conversation

haikuginger
Copy link
Contributor

@haikuginger haikuginger commented Sep 19, 2016

As part of #88, we inadvertently removed a PreventDefaults call from the event handler for the "Change Background" button. Since some browsers default the type of <button> elements to submit, this resulted in the form being submitted synchronously, resulting in a page reload, and preventing the updated image URI from being saved. This change explicitly sets that button's type to "button", which has no default submission behavior.

JIRA tickets: Fixes SOL-2077

Testing instructions:

  1. In a devstack running the master version of DnDv2, create a problem.
  2. Attempt to set the background image of that problem to a different URL; set the value, and click the "Change Background" button.
  3. Observe that the form is immediately submitted and the page refreshed.
  4. Observe that your new image is not used.
  5. Install this branch.
  6. Again attempt to set the background image; set the value, click the "Change Background" button, click the "Continue" button, and click "Save".
  7. Observe that the configuration dialog is not closed when you click "Change Background".
  8. Observe that after clicking Save, your image choice is used for the DnDv2 problem.

Reviewers

@openedx-webhooks
Copy link

Thanks for the pull request, @haikuginger! It looks like you're a member of a company that does contract work for edX. If you're doing this work as part of a paid contract with edX, you should talk to edX about who will review this pull request. If this work is not part of a paid contract with edX, then you should ensure that there is an OSPR issue to track this work in JIRA, so that we don't lose track of your pull request.

To automatically create an OSPR issue for this pull request, just visit this link: https://openedx-webhooks.herokuapp.com/github/process_pr?number=105&repo=edx-solutions%2Fxblock-drag-and-drop-v2

Copy link
Contributor

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this on my devstack, using the PR's instructions.
  • I read through the code.
  • Includes documentation Bugfix, no documentation required.

@openedx-webhooks
Copy link

Thanks for the pull request, @haikuginger! I've created OSPR-1458 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • edx-code email threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here.

If you like, you can add yourself to the AUTHORS file for this repo, though that isn't required. Please see the CONTRIBUTING file for more information.

@haikuginger
Copy link
Contributor Author

Pinging the relevant teams for review:

Note that we're having some issues with our sandbox infrastructure at present, so we don't have one yet, but will spawn one ASAP.

@cahrens
Copy link

cahrens commented Sep 19, 2016

👍

1 similar comment
@staubina
Copy link
Contributor

👍

@haikuginger haikuginger force-pushed the haikuginger/fix-background-button branch from 6288a9b to 8441f33 Compare September 22, 2016 21:57
@haikuginger
Copy link
Contributor Author

Per @antoviaque, I'm adding a version bump to 2.0.10 in this PR so we can get this fix into tomorrow's OpenEdX release. I am planning on merging ASAP once Travis goes green so I can open an edx-platform version bump PR, so if @pomegranited, @cahrens, and/or @staubina want to give the version bump notes a once-over for any glaring issues prior to that, that'd be great.

@pomegranited
Copy link
Contributor

@haikuginger I think we need a 👍 from Product (@sstack22) before merge? @antoviaque can you confirm?

But your notes look fine. Thanks for doing the version bump!

@sstack22
Copy link

👍 !

@haikuginger haikuginger merged commit 45b0e1a into openedx:master Sep 23, 2016
@bradenmacdonald bradenmacdonald deleted the haikuginger/fix-background-button branch September 30, 2017 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants