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

RHSM form - use observe queue for submit #3191

Merged
merged 3 commits into from
Aug 16, 2018
Merged

RHSM form - use observe queue for submit #3191

merged 3 commits into from
Aug 16, 2018

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Jan 8, 2018

Ops (Configuration) > Settings, select Region, tab Red Hat Updates
Edit Registration - fill out inputs too quickly and hit Register

clicking the Register button too fast would mean the attempt to save the form happened before the last input changed

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1532201

@himdel himdel changed the title RHSM form - use observe queue for submit [WIP] RHSM form - use observe queue for submit Jan 8, 2018
@himdel
Copy link
Contributor Author

himdel commented Jan 8, 2018

wip because the template is not actually used on that screen, apparently

EDIT: now using the right template

@himdel himdel added the wip label Jan 8, 2018
@miq-bot miq-bot closed this Jul 9, 2018
@miq-bot
Copy link
Member

miq-bot commented Jul 9, 2018

This pull request has been automatically closed because it has not been updated for at least 6 months.

Feel free to reopen this pull request if these changes are still valid.

Thank you for all your contributions!

@himdel himdel deleted the rhn-submit-bz1532201 branch July 16, 2018 13:18
@himdel himdel restored the rhn-submit-bz1532201 branch August 10, 2018 14:19
@himdel
Copy link
Contributor Author

himdel commented Aug 10, 2018

app/views/ops/_settings_rhn_edit_tab.html.haml is the right template

except for the save button, which comes from /layouts/x_edit_buttons via /layouts/x_form_buttons

current:

Validate is using data-remote="true" & href="/ops/rhn_validate/new?button=validate&type=customer"
=> fixed to use miqAjaxButton with observeQueue: true

Save is using miqAjaxButton('/ops/settings_update/rhn_edit?button=save', false);
=> updated x_edit_buttons to optionally add observeQueue: true, and enabled that option for the form

@himdel himdel reopened this Aug 10, 2018
@himdel
Copy link
Contributor Author

himdel commented Aug 10, 2018

@miq-bot remove_label wip

@miq-bot miq-bot changed the title [WIP] RHSM form - use observe queue for submit RHSM form - use observe queue for submit Aug 10, 2018
@miq-bot miq-bot removed the wip label Aug 10, 2018
this allows miqAjaxButton to be queued in the same queue used by miq-observe,
thus waiting for any miq-observe requests to complete before submitting the form

https://bugzilla.redhat.com/show_bug.cgi?id=1532201
validate:
  this is a straight transform from link_to + RJS remote: true,
  to a button using miqAjaxButton

  except adding observe:true so that the validate action never happens before any pending edit actions

  (auth_credentials2 is only ever used from that single Red Hat Updates edit form)

save:
  just enabling observe=true for x_edit_buttons in settings_rhn_edit

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1532201
@miq-bot
Copy link
Member

miq-bot commented Aug 13, 2018

Checked commits https://github.com/himdel/manageiq-ui-classic/compare/e1f81401153cdc2a3b0d94f7836ed5f6114ec8c4~...f3b9b791e8db0f9c4145fe395f9046b2ff97d4c4 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.6-compliant syntax, but you are running 2.3.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

@mzazrivec mzazrivec self-assigned this Aug 16, 2018
@mzazrivec mzazrivec added this to the Sprint 93 Ending Aug 27, 2018 milestone Aug 16, 2018
@mzazrivec mzazrivec merged commit 0efea53 into ManageIQ:master Aug 16, 2018
@himdel himdel deleted the rhn-submit-bz1532201 branch August 16, 2018 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants