Skip to content

Add assign custom button actions for button sets and service templates - #1341

Merged
jrafanie merged 1 commit into
ManageIQ:masterfrom
ohhAndy:add-custom-button-assign-actions
Nov 2, 2026
Merged

jrafanie merged 1 commit into
ManageIQ:masterfrom
ohhAndy:add-custom-button-assign-actions

Conversation

@ohhAndy

@ohhAndy ohhAndy commented Aug 18, 2026

Copy link
Copy Markdown
Member

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

@ohhAndy
ohhAndy force-pushed the add-custom-button-assign-actions branch 2 times, most recently from ae15e4e to 335781e Compare October 30, 2026 14:11
@jrafanie jrafanie closed this Oct 30, 2026
@jrafanie jrafanie reopened this Oct 30, 2026
@jrafanie

Copy link
Copy Markdown
Member

kicking tests now that ManageIQ/manageiq#23953 is merged

@ohhAndy
ohhAndy force-pushed the add-custom-button-assign-actions branch from 335781e to 3da614e Compare November 2, 2026 16:25
@miq-bot

miq-bot commented Nov 2, 2026

Copy link
Copy Markdown
Member

Checked commit ohhAndy@3da614e with ruby 3.3.12, rubocop 1.91.0, haml-lint 0.78.0, and yamllint 1.37.1
4 files checked, 0 offenses detected
Everything looks fine. 👍

resource_search(id, type).add_custom_button(data["button_id"])
action_result(true, "Button added to Service Template order")
end
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 jrafanie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, a few followup questions but not needed for this PR

@jrafanie
jrafanie merged commit bf76698 into ManageIQ:master Nov 2, 2026
1 check passed
@jrafanie jrafanie assigned jrafanie and unassigned Fryguy Nov 2, 2026
@ohhAndy
ohhAndy deleted the add-custom-button-assign-actions branch November 2, 2026 18:04
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.

4 participants