Remove unused display count feature

This commit is contained in:
Jason Zimdars
2025-04-09 14:54:53 -05:00
parent 6dfa75090f
commit c55501a6c8
5 changed files with 2 additions and 78 deletions
-11
View File
@@ -456,17 +456,6 @@
}
}
.card-count__selector {
inset: 0.5cqi 0.5cqi auto auto;
position: absolute;
text-align: start;
z-index: 1;
.popup {
inset: 1em 1em auto auto;
}
}
.input.boost__input {
--hover-size: 0;
--input-border-radius: 0;
-16
View File
@@ -5,10 +5,7 @@ class CardsController < ApplicationController
before_action :set_filter, only: :index
before_action :set_card, only: %i[ show edit update destroy ]
before_action :handle_display_count, only: :index
DISPLAY_COUNT_OPTIONS = [ 6, 12, 18, 24 ].freeze
DEFAULT_DISPLAY_COUNT = 6
RECENTLY_CLOSED_LIMIT = 100
def index
@@ -55,17 +52,4 @@ class CardsController < ApplicationController
def deleted_notice
"Card deleted" unless @card.creating?
end
def handle_display_count
if params[:set_display_count].present?
cookies[:display_count] = params[:set_display_count]
redirect_to cards_path(
params.permit(*Filter::PERMITTED_PARAMS, :collection_ids).except(:set_display_count)
)
end
end
def display_count
(cookies[:display_count] || DEFAULT_DISPLAY_COUNT).to_i
end
end
-11
View File
@@ -10,15 +10,4 @@ module CardsHelper
"--card-rotate: #{value}deg;"
end
def display_count_options
CardsController::DISPLAY_COUNT_OPTIONS.map do |count|
{
value: count,
label: count,
selected: @display_count == count,
id: "display-count-#{count}"
}
end
end
end
+2 -3
View File
@@ -3,7 +3,7 @@ module Filter::Params
PERMITTED_PARAMS = %i[
indexed_by assignment_status collection_ids creator_ids
assignee_ids stage_ids tag_ids terms display_count
assignee_ids stage_ids tag_ids terms
].freeze
def as_params
@@ -15,8 +15,7 @@ module Filter::Params
assignee_ids: assignees.ids,
stage_ids: stages.ids,
tag_ids: tags.ids,
terms: terms,
display_count: display_count
terms: terms
)
end
end
@@ -1,37 +0,0 @@
<div class="card-count__selector txt-x-small" data-controller="dialog" data-action="keydown.esc->dialog#close click@document->dialog#closeOnClickOutside">
<button class="btn borderless btn--circle"
data-action="click->dialog#open:stop"
aria-haspopup="dialog"
aria-expanded="false"
aria-controls="display-count-dialog">
<span><%= display_count %></span>
</button>
<dialog id="display-count-dialog"
class="popup panel flex-column align-start justify-start fill-white shadow"
data-dialog-target="dialog"
aria-label="Select number of tickets to display">
<% display_count_options.each do |option| %>
<div class="btn fill-transparent popup__item full-width">
<%= form_tag request.path, method: :get, class: "full-width" do %>
<% filter.as_params.each do |key, value| %>
<% if value.is_a?(Array) %>
<% value.each do |v| %>
<%= filter_hidden_field_tag key, v %>
<% end %>
<% else %>
<%= filter_hidden_field_tag key, value %>
<% end %>
<% end %>
<%= hidden_field_tag :set_display_count, option[:value] %>
<input type="checkbox"
id="<%= option[:id] %>"
<%= "checked" if option[:selected] %>
onChange="this.form.submit()"
aria-label="<%= option[:label] %>">
<label for="<%= option[:id] %>" class="overflow-ellipsis"><%= option[:label] %></label>
<% end %>
</div>
<% end %>
</dialog>
</div>