8000 chore(table): update dropdown to button by mattnolting · Pull Request #6329 · patternfly/patternfly · GitHub
[go: up one dir, main page]

Skip to content

chore(table): update dropdown to button#6329

Closed
mattnolting wants to merge 3 commits intopatternfly:v6from
mattnolting:chore-table-replace-dropdown
Closed

chore(table): update dropdown to button#6329
mattnolting wants to merge 3 commits intopatternfly:v6from
mattnolting:chore-table-replace-dropdown

Conversation

@mattnolting
Copy link
Collaborator

applies to #6294

This PR updates table dropdowns to buttons in advance of updated padding/positioning values

@patternfly-build
Copy link
Collaborator
patternfly-build commented Feb 17, 2024

@mattnolting mattnolting force-pushed the chore-table-replace-dropdown branch 3 times, most recently from bd0ad52 to 4ad0d17 Compare February 17, 2024 16:45
@mattnolting mattnolting marked this pull request as ready for review February 17, 2024 16:46
{{#if table-td--toggle}}
<button class="{{pfv}}button pf-m-plain{{#if table-tr--expanded}} pf-m-expanded{{/if}}" {{#if table-td--button--attribute}}{{{table-td--button--attribute}}}{{/if}} {{#if table-tr--expanded}}aria-expanded="true"{{/if}}>
{{#if table-td--action}}
{{#> button button--IsSmall=table--IsCompact button--IsPlain=true button--id=(concat table--id '-action-kebab-' table-tr--index) button--aria-label="Actions"}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like table--IsCompact is used just for adjusting the button size. Should it also be used to add the pf-m-compact modifier?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done!

{{#if table-td--toggle}}
<button class="{{pfv}}button pf-m-plain{{#if table-tr--expanded}} pf-m-expanded{{/if}}" {{#if table-td--button--attribute}}{{{table-td--button--attribute}}}{{/if}} {{#if table-tr--expanded}}aria-expanded="true"{{/if}}>
{{#if table-td--action}}
{{#> button button--IsSmall=table--IsCompact button--IsPlain=true button--id=(concat table--id '-action-kebab-' table-tr--index) button--aria-label="Actions"}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like table-IsCompact is being used just to trigger a small button. Should it also be used to add the pf-m-compact modifier to the table?

Also, I'm wondering if it makes sense to make the button be a menu-toggle instead. Maybe not, since an action could be anything, but here it's used as a toggle for a menu, which makes it seem like it should be a menu-toggle then.

I think a kebab menu is probably the most frequent use case, so it's good to show that but at the same time, it's not the most basic example either. Curious what @mcoker thinks before changing anything. This could also definitely wait for a later day.

Copy link
Contributor
@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LMK if any of my comments are planned to be handled by another PR.

The overflow examples end up a bit visually broken:

Table overflow example with overflow menu content being pushed out of alignment by kebab toggle

Since the overflow menu is wrapped in a td with table-td--action="true"

Additionally expanded examples need to be updated to use table-td--IsToggle instead of table-td--toggle

{{#> table-td table-td--action="true"}}
{{> table--overflow-menu}}
{{/table-td}}
{{#> table-td table-td--action="true"}}{{/table-td}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan to add content between these tags, or for tabe-td--action to handle rendering whatever content? If the latter, could these be written without the hashtag, {{> table-td table-td--action="true"}}?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, sure could. Also don't need quotes for booleans {{> table-td table-td--action=true}}

@mattnolting mattnolting force-pushed the chore-table-replace-dropdown branch 3 times, most recently from 145d027 to 3e09a1d Compare February 21, 2024 16:49
{{~#if table-td--check}} {{pfv}}table__check{{/if}}
{{~#if table-td--action}} {{pfv}}table__action{{/if}}
{{~#if table-td--IsAction}} {{pfv}}table__action{{/if}}
{{~#if table-td--HasOverflowMenu}} {{pfv}}table__action{{/if}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs to be updated to table-td--UsesOverflowMenu as that is being used elsewhere. Currently nothing is being rendered in the last column of the overflow table examples.

{{/table-td}}
{{#> table-td table-td--action="true"}}
{{#> table-td table-td--IsAction=true}}
{{> dropdown dropdown--id=(concat table--id inline-edit--row '-dropdown-kebab') dropdown-toggle--IsPlain="true" dropdown-menu--modifier="pf-m-align-right"}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dropdown and line 395 just need to be removed.

{{/table-td}}
{{#> table-td table-td--action="true"}}
{{#> table-td table-td--IsAction=true}}
{{> dropdown dropdown--id=(concat card--id "-dropdown-kebab-1") dropdown-menu--modifier="pf-m-align-right" dropdown-toggle--IsPlain="true"}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above for removing these dropdowns in this file (also lines 91, 122 and 153)

Comment on lines 288 to 290
{{#> button button--modifier="pf-m-plain" button--attribute='aria-label="Remove"'}}
<i class="fas fa-ellipsis-h" aria-hidden="true"></i>
{{/button}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These buttons with the horizontal ellipsis could probably be removed as well

{{/table-td}}
{{#> table-td table-td--action="true"}}
{{#> table-td table-td--IsAction=true}}
{{> tabs--table-overflow-menu tabs--table-overflow-menu--id=(concat table--id "-dropdown-kebab-1")}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above this tabs--table-overflow-menu can be removed from the td's in this demo.

@mcoker
Copy link
Contributor
mcoker commented Mar 6, 2024

Per @mattnolting closing this PR, we'll update the dropdowns in a follow-up PR

@mcoker mcoker closed this Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

0