Skip to content

Commit

Permalink
Remove limit items from playground.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieshark committed Sep 10, 2024
1 parent 319f859 commit 9eb76f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions demo/app/controllers/select_panel_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ def index
query = (params[:q] || "").downcase

results = if show_results
res = SELECT_PANEL_ITEMS.select do |item|
SELECT_PANEL_ITEMS.select do |item|
[item[:title], item[:description]].join(" ").downcase.include?(query)
end
params.fetch(:limit_items, -1).to_i >= 0 ? res.take(params[:limit_items].to_i) : res
else
[]
end
Expand Down
5 changes: 1 addition & 4 deletions previews/primer/alpha/select_panel_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class SelectPanelPreview < ViewComponent::Preview
# @param anchor_align [Symbol] select [start, center, end]
# @param anchor_side [Symbol] select [outside_bottom, outside_top, outside_left, outside_right]
# @param selected_items text
# @param limit_items number
def playground(
title: "Sci-fi equipment",
subtitle: "Various tools from your favorite shows",
Expand All @@ -32,13 +31,11 @@ def playground(
open_on_load: false,
anchor_align: :start,
anchor_side: :outside_bottom,
selected_items: "Phaser",
limit_items: 10
selected_items: "Phaser"
)
render_with_template(locals: {
subtitle: subtitle,
selected_items: selected_items,
limit_items: limit_items,
system_arguments: {
title: title,
size: size,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
select_variant: :single,
show_results: !simulate_no_results,
fail: simulate_failure,
selected_items: selected_items,
limit_items: limit_items
selected_items: selected_items
),
select_variant: :single,
fetch_strategy: :remote,
Expand Down

0 comments on commit 9eb76f1

Please sign in to comment.