From c3dbd5f8f0fd7dccd5ff737d5076858b0f0446fd Mon Sep 17 00:00:00 2001 From: Gilbert Cherrie Date: Wed, 8 May 2024 14:19:24 -0400 Subject: [PATCH] Fix ansible tower and embedded workflows lists --- app/controllers/configuration_script_controller.rb | 4 ++-- app/helpers/application_helper.rb | 2 ++ app/helpers/application_helper/title.rb | 2 ++ app/javascript/oldjs/services/dialog_editor_http_service.js | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/configuration_script_controller.rb b/app/controllers/configuration_script_controller.rb index 059885be567..8956e157a63 100644 --- a/app/controllers/configuration_script_controller.rb +++ b/app/controllers/configuration_script_controller.rb @@ -14,8 +14,8 @@ class ConfigurationScriptController < ApplicationController menu_section :at feature_for_actions controller_name, *ADV_SEARCH_ACTIONS - def self.table_name - @table_name ||= "configuration_script" + def self.model + ManageIQ::Providers::ExternalAutomationManager::ConfigurationScript end def button diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3ea8268bed3..d8e989f7370 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -399,6 +399,8 @@ def db_to_controller(db, action = "show") action = "show" when "ServiceResource", "ServiceTemplate" controller = "catalog" + when "ManageIQ::Providers::ExternalAutomationManager::ConfigurationScript" + controller = "configuration_script" when "ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Playbook" controller = "ansible_playbook" when "ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Credential" diff --git a/app/helpers/application_helper/title.rb b/app/helpers/application_helper/title.rb index 356758a0861..92a30021ed0 100644 --- a/app/helpers/application_helper/title.rb +++ b/app/helpers/application_helper/title.rb @@ -85,6 +85,8 @@ def title_from_layout(layout) _("Utilization") when /^miq_request/ _("Requests") + when "configuration_script" + _("Templates") when "manageiq/providers/ansible_tower/automation_manager/playbook" _("Playbooks (Ansible Tower)") when "manageiq/providers/embedded_ansible/automation_manager/playbook" diff --git a/app/javascript/oldjs/services/dialog_editor_http_service.js b/app/javascript/oldjs/services/dialog_editor_http_service.js index 269ed32be61..6ce128cfb3f 100644 --- a/app/javascript/oldjs/services/dialog_editor_http_service.js +++ b/app/javascript/oldjs/services/dialog_editor_http_service.js @@ -34,7 +34,7 @@ ManageIQ.angular.app.service('DialogEditorHttp', ['$http', 'API', function($http /** Function to load all available workflows when 'Embedded Workflow' is selected for dynamic field. */ this.loadAvailableWorkflows = () => { - const url = '/api/configuration_script_payloads/?expand=resources&attributes=configuration_script_source.name'; + const url = '/api/configuration_script_payloads/?expand=resources&attributes=configuration_script_source.name&collection_class=ManageIQ::Providers::Workflows::AutomationManager::Workflow'; return API.get(url); };