diff --git a/engine/app/views/good_job/cron_schedules/index.html.erb b/engine/app/views/good_job/cron_schedules/index.html.erb index 40f1c8d23..0e676659c 100644 --- a/engine/app/views/good_job/cron_schedules/index.html.erb +++ b/engine/app/views/good_job/cron_schedules/index.html.erb @@ -9,7 +9,14 @@ Set  <%= tag.button "Toggle", type: "button", class: "btn btn-sm btn-outline-primary", role: "button", data: { bs_toggle: "collapse", bs_target: ".job-properties" }, - aria: { expanded: false, controls: @cron_schedules.map { |job_key, _| "##{job_key.to_param}" }.join(" ") } + aria: { expanded: false, controls: @cron_schedules.map { |job_key, _| "#{job_key.to_param}-properties" }.join(" ") } + %> + + + Args  + <%= tag.button "Toggle", type: "button", class: "btn btn-sm btn-outline-primary", role: "button", + data: { bs_toggle: "collapse", bs_target: ".job-args" }, + aria: { expanded: false, controls: @cron_schedules.map { |job_key, _| "#{job_key.to_param}-args" }.join(" ") } %> Class @@ -30,9 +37,24 @@ "Lambda/Callable" when Hash tag.button("Preview", type: "button", class: "btn btn-sm btn-outline-primary", role: "button", - data: { bs_toggle: "collapse", bs_target: "##{job_key.to_param}" }, - aria: { expanded: false, controls: job_key.to_param }) + - tag.pre(JSON.pretty_generate(job[:set]), id: job_key.to_param, class: "collapse job-properties") + data: { bs_toggle: "collapse", bs_target: "##{job_key.to_param}-properties" }, + aria: { expanded: false, controls: "#{job_key.to_param}-properties" }) + + tag.pre(JSON.pretty_generate(job[:set]), id: "#{job_key.to_param}-properties", class: "collapse job-properties") + end + %> + + + <%= + case job[:args] + when NilClass + "None" + when Proc + "Lambda/Callable" + when Hash + tag.button("Preview", type: "button", class: "btn btn-sm btn-outline-primary", role: "button", + data: { bs_toggle: "collapse", bs_target: "##{job_key.to_param}-args" }, + aria: { expanded: false, controls: "#{job_key.to_param}-args" }) + + tag.pre(JSON.pretty_generate(job[:args]), id: "#{job_key.to_param}-args", class: "collapse job-args") end %> diff --git a/spec/test_app/config/environments/demo.rb b/spec/test_app/config/environments/demo.rb index e2f7e5be9..a8acfea1b 100644 --- a/spec/test_app/config/environments/demo.rb +++ b/spec/test_app/config/environments/demo.rb @@ -36,6 +36,7 @@ description: "Delete old jobs.", cron: "*/15 * * * *", class: "CleanupJob", - } + args: { limit: 1_000 }, + }, } end