From 0a8dd9463bc75aa84aab7ccdc1bbd0ccb392498f Mon Sep 17 00:00:00 2001 From: Ashton South Date: Thu, 22 Aug 2024 10:41:07 -0400 Subject: [PATCH 1/3] hide fixed attributes --- apps/dashboard/app/views/launchers/show.html.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/app/views/launchers/show.html.erb b/apps/dashboard/app/views/launchers/show.html.erb index c044865af3..036816d881 100644 --- a/apps/dashboard/app/views/launchers/show.html.erb +++ b/apps/dashboard/app/views/launchers/show.html.erb @@ -8,7 +8,10 @@ <%= bootstrap_form_for(@script, url: submit_project_launcher_path) do |f| %> <% @script.smart_attributes.each do |attrib| %> <%# TODO generate render_format %> - <%= create_widget(f, attrib, format: nil, hide_fixed: false) %> + <%= create_widget(f, attrib, format: nil) %> + <% if attrib.fixed? %> + <%= f.hidden_field(attrib.id, attrib.field_options) %> + <% end %> <% end %>
From 29e5c8a58eabac46c1e5ebded3aa58ec1cc41a42 Mon Sep 17 00:00:00 2001 From: Ashton South Date: Fri, 23 Aug 2024 11:39:01 -0400 Subject: [PATCH 2/3] handle fixed attributes in model --- apps/dashboard/app/models/launcher.rb | 12 +++++++++--- apps/dashboard/app/views/launchers/show.html.erb | 3 --- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/dashboard/app/models/launcher.rb b/apps/dashboard/app/models/launcher.rb index 9864896008..f65f935ec5 100644 --- a/apps/dashboard/app/models/launcher.rb +++ b/apps/dashboard/app/models/launcher.rb @@ -178,7 +178,13 @@ def update(params) end def submit(options) - adapter = adapter(options[:auto_batch_clusters]).job_adapter + cluster_id = if options.has_key?(:auto_batch_clusters) + options[:auto_batch_clusters] + else + smart_attributes.find { |sm| sm.id == 'auto_batch_clusters' }.value.to_sym + end + adapter = adapter(cluster_id).job_adapter + render_format = adapter.class.name.split('::').last.downcase job_script = OodCore::Job::Script.new(**submit_opts(options, render_format)) @@ -186,7 +192,7 @@ def submit(options) job_id = Dir.chdir(project_dir) do adapter.submit(job_script) end - update_job_log(job_id, options[:auto_batch_clusters].to_s) + update_job_log(job_id, cluster_id.to_s) write_job_options_to_cache(options) job_id @@ -345,7 +351,7 @@ def job_log_file def submit_opts(options, render_format) smart_attributes.map do |sm| - sm.value = options[sm.id.to_sym] + sm.value = options[sm.id.to_sym] unless sm.fixed? sm end.map do |sm| sm.submit(fmt: render_format) diff --git a/apps/dashboard/app/views/launchers/show.html.erb b/apps/dashboard/app/views/launchers/show.html.erb index 036816d881..72ea8b8a9a 100644 --- a/apps/dashboard/app/views/launchers/show.html.erb +++ b/apps/dashboard/app/views/launchers/show.html.erb @@ -9,9 +9,6 @@ <% @script.smart_attributes.each do |attrib| %> <%# TODO generate render_format %> <%= create_widget(f, attrib, format: nil) %> - <% if attrib.fixed? %> - <%= f.hidden_field(attrib.id, attrib.field_options) %> - <% end %> <% end %>
From c4fa5d9e9a5f5b7fcfea99af645a3325903be7b9 Mon Sep 17 00:00:00 2001 From: Ashton South Date: Fri, 23 Aug 2024 12:23:21 -0400 Subject: [PATCH 3/3] fix formatting --- apps/dashboard/app/models/launcher.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/dashboard/app/models/launcher.rb b/apps/dashboard/app/models/launcher.rb index f65f935ec5..7b315c4b89 100644 --- a/apps/dashboard/app/models/launcher.rb +++ b/apps/dashboard/app/models/launcher.rb @@ -178,11 +178,11 @@ def update(params) end def submit(options) - cluster_id = if options.has_key?(:auto_batch_clusters) - options[:auto_batch_clusters] - else - smart_attributes.find { |sm| sm.id == 'auto_batch_clusters' }.value.to_sym - end + cluster_id = if options.has_key?(:auto_batch_clusters) + options[:auto_batch_clusters] + else + smart_attributes.find { |sm| sm.id == 'auto_batch_clusters' }.value.to_sym + end adapter = adapter(cluster_id).job_adapter render_format = adapter.class.name.split('::').last.downcase