Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[PLAY-235] BUGFIX - Classnames and global props in the list kit for rails #1981

Merged
merged 3 commits into from
Aug 5, 2022

Conversation

augustomallmann
Copy link
Contributor

@augustomallmann augustomallmann commented Jul 27, 2022

React Kit Coverage

Screens

Screen Shot 2022-07-27 at 1 36 38 PM

Breaking Changes

No breaking changes, bug fixing only.

Runway Ticket URL

[PLAY-235]

How to test this

List kit was not generating classnames for its props. Fixed that by replacing the array under list_classname to generate_classname function.

Create a list component using props as follows:

<%= pb_rails("list", props: { align_items: "stretch", flex_grow: 1, max_width: "xs", orientation: "column", padding_top: "sm" }) do %>
    <%= pb_rails("list/item") do %> List Item <% end %>
<% end %>

It should generate the following html:

<div class="pb_list_kit_ pt_sm max_width_xs align_items_stretch flex_grow_1">
  <ul>  
    <li class="pb_item_kit">
     List Item 
    </li>
  </ul>
</div>

Checklist:

  • LABELS Add a label: enhancement, bug, improvement, new kit, deprecated, or breaking. See Changelog & Labels for details.
  • DEPLOY Please add the Milano label when you are ready for a review.
  • SCREENSHOT Please add a screen shot or two.
  • SPECS Please cover your changes with specs.
  • READ DOCS Please make sure you have read and understand the Playbook Release Process

@augustomallmann augustomallmann added bug Fixes to issues discovered in Playbook (USED IN CHANGELOG) milano 20 MAX - Deploy this PR to a review environment via Milano not ready do not merge labels Jul 27, 2022
@augustomallmann augustomallmann requested a review from a team as a code owner July 27, 2022 16:45
@thestephenmarshall
Copy link
Contributor

@powerhome/ux-team

@augustomallmann
Copy link
Contributor Author

FIY: I have to change some test specs, as it was not generating the classnames I believe they were giving false positives. For example:

  • the example below is wrong because when you set dark as true, it adds a class dark:
    expect(subject.new(dark: true).list_classname).to eq "pb_list_kit_dark"
  • so the correct test should be:
    expect(subject.new(dark: true).list_classname).to eq "pb_list_kit_dark dark"

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
11.3.0 bug Fixes to issues discovered in Playbook (USED IN CHANGELOG) milano 20 MAX - Deploy this PR to a review environment via Milano
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants