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

fix(TableHead): add id prop on TableExpandHeader #3611

Merged
merged 3 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/P
<th
className="bx--table-expand"
data-testid="null-table-head-row-expansion-column"
id="table-12-expand"
scope="col"
/>
<th
Expand Down Expand Up @@ -1351,7 +1352,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/P
>
<td
className="bx--table-expand"
headers="expand"
headers="table-12-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -1737,7 +1738,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/P
>
<td
className="bx--table-expand"
headers="expand"
headers="table-12-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -2601,6 +2602,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/P
<th
className="bx--table-expand"
data-testid="null-table-head-row-expansion-column"
id="table-13-expand"
scope="col"
/>
<th
Expand Down Expand Up @@ -3554,7 +3556,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/P
>
<td
className="bx--table-expand"
headers="expand"
headers="table-13-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -3940,7 +3942,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/P
>
<td
className="bx--table-expand"
headers="expand"
headers="table-13-expand"
>
<button
aria-label="Click to expand content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
<th
className="bx--table-expand"
data-testid="null-table-head-row-expansion-column"
id="table-19-expand"
scope="col"
/>
<th
Expand Down Expand Up @@ -1916,7 +1917,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -2302,7 +2303,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -2655,7 +2656,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -3008,7 +3009,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -3394,7 +3395,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -3780,7 +3781,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -4166,7 +4167,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -4552,7 +4553,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -4905,7 +4906,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down Expand Up @@ -5291,7 +5292,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/U
>
<td
className="bx--table-expand"
headers="expand"
headers="table-19-expand"
>
<button
aria-label="Click to expand content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ const TableBodyRow = ({
isExpanded ? (
<Fragment key={id}>
<TableExpandRow
expandHeader={`${tableId}-expand`}
className={classnames(`${iotPrefix}--expandable-tablerow--expanded`, {
[`${iotPrefix}--expandable-tablerow--indented`]: parseInt(nestingOffset, 10) > 0,
})}
Expand Down Expand Up @@ -409,6 +410,7 @@ const TableBodyRow = ({
) : (
<TableExpandRow
key={id}
expandHeader={`${tableId}-expand`}
className={classnames(`${iotPrefix}--expandable-tablerow`, {
[`${iotPrefix}--expandable-tablerow--parent`]:
hasRowNesting && hasRowNesting?.hasSingleNestedHierarchy && nestingChildCount > 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/T
>
<td
className="bx--table-expand"
headers="expand"
headers="tableId-expand"
>
<button
aria-label="Click to expand."
Expand Down Expand Up @@ -506,7 +506,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/T
>
<td
className="bx--table-expand"
headers="expand"
headers="tableId-expand"
>
<button
aria-label="Click to expand."
Expand Down Expand Up @@ -691,7 +691,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/T
>
<td
className="bx--table-expand"
headers="expand"
headers="tableId-expand"
>
<button
aria-label="Click to expand."
Expand Down Expand Up @@ -836,7 +836,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots 1 - Watson IoT/T
>
<td
className="bx--table-expand"
headers="expand"
headers="tableId-expand"
>
<button
aria-label="Click to expand."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ const TableHead = ({
>
{hasRowExpansion || hasRowNesting ? (
<TableExpandHeader
id={`${tableId}-expand`}
// TODO: remove deprecated 'testID' in v3
data-testid={`${testID || testId}-row-expansion-column`}
className={classnames({
Expand Down
Loading