From ad3b7ef31922cab2c997d98214e68caa55697744 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 29 Mar 2025 15:38:02 +0100 Subject: [PATCH 1/5] 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
    From 57ad7d169c10050347e46e899363e64ead0cee0d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 29 Mar 2025 15:40:59 +0100 Subject: [PATCH 2/5] If there are no tags, show no tag column for the filter --- app/views/filters/_dialog.html.erb | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/views/filters/_dialog.html.erb b/app/views/filters/_dialog.html.erb index 086d97472..4174ee048 100644 --- a/app/views/filters/_dialog.html.erb +++ b/app/views/filters/_dialog.html.erb @@ -92,18 +92,20 @@ <% end %> -
    -
    Tagged
    - <% Current.account.tags.order(:title).each do |tag| %> -
    - -
    - <% end %> -
    + <% if (tags = Current.account.tags.order(:title)).any? %> +
    +
    Tagged
    + <% tags.each do |tag| %> +
    + +
    + <% end %> +
    + <% end %>
    Assigned to…
    From 3faea3c39caf5a1644751636df81325e3ec2c341 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 29 Mar 2025 15:43:54 +0100 Subject: [PATCH 3/5] Proper spacing --- app/views/filters/_dialog.html.erb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/filters/_dialog.html.erb b/app/views/filters/_dialog.html.erb index 4174ee048..f55779b1a 100644 --- a/app/views/filters/_dialog.html.erb +++ b/app/views/filters/_dialog.html.erb @@ -45,6 +45,7 @@ All Collections <% end %> + <% Current.user.buckets.order(:name).each do |bucket| %>
  • <%= label_tag "bucket_ids_#{bucket.id}", class: "btn filter__button" do %> @@ -95,6 +96,7 @@ <% if (tags = Current.account.tags.order(:title)).any? %>
    Tagged
    + <% tags.each do |tag| %>
    \ No newline at end of file +
    diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index a6216bbbf..3144288ed 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -10,7 +10,7 @@
  • <%= link_to account_users_path, class: "btn flex-item-justify-end" do %> - <%= image_tag "settings.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "settings" %> Account settings <% end %> @@ -38,7 +38,7 @@

    Collections

    <%= link_to new_bucket_path, class: "btn txt-xx-small flex-item-justify-end flex-item-no-shrink", style: "view-transition-name: new-bucket" do %> - <%= image_tag "add.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "add" %> New <% end %>
    diff --git a/app/views/filters/_assignees.html.erb b/app/views/filters/_assignees.html.erb index d03fe5ccf..500d5c720 100644 --- a/app/views/filters/_assignees.html.erb +++ b/app/views/filters/_assignees.html.erb @@ -32,7 +32,7 @@ }, "unassigned" %> <%= form.label :assignment_status, "No one", class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %>
    <% Current.account.users.active.order(:name).each do |user| %> @@ -44,10 +44,10 @@ }, user.id %> <%= form.label "assignee_ids[]", user.name, for: dom_id(user, :filter), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/filters/_buckets.html.erb b/app/views/filters/_buckets.html.erb index a6ce05184..20449c917 100644 --- a/app/views/filters/_buckets.html.erb +++ b/app/views/filters/_buckets.html.erb @@ -26,9 +26,9 @@ }, bucket.id %> <%= form.label "bucket_ids[]", bucket.name, for: dom_id(bucket, :filter), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> - \ No newline at end of file + diff --git a/app/views/filters/_creators.html.erb b/app/views/filters/_creators.html.erb index 83fc7c69f..557778c09 100644 --- a/app/views/filters/_creators.html.erb +++ b/app/views/filters/_creators.html.erb @@ -34,7 +34,7 @@ }, Current.user.id %> <%= form.label :creator_ids, "Me", for: form.field_id(:creator_ids, Current.user.id), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% Current.account.users.active.without(Current.user).order(:name).each do |user| %> @@ -47,7 +47,7 @@ }, user.id %> <%= form.label :creator_ids, user.name, for: form.field_id(:creator_ids, user.id), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> diff --git a/app/views/filters/_dialog.html.erb b/app/views/filters/_dialog.html.erb index f55779b1a..ecf1c1b9a 100644 --- a/app/views/filters/_dialog.html.erb +++ b/app/views/filters/_dialog.html.erb @@ -4,13 +4,13 @@

    - <%= image_tag "filter.svg", aria: { hidden: true }, size: 30 %> + <%= icon_tag "filter", size: 30 %> Filter

    @@ -26,7 +26,7 @@ <% end %> @@ -51,7 +51,7 @@ <%= label_tag "bucket_ids_#{bucket.id}", class: "btn filter__button" do %> <%= check_box_tag "bucket_ids[]", bucket.id, filter.buckets.include?(bucket), id: "bucket_ids_#{bucket.id}", hidden: true %> <%= bucket.name %> - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> <% end %> <% end %> @@ -63,7 +63,7 @@ <%= label_tag "indexed_by_#{filter.default_indexed_by}", class: "btn filter__button" do %> <%= radio_button_tag "indexed_by", filter.default_indexed_by, filter.default_indexed_by?, hidden: true %> Most active - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> <% end %> @@ -72,7 +72,7 @@ <% end %> @@ -86,7 +86,7 @@ <%= 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 %> + <%= icon_tag "close" %> <% end %> <% end %> @@ -96,13 +96,13 @@ <% if (tags = Current.account.tags.order(:title)).any? %>
    Tagged
    - + <% tags.each do |tag| %>
    <% end %> @@ -119,7 +119,7 @@ action: "filter-form#clearCategory", filter_form_name_param: "assignee_ids[],assigner_ids[]" } %> No one - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %>
    @@ -129,7 +129,7 @@ class: "visually-hidden", data: { action: "filter-form#clearCategory", filter_form_name_param: "assignment_status" } %> Me - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> @@ -139,7 +139,7 @@ <%= check_box_tag "assignee_ids[]", user.id, filter.assignees.include?(user), class: "visually-hidden", data: { action: "filter-form#clearCategory", filter_form_name_param: "assignment_status" } %> <%= user.name %> - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> <% end %> @@ -153,7 +153,7 @@ <%= check_box_tag "creator_ids[]", Current.user.id, filter.creators.include?(Current.user), class: "visually-hidden" %> Me - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> @@ -162,7 +162,7 @@ <% end %> @@ -173,13 +173,13 @@
    <%= tag.button class: "btn", form: :filter_form, formaction: filters_path, formmethod: :post do %> - <%= image_tag "bubbles.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "bubbles" %> Save collection <% end %>
    diff --git a/app/views/filters/_filter.html.erb b/app/views/filters/_filter.html.erb index d76e0a232..e058941fe 100644 --- a/app/views/filters/_filter.html.erb +++ b/app/views/filters/_filter.html.erb @@ -17,10 +17,10 @@
    <%= link_to bubbles_path(**filter.as_params), class: "txt-ink" do %> - <%= image_tag "filter.svg", aria: { hidden: true }, size: 24, class: "flex-inline", style: "vertical-align: bottom" %> <%= filter.summary %> + <%= icon_tag "filter", class: "flex-inline", style: "vertical-align: bottom" %> <%= filter.summary %> <% end %> <%= button_to filter_path(filter), method: :delete, class: "btn txt-small btn--negative bucket__button", data: { turbo_confirm: "Are you sure you want to delete this filter?" } do %> - <%= image_tag "minus.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "minus" %> Delete <% end %>
    diff --git a/app/views/filters/_indexed_by.html.erb b/app/views/filters/_indexed_by.html.erb index 34401948a..79271b248 100644 --- a/app/views/filters/_indexed_by.html.erb +++ b/app/views/filters/_indexed_by.html.erb @@ -22,7 +22,7 @@ data: { action: "change->form#submit" } %> <%= form.label :indexed_by, "Most active", value: filter.default_indexed_by, class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% Filter::INDEXES.each do |index| %> @@ -32,7 +32,7 @@ data: { action: "change->form#submit" } %> <%= form.label :indexed_by, index.humanize, value: index, class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> diff --git a/app/views/filters/_settings.html.erb b/app/views/filters/_settings.html.erb index cb05c017e..a266f33e1 100644 --- a/app/views/filters/_settings.html.erb +++ b/app/views/filters/_settings.html.erb @@ -1,6 +1,6 @@
    @@ -18,7 +18,7 @@ <% if any_filters?(filter) %> <%= link_to bubbles_path, class: "btn btn--remove txt-small" do %> - <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "close" %> Clear all <% end %> <% end %> diff --git a/app/views/filters/_stages.html.erb b/app/views/filters/_stages.html.erb index 3798a53d0..01ea278b5 100644 --- a/app/views/filters/_stages.html.erb +++ b/app/views/filters/_stages.html.erb @@ -31,7 +31,7 @@ }, stage.id %> <%= form.label :stage_ids, stage.name, for: form.field_id(:stage_ids, stage.id), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %>
    <% end %> <% end %> diff --git a/app/views/filters/_tags.html.erb b/app/views/filters/_tags.html.erb index fa35e8a8c..178f62098 100644 --- a/app/views/filters/_tags.html.erb +++ b/app/views/filters/_tags.html.erb @@ -31,10 +31,10 @@ }, tag.id %> <%= form.label "tag_ids[]", tag.hashtag, for: dom_id(tag, :filter), class: "overflow-ellipsis" %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 18, class: "checked flex-item-justify-end" %> + <%= icon_tag "check", size: 18, class: "checked flex-item-justify-end" %> <% end %> <% end %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/first_runs/show.html.erb b/app/views/first_runs/show.html.erb index 476fbe987..16409b528 100644 --- a/app/views/first_runs/show.html.erb +++ b/app/views/first_runs/show.html.erb @@ -28,7 +28,7 @@ <% end %> diff --git a/app/views/notifications/_tray.html.erb b/app/views/notifications/_tray.html.erb index 5ec51494a..8e12e58f4 100644 --- a/app/views/notifications/_tray.html.erb +++ b/app/views/notifications/_tray.html.erb @@ -20,7 +20,7 @@ <%= button_to notifications_mark_all_read_path, class: "notification-tray__read_action btn btn--reversed fill-transparent borderless flex-item-justify-start shadow txt-xx-small", data: { action: "click->dialog#close", turbo_frame: "notifications" } do %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 24 %> + <%= icon_tag "check" %> Mark all read <% end %> diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb index c35e37f5b..3eb51f2bb 100644 --- a/app/views/notifications/index.html.erb +++ b/app/views/notifications/index.html.erb @@ -3,7 +3,7 @@ <% content_for :header do %>