From 3b6fa192f3cba5c01f42fd3c600adc20181e0dad Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Fri, 2 Feb 2024 11:05:25 -0500 Subject: [PATCH] enable dynamic forms in the scripts#show page (#3330) --- apps/dashboard/app/javascript/script_show.js | 5 +++++ apps/dashboard/app/lib/account_cache.rb | 7 +++++-- apps/dashboard/app/views/scripts/show.html.erb | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 apps/dashboard/app/javascript/script_show.js diff --git a/apps/dashboard/app/javascript/script_show.js b/apps/dashboard/app/javascript/script_show.js new file mode 100644 index 0000000000..b27b4f58dd --- /dev/null +++ b/apps/dashboard/app/javascript/script_show.js @@ -0,0 +1,5 @@ +import { makeChangeHandlers } from './dynamic_forms'; + +jQuery(function() { + makeChangeHandlers('script'); +}); diff --git a/apps/dashboard/app/lib/account_cache.rb b/apps/dashboard/app/lib/account_cache.rb index a4557c0908..20e8059449 100644 --- a/apps/dashboard/app/lib/account_cache.rb +++ b/apps/dashboard/app/lib/account_cache.rb @@ -68,8 +68,11 @@ def queues end cluster_data = other_clusters.map do |other_cluster| - ["data-option-for-cluster-#{other_cluster}", false] - end.to_h + [ + ["data-option-for-cluster-#{other_cluster}", false], + ["data-option-for-auto-batch-clusters-#{other_cluster}", false] + ] + end.flatten(1).to_h cluster_queues.map do |queue| unless blocked_queue?(queue) diff --git a/apps/dashboard/app/views/scripts/show.html.erb b/apps/dashboard/app/views/scripts/show.html.erb index fa5d5db596..3dd672ab73 100644 --- a/apps/dashboard/app/views/scripts/show.html.erb +++ b/apps/dashboard/app/views/scripts/show.html.erb @@ -1,6 +1,7 @@

<%= @script.title %>

+<%= javascript_include_tag 'script_show', nonce: true %> <%= link_to 'Back', project_path(params[:project_id]), class: 'btn btn-default my-3', title: 'Return to projects page' %>