-
Notifications
You must be signed in to change notification settings - Fork 289
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
Fixes #30350 - adds the scoped_search form parameter #8824
Fixes #30350 - adds the scoped_search form parameter #8824
Conversation
Issues: #30350 |
dd743d4
to
8ed1199
Compare
8ed1199
to
3f05ecc
Compare
This change does fix the problem but it took me a little while to figure out why you had to go the route you did, and I learned some things:
katello/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js Lines 286 to 310 in ab15cbb
OK, rant over :) The |
@jturel thank you for the feedback. This is precisely the sort of review I like to get. I think the request to make the state of the selection more apparent is a good one. Let me see what we can come up with. |
@jturel I don't think the additional attribute is passed directly to the API. In both controllers the returned data from nutupane I'm not sure what the other controllers do, so I'm looking into that now. |
@@ -38,6 +38,7 @@ <h4 data-block="modal-header" translate>Update Packages</h4> | |||
<input type="hidden" name="host_ids" ng-value="packageActionFormValues.hostIds"/> | |||
<input type="hidden" name="authenticity_token" ng-value="packageActionFormValues.authenticityToken"/> | |||
<input type="hidden" name="customize" ng-value="packageActionFormValues.customize"/> | |||
<input type="hidden" ng-if="scopedSearch" name="scoped_search" ng-value="errataActionFormValues.scopedSearch"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be packageActionFormValues.scopedSearch
$scope.packageActionFormValues.hostIds = selectedHosts.included.ids.join(','); | ||
} | ||
|
||
if (selectedHosts.allResultsSelected) { | ||
$scope.scopedSearch = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about this?
$scope.allHostsSelected = selectedHosts.allResultsSelected;
if ($scope.allHostsSelected) {
...
}
That way you don't need to track scopedSearch
separately and you can use it in the view as part of your conditional logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
...javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js
Outdated
Show resolved
Hide resolved
...vascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js
Show resolved
Hide resolved
if (selectedHosts.included.ids) { | ||
if ($scope.allHostsSelected) { | ||
$scope.packageActionFormValues.scopedSearch = selectedHosts.included.search; | ||
} elseif (selectedHosts.included.ids.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it should be 'else if' 🙄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah the linter smacked my hand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works perfectly - APJ
…an empty array of host ids
c84230d
to
81ef393
Compare
This PR repairs bulk host actions for errata (and packages) modals from the content hosts summary page.
The "scoped_search" form parameter was missing and here we attempt to populate that value before the form is submitted.
To test this change, register at least as many content hosts as the page volume allows, plus 1 more. (You want more hosts to be selectable than can be shown in 1 page of results.)
Next, select top checkbox for all hosts, then click the "Select All ..." link near the top to the results table. Then choose an action from the Select Action option, picking "Manage Errata".
Assuming there is applicable errata indicated for at least one of the hosts, select that errata. Then click "Install" with the "remote execution" option. The subsequent task to install the errata should be applied against all hosts (not just the ones shown on the first page).
Note that the same errors appear for "Manage Packages", and this PR repairs that functionality as well.