-
Notifications
You must be signed in to change notification settings - Fork 356
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
Toolbars - use send_checked, refactor params in miqToolbarOnClick #2398
Conversation
Travis restarted. |
Fixed specs (and a bug in JS when url_parms was undefined) :) |
@himdel: all the CC issues are easily fixable ;-) |
@martinpovolny Yes but do we actually want them fixed?
WDYT? :) (That said, 6d6755f should fix those warnings.) |
This pull request is not mergeable. Please rebase and repush. |
Please, fix this one. It's a readability issue. Also you are setting the standards here. So please, set it high ;-) |
hopefully cleaner, more obvious that it does two kinds of two kinds of things :) there should be no functional change (thus that explicit return undefined)
so that we no longer need to special-case id=LIST in miqToolbarOnClick (the magic LIST value remains used `ApplicationController::Buttons#custom_buttons`)
* we no longer use `url_parms` to know when to send `miq_grid_checks` * before: when ending with `_div` and nonempty, or containing `id=LIST` * now: when `send_checked` and nonempty * change: `params[:miq_grid_checks]` will be `nil` instead of `""` when nothing is selected * we always call `miqSerializeForm` when ending with `_div`, but clean up nothings * before: when `_div` and empty * now: always, but returns `""` for GTLs * (but the alternative of sending when _div and not send_checked or empty is probably wrong anyway) * the ? url_params variant is handled a bit differently * `?` position * before: this would affect any url_parms containing a question mark * now: url_parms needs to start with it * but not seeing any url_parms values where this would matter * multiple `?` * before: split[1] pretty much means just anything between the first two question marks * now: slice(1) will use the whole string * but not seeing any url_parms values where this would matter
Checked commits https://github.com/himdel/manageiq-ui-classic/compare/4a6aee37f8c343147eb26c66671c309fa1594db8~...b7f8ff4a3994147c96baa98a0c5b9e3defe17d39 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Ok, ok, updated to address CC warnings .. aand rebased :). |
Depends on ManageIQ/ui-components#185Fixes #588 (except for cleanup)
send_checked
propagate from toolbar definitions to the toolbar componentsend_checked: true
wheneverid=LIST
miqToolbarOnClick
and changes to usesend_checked
instead ofurl_params
when determining when to sendmiq_grid_checks
:miqToolbarOnClick differences
we no longer use
url_parms
to know when to sendmiq_grid_checks
_div
and nonempty, or containingid=LIST
send_checked
and nonemptyparams[:miq_grid_checks]
will benil
instead of""
when nothing is selected even for custom buttonswe always call
miqSerializeForm
when ending with_div
, but clean up nothings_div
and (gridChecks
) empty""
for GTLsthe ? url_params variant is handled a bit differently
?
position?
Cc @martinpovolny