Repository navigation
Add assign custom button actions for button sets and service templates - #1341
Conversation
ae15e4e to
335781e
Compare
|
kicking tests now that ManageIQ/manageiq#23953 is merged |
335781e to
3da614e
Compare
|
Checked commit ohhAndy@3da614e with ruby 3.3.12, rubocop 1.91.0, haml-lint 0.78.0, and yamllint 1.37.1 |
| resource_search(id, type).add_custom_button(data["button_id"]) | ||
| action_result(true, "Button added to Service Template order") | ||
| end | ||
| end |
There was a problem hiding this comment.
As discussed in chat, we found that api_action handles the rescue and re-raise so it's actually a better pattern to follow. So, I'm 👍 on this.
| 2.times do | ||
| post(api_service_template_url(nil, service_template), :params => {:action => "add_custom_button", :button_id => button.id}) | ||
| expect(response).to have_http_status(:ok) | ||
| end |
There was a problem hiding this comment.
It's good we don't add it multiple times but I'm curious if subsequent "add button" requests should fail if it's already added. I'm not sure what we do with other API endpoints when adding something already added, so it might be better to review later on and see if it makes sense based on other patterns we have.
jrafanie
left a comment
There was a problem hiding this comment.
LGTM, a few followup questions but not needed for this PR
Depends on ManageIQ/manageiq#23953
Adds assign_custom_button resource actions for custom button sets and service templates, wires the new actions into config/api.yml
@miq-bot add-label enhancement
@miq-bot add-reviewer @Fryguy
@miq-bot assign @Fryguy