Skip to content

Commit

Permalink
Collapse params by default (#263)
Browse files Browse the repository at this point in the history
Having expanded all of the params is very noisy. With this change we can also pack more jobs on page
  • Loading branch information
morgoth committed May 26, 2021
1 parent c756c0c commit b3dd40d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engine/app/controllers/good_job/dashboards_controller.rb
Expand Up @@ -14,7 +14,7 @@ def last
def jobs
after_scheduled_at = params[:after_scheduled_at].present? ? Time.zone.parse(params[:after_scheduled_at]) : nil
sql = GoodJob::Job.display_all(after_scheduled_at: after_scheduled_at, after_id: params[:after_id])
.limit(params.fetch(:limit, 10))
.limit(params.fetch(:limit, 25))
sql = sql.with_job_class(params[:job_class]) if params[:job_class]
if params[:state]
case params[:state]
Expand Down
8 changes: 7 additions & 1 deletion engine/app/views/shared/_jobs_table.erb
Expand Up @@ -19,7 +19,13 @@
<td><%= job.queue_name %></td>
<td><%= job.scheduled_at || job.created_at %></td>
<td><%= job.error %></td>
<td><pre><%= JSON.pretty_generate(job.serialized_params) %></pre></td>
<td>
<%= tag.button "Preview", type: "button", class: "btn btn-sm btn-outline-primary", role: "button",
data: {bs_toggle: "collapse", bs_target: "##{dom_id(job, 'params')}"},
aria: {expanded: false, controls: dom_id(job, "params")}
%>
<%= tag.pre JSON.pretty_generate(job.serialized_params), id: dom_id(job, "params"), class: "collapse" %>
</td>
</tr>
<% end %>
</tbody>
Expand Down

0 comments on commit b3dd40d

Please sign in to comment.