Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[IndexTable.Row] Add ability to hide selectable checkbox on a per row basis #11944

Merged
merged 1 commit into from May 2, 2024

Conversation

stefanlegg
Copy link
Contributor

@stefanlegg stefanlegg commented Apr 24, 2024

WHY are these changes introduced?

UX desires the ability to control if specific table rows shouldn't show a checkbox. This is particularly useful when you have an IndexTable that renders nested resources, but only has bulk actions that are applicable to the parent resource.

WHAT is this pull request doing?

Here's an example scenario where you might want to hide the selectable checkbox rather than just disabling it.

Before:
Index table with subheaders that have disabled checkboxes

After:
Index table with subheaders that dont show checkboxes at all

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

CodeSandbox Example

Steps:

  • Visit this example where hideSelectable is set to true for the subheader rows
    • Verify that no checkboxes are shown for the subheader rows
    • Verify that columns still line up as expected
  • Visit this example where hideSelectable is set to false
    • Verify that disabled checkboxes are still shown for for the subheader rows
  • Visit this example where hideSelectable is true and selectable is false on IndexTable
    • Verify that columns still line up as expected

🎩 checklist

@stefanlegg
Copy link
Contributor Author

/snapit

Copy link
Contributor

🫰✨ Thanks @stefanlegg! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-icons": "0.0.0-snapshot-20240424183419",
"@shopify/polaris-migrator": "0.0.0-snapshot-20240424183419",
"@shopify/polaris": "0.0.0-snapshot-20240424183419",
"@shopify/polaris-tokens": "0.0.0-snapshot-20240424183419",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240424183419"

@stefanlegg
Copy link
Contributor Author

/snapit

Copy link
Contributor

🫰✨ Thanks @stefanlegg! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-icons": "0.0.0-snapshot-20240424201602",
"@shopify/polaris-migrator": "0.0.0-snapshot-20240424201602",
"@shopify/polaris": "0.0.0-snapshot-20240424201602",
"@shopify/polaris-tokens": "0.0.0-snapshot-20240424201602",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240424201602"

@stefanlegg stefanlegg changed the title [DNM] Configure selectable at the IndexTable.Row level [IndexTable.Row] Add ability to hide selectable checkbox on a per row basis Apr 24, 2024
@stefanlegg stefanlegg marked this pull request as ready for review April 29, 2024 16:46
@stefanlegg stefanlegg marked this pull request as draft April 29, 2024 17:09
@stefanlegg stefanlegg marked this pull request as ready for review April 29, 2024 17:17
Copy link
Member

@chloerice chloerice left a comment

Choose a reason for hiding this comment

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

Tested locally and works as expected :shipit:

@chloerice chloerice dismissed jesstelford’s stale review April 30, 2024 18:05

(Requested context provided)

@stefanlegg stefanlegg merged commit d1d69e9 into main May 2, 2024
13 checks passed
@stefanlegg stefanlegg deleted the sl-selectable-row branch May 2, 2024 13:45
chloerice pushed a commit that referenced this pull request May 6, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/polaris@13.3.0

### Minor Changes

- [#11979](#11979)
[`982491f0f`](982491f)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added `animateIn`
transition option to Collapsible


- [#11967](#11967)
[`e50472f85`](e50472f)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added `variant`
prop to Collapsible

### Patch Changes

- [#11976](#11976)
[`4f3bf9948`](4f3bf99)
Thanks [@chloerice](https://github.com/chloerice)! - Fixed sibling
`FormLayout.Item` widths not remaining equal when wrapped in
`FormLayout.Group`


- [#11945](#11945)
[`b59743a76`](b59743a)
Thanks [@sophschneider](https://github.com/sophschneider)! - Added
offset width to reframe `Frame` and passed reframe scroll container to
sticky manager in `AppProvider`


- [#11965](#11965)
[`7a702388d`](7a70238)
Thanks [@sophschneider](https://github.com/sophschneider)! - Added
scrollbar styles for reframe


- [#11944](#11944)
[`d1d69e919`](d1d69e9)
Thanks [@stefanlegg](https://github.com/stefanlegg)! - Add support for
hiding selectable checkbox on a per `IndexTable.Row` basis via
`hideSelectable` prop\`


- [#11947](#11947)
[`995079cc7`](995079c)
Thanks [@sophschneider](https://github.com/sophschneider)! - Fixed
`Sticky` to update sticky items when props change

- Updated dependencies
\[[`12dbc2cd8`](12dbc2c),
[`8ce6211c9`](8ce6211),
[`7a702388d`](7a70238)]:
    -   @shopify/polaris-tokens@9.1.0

## @shopify/polaris-tokens@9.1.0

### Minor Changes

- [#11965](#11965)
[`7a702388d`](7a70238)
Thanks [@sophschneider](https://github.com/sophschneider)! - Added
`color-scrollbar-thumb-bg` token

### Patch Changes

- [#11981](#11981)
[`12dbc2cd8`](12dbc2c)
Thanks [@sophschneider](https://github.com/sophschneider)! - Updated
internal only whiteAlpha scale and dark experimental theme with new
values


- [#11853](#11853)
[`8ce6211c9`](8ce6211)
Thanks [@aaronccasanova](https://github.com/aaronccasanova)! - Added
`"sideEffect": "false"` to the `package.json` to enable treeshaking

## @shopify/polaris-migrator@1.0.2

### Patch Changes

- Updated dependencies
\[[`12dbc2cd8`](12dbc2c),
[`8ce6211c9`](8ce6211),
[`7a702388d`](7a70238)]:
    -   @shopify/polaris-tokens@9.1.0
    -   @shopify/stylelint-polaris@16.0.2

## @shopify/stylelint-polaris@16.0.2

### Patch Changes

- Updated dependencies
\[[`12dbc2cd8`](12dbc2c),
[`8ce6211c9`](8ce6211),
[`7a702388d`](7a70238)]:
    -   @shopify/polaris-tokens@9.1.0

## polaris-for-vscode@1.0.2

### Patch Changes

- Updated dependencies
\[[`12dbc2cd8`](12dbc2c),
[`8ce6211c9`](8ce6211),
[`7a702388d`](7a70238)]:
    -   @shopify/polaris-tokens@9.1.0

## polaris.shopify.com@1.0.5

### Patch Changes

- Updated dependencies
\[[`4f3bf9948`](4f3bf99),
[`b59743a76`](b59743a),
[`12dbc2cd8`](12dbc2c),
[`982491f0f`](982491f),
[`7a702388d`](7a70238),
[`8ce6211c9`](8ce6211),
[`e50472f85`](e50472f),
[`d1d69e919`](d1d69e9),
[`995079cc7`](995079c),
[`7a702388d`](7a70238)]:
    -   @shopify/polaris@13.3.0
    -   @shopify/polaris-tokens@9.1.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

None yet

3 participants