Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAY-1327] Add Variants Specification to Kit Collection View (#3516)
**What does this PR do?** - ✅ Lets a user specify variants on the kit_collection page by URL. - ✅ Add optional parameter, (/*variants), to routes.rb. Pass variable in pages controller. - ✅ Add variants argument to `pb_kit` function and filter examples if variants are specified. - ✅ Add variants to `pb_rails` nav links and `pb_kit` in Kit Collection view kit_collection/*names/(/:name)**(/*variants)**(/:type) E.g., /kit_collection/title&card&avatar/card/**title_default&card_background&avatar_monogram** would only show "title_default", "card_background", and "avatar_monogram" variants. This should help out with handoffs. We'll be able to specify only the relevant variants. Later, we'll look into making a UI to build out these links. **Screenshots:** ![Zight 2024-07-22 at 2 50 13 PM](https://github.com/user-attachments/assets/e8e02797-ba1f-4657-85fa-ba7491bb8a94) **How to test?** 1. Go to https://pr3516.playbook.beta.px.powerapp.cloud/kit_collection/title&card&avatar/title/title_default&title_responsive&card_background&avatar_monogram/react 2. You should only see two Title variants: "Default UI" and "Responsive" 3. Click "Card" in the top nav bar 4. You should see one Card variant: "Card Backgrounds" 5. Go to https://pr3516.playbook.beta.px.powerapp.cloud/kit_collection/title&card&avatar/ 6. You should see all the variants for Title on this page. 7. Click "Avatar" in the top nav bar 8. You should see all the variants for Avatar on this page. #### 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.
- Loading branch information