Skip to content

Commit

Permalink
Revert "fix(table): fix selection state of resource table"
Browse files Browse the repository at this point in the history
  • Loading branch information
anuradha9712 committed Nov 15, 2024
1 parent e87244e commit fc4f173
Show file tree
Hide file tree
Showing 5 changed files with 46,127 additions and 55,035 deletions.
49 changes: 21 additions & 28 deletions core/components/organisms/grid/GridRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,38 +76,31 @@ export const GridRow = (props: GridRowProps) => {
if (currSchema.length) {
const classes = classNames({
'Grid-cellGroup': true,
'Grid-cellWrapper--pinned': pinned,
[`Grid-cellWrapper--pinned-${pinned}`]: pinned,
'Grid-cellGroup--main': !pinned,
});

const pinnedClasses = classNames({
'Grid-cellGroup--pinned bg-light': pinned,
'Grid-cellGroup--pinned': pinned,
[`Grid-cellGroup--pinned-${pinned}`]: pinned,
'Grid-cellGroup--main': !pinned,
});

return (
<div className={pinnedClasses}>
<div className={classes} data-test="DesignSystem-Grid-cellGroup">
{renderCheckbox(shouldRenderCheckbox)}
{currSchema.map((s, index) => {
let cI = pinned === 'left' ? index : leftPinnedSchema.length + index;
if (pinned === 'right') cI += unpinnedSchema.length;

return (
<Cell
key={`${rI}-${cI}`}
rowIndex={rI}
colIndex={cI}
firstCell={!index}
schema={s}
data={data}
expandedState={[expanded, setExpanded]}
nestedRowData={nestedRowData}
/>
);
})}
</div>
<div className={classes} data-test="DesignSystem-Grid-cellGroup">
{renderCheckbox(shouldRenderCheckbox)}
{currSchema.map((s, index) => {
let cI = pinned === 'left' ? index : leftPinnedSchema.length + index;
if (pinned === 'right') cI += unpinnedSchema.length;

return (
<Cell
key={`${rI}-${cI}`}
rowIndex={rI}
colIndex={cI}
firstCell={!index}
schema={s}
data={data}
expandedState={[expanded, setExpanded]}
nestedRowData={nestedRowData}
/>
);
})}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162991,29 +162991,25 @@ exports[`Grid component
data-test="DesignSystem-Grid-row"
>
<div
class=""
class="Grid-cellGroup Grid-cellGroup--main"
data-test="DesignSystem-Grid-cellGroup"
>
<div
class="Grid-cellGroup Grid-cellGroup--main"
data-test="DesignSystem-Grid-cellGroup"
class="Grid-cell Grid-cell--body"
style="width: 176px; min-width: 96px; max-width: 800px;"
>
<div
class="Grid-cell Grid-cell--body"
style="width: 176px; min-width: 96px; max-width: 800px;"
class="Grid-cellContent"
>
<div
class="Grid-cellContent"
class="GridCell GridCell--align-left GridCell--default"
>
<div
class="GridCell GridCell--align-left GridCell--default"
<span
class="Text Text--default Text--regular w-100 ellipsis"
data-test="DesignSystem-Text"
>
<span
class="Text Text--default Text--regular w-100 ellipsis"
data-test="DesignSystem-Text"
>
Zara
</span>
</div>
Zara
</span>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion core/components/organisms/table/__tests__/Table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ describe('render Table without headerOptions', () => {
const dropdownOption = getAllByTestId('DesignSystem-DropdownOption--WITH_ICON')[3];
fireEvent.click(dropdownOption);
const cellGroup = getAllByTestId('DesignSystem-Grid-cellGroup')[1];
expect(cellGroup).toHaveClass('Grid-cellWrapper--pinned-right');
expect(cellGroup).toHaveClass('Grid-cellGroup--pinned-right');
});

it('render Table: call onSelectAll ', () => {
Expand Down
Loading

0 comments on commit fc4f173

Please sign in to comment.