From ad3b7ef31922cab2c997d98214e68caa55697744 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 29 Mar 2025 15:38:02 +0100 Subject: [PATCH] Protect against an account without workflows Probably should make it such that a new account sets up the default workflows, but right now it doesnt, so protect against them by not showing the workflow filter. --- app/views/filters/_dialog.html.erb | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/views/filters/_dialog.html.erb b/app/views/filters/_dialog.html.erb index c9724f977..086d97472 100644 --- a/app/views/filters/_dialog.html.erb +++ b/app/views/filters/_dialog.html.erb @@ -77,19 +77,20 @@ <% end %> - -
  • In Stage
  • - <% workflow = Current.account.workflows.first %> - <% workflow.stages.each do |stage| %> -
  • - <%= label_tag "stage_ids_#{stage.id}", class: "btn filter__button" do %> - <%= check_box_tag "stage_ids[]", stage.id, filter.stages.include?(stage), id: "stage_ids_#{stage.id}", hidden: true %> - <%= stage.name %> - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> - <% end %> -
  • - <% end %> -
    + <% if workflow = Current.account.workflows.first %> + +
  • In Stage
  • + <% workflow.stages.each do |stage| %> +
  • + <%= label_tag "stage_ids_#{stage.id}", class: "btn filter__button" do %> + <%= check_box_tag "stage_ids[]", stage.id, filter.stages.include?(stage), id: "stage_ids_#{stage.id}", hidden: true %> + <%= stage.name %> + <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <% end %> +
  • + <% end %> +
    + <% end %>
    Tagged