From 2ac6630bd66aa23ae96142b33a655bb3cf98a5ed Mon Sep 17 00:00:00 2001 From: Connor Riva Date: Fri, 15 Sep 2023 15:14:14 -0400 Subject: [PATCH] feat(UncontrolledTable): allow selectable attribute to be passed in with rows --- package.json | 2 +- src/components/Table/SortableTable.js | 2 ++ src/components/Table/SortableTable.spec.js | 15 +++++++++ src/components/Table/UncontrolledTable.js | 10 ++++-- .../Table/UncontrolledTable.spec.js | 31 +++++++++++++++++++ .../Table/UncontrolledTable.stories.js | 2 ++ 6 files changed, 59 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 24f816555..c644ca3e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@appfolio/react-gears", - "version": "8.6.1", + "version": "8.6.3-HudAllowDisablingSelectOfSpecificRows-1bc7ab3.0", "description": "React-based version of Gears", "author": "Appfolio, Inc.", "repository": { diff --git a/src/components/Table/SortableTable.js b/src/components/Table/SortableTable.js index 98656579d..9a99bfdc5 100644 --- a/src/components/Table/SortableTable.js +++ b/src/components/Table/SortableTable.js @@ -74,6 +74,7 @@ function defaultRenderRow( function getSelectableCell(row, rowSelected, onSelect) { const selectRowId = uniqueId('select-row-'); + const rowSelectable = Object.hasOwn(row, 'selectable') ? row.selectable : true; return ( <>