Skip to content

Commit

Permalink
[PLAY-1304] fix Kit Collection page when Pagination is present (#3369)
Browse files Browse the repository at this point in the history
**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](#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
<img width="1000" alt="pagination appears in kit collection"
src="https://github.com/powerhome/playbook/assets/83474365/18dab113-d4e3-4bcf-98a4-20ab05a8e8c6">
<img width="1000" alt="pagination appears in kit collection when first
item"
src="https://github.com/powerhome/playbook/assets/83474365/7fd881cd-4102-4d60-8da5-a33a00d4ed04">


**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.~~
  • Loading branch information
ElisaShapiro authored Apr 26, 2024
1 parent 26774f9 commit ed6b461
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions playbook-website/app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,14 @@ 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

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")
Expand Down

0 comments on commit ed6b461

Please # to comment.