Skip to content

Commit

Permalink
Hide fixed attributes (#3745)
Browse files Browse the repository at this point in the history
Project manager to hide fixed values in launchers#show.
  • Loading branch information
ashton22305 authored Aug 23, 2024
1 parent d321b86 commit e02caed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions apps/dashboard/app/models/launcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,21 @@ 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))

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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/app/views/launchers/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<%= 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) %>
<% end %>

<div class="d-grid gap-2">
Expand Down

0 comments on commit e02caed

Please sign in to comment.