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.
This commit is contained in:
David Heinemeier Hansson
2025-03-29 15:38:02 +01:00
parent cdfdee9bd0
commit ad3b7ef319
+14 -13
View File
@@ -77,19 +77,20 @@
<% end %>
</menu>
<menu class="filter__menu">
<li class="filter__label"><strong>In Stage</strong></li>
<% workflow = Current.account.workflows.first %>
<% workflow.stages.each do |stage| %>
<li>
<%= 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 %>
<span><%= stage.name %></span>
<%= image_tag "close.svg", aria: { hidden: true }, size: 24 %>
<% end %>
</li>
<% end %>
</menu>
<% if workflow = Current.account.workflows.first %>
<menu class="filter__menu">
<li class="filter__label"><strong>In Stage</strong></li>
<% workflow.stages.each do |stage| %>
<li>
<%= 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 %>
<span><%= stage.name %></span>
<%= image_tag "close.svg", aria: { hidden: true }, size: 24 %>
<% end %>
</li>
<% end %>
</menu>
<% end %>
<div class="filter__menu" role="group" aria-label="Tagged">
<div class="filter__label"><strong>Tagged</strong></div>