From 41a30d5d3a34c76ecb9d9b19ec7b5351f7fc6158 Mon Sep 17 00:00:00 2001 From: Martin Hradil Date: Tue, 30 Apr 2019 15:45:48 +0000 Subject: [PATCH] VM custom button dialog - use the VM instead of the parent service Triggering a VM-based custom button on a Service's VM Resource causes the right dialog to appear.. But the inital data assumes the associated resource is the service, not the VM. Subsequent field refresh requests and submit already use the VM, but the initial load was missed in https://github.com/ManageIQ/manageiq-ui-service/pull/1022. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1687061 --- .../custom_button_details/custom_button_details.state.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/app/states/services/custom_button_details/custom_button_details.state.js b/client/app/states/services/custom_button_details/custom_button_details.state.js index 6e9d3c858..e9a7af8b3 100644 --- a/client/app/states/services/custom_button_details/custom_button_details.state.js +++ b/client/app/states/services/custom_button_details/custom_button_details.state.js @@ -55,6 +55,10 @@ function StateController ($state, $stateParams, CollectionsApi, EventNotificatio target_id: vm.serviceId, target_type: 'service' } + if (vm.vmId) { + options.target_type = 'vm' + options.target_id = vm.vmId + } const dialogId = vm.resourceAction.dialog_id const resolveDialogs = CollectionsApi.query(`service_dialogs/${dialogId}`, options)