From ed6b4612baa0c0abbfd4666f0d2d9ea20b1cf87a Mon Sep 17 00:00:00 2001
From: Elisa Shapiro <83474365+ElisaShapiro@users.noreply.github.com>
Date: Fri, 26 Apr 2024 10:56:35 -0400
Subject: [PATCH] [PLAY-1304] fix Kit Collection page when Pagination is
present (#3369)
**What does this PR do?** A clear and concise description with your
runway ticket url.
[PLAY-1304](https://nitro.powerhrg.com/runway/backlog_items/PLAY-1304)
allows for pagination to appear in a kit_collection. This ticket is
similar to one noticed on the [Navigation kit_show
page](https://playbook.powerapp.cloud/kit_category/navigation?type=rails)
due to Pagination which was fixed in
[PLAY-1266](https://github.com/powerhome/playbook/pull/3296).
I have also removed the `kit_collection_show` method from the pages
controller as it has been made redundant by `kit_collection_show_rails`
and `kit_collection_show_react` (side note: doesn't look like there is
the ability to see a swift kit_collection yet on live per my testing
[example
here](https://playbook.powerapp.cloud/kit_collection/button&dialog/swift)).
The routes and kit_collection view must remain unchanged or there is
funky behavior with the URL/query parameters and too much defaulting to
rails.
**Screenshots:**
Screenshots below show Pagination appearing in kit collection when 1st
or subsequent item in the kit collection
**How to test?** Steps to confirm the desired behavior:
1. Go to a kit collection with pagination included ([Table and
Pagination](https://playbook.powerapp.cloud/kit_collection/table&pagination/),
[Pagination and
Table](https://playbook.powerapp.cloud/kit_collection/pagination&table/),
[Table and Pagination with /rails in URL](
https://playbook.powerapp.cloud/kit_collection/table&pagination/rails))
2. If not already on Pagination in Nav, click on Pagination Nav tab
3. Pagination kit example should appear in kit_collection view without
error
#### Checklist:
- [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new
kit`, `deprecated`, or `breaking`. See [Changelog &
Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels)
for details.
- [x] **DEPLOY** I have added the `milano` label to show I'm ready for a
review.
~~- [ ] **TESTS** I have added test coverage to my code.~~
---
playbook-website/app/controllers/pages_controller.rb | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/playbook-website/app/controllers/pages_controller.rb b/playbook-website/app/controllers/pages_controller.rb
index b7b3f56cfd..049529ec9c 100755
--- a/playbook-website/app/controllers/pages_controller.rb
+++ b/playbook-website/app/controllers/pages_controller.rb
@@ -95,6 +95,7 @@ def kit_show_swift
end
def kit_collection_show_rails
+ @users = Array.new(9) { Faker::Name.name }.paginate(page: params[:page], per_page: 2)
handle_kit_collection("rails")
end
@@ -102,10 +103,6 @@ def kit_collection_show_react
handle_kit_collection("react")
end
- def kit_collection_show
- handle_kit_collection(params[:type])
- end
-
def kit_playground_rails
@kit = "avatar"
@examples = pb_doc_kit_examples(@kit, "rails")