Skip to content

Commit

Permalink
Merge pull request #2405 from innovaccer/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
anuradha9712 authored Nov 4, 2024
2 parents d126b02 + 6b06efc commit 6e98904
Show file tree
Hide file tree
Showing 6 changed files with 54,957 additions and 46,063 deletions.
49 changes: 28 additions & 21 deletions core/components/organisms/grid/GridRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,38 @@ export const GridRow = (props: GridRowProps) => {
if (currSchema.length) {
const classes = classNames({
'Grid-cellGroup': true,
'Grid-cellGroup--pinned': pinned,
[`Grid-cellGroup--pinned-${pinned}`]: pinned,
'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}`]: pinned,
});

return (
<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 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>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162991,25 +162991,29 @@ exports[`Grid component
data-test="DesignSystem-Grid-row"
>
<div
class="Grid-cellGroup Grid-cellGroup--main"
data-test="DesignSystem-Grid-cellGroup"
class=""
>
<div
class="Grid-cell Grid-cell--body"
style="width: 176px; min-width: 96px; max-width: 800px;"
class="Grid-cellGroup Grid-cellGroup--main"
data-test="DesignSystem-Grid-cellGroup"
>
<div
class="Grid-cellContent"
class="Grid-cell Grid-cell--body"
style="width: 176px; min-width: 96px; max-width: 800px;"
>
<div
class="GridCell GridCell--align-left GridCell--default"
class="Grid-cellContent"
>
<span
class="Text Text--default Text--regular w-100 ellipsis"
data-test="DesignSystem-Text"
<div
class="GridCell GridCell--align-left GridCell--default"
>
Zara
</span>
<span
class="Text Text--default Text--regular w-100 ellipsis"
data-test="DesignSystem-Text"
>
Zara
</span>
</div>
</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-cellGroup--pinned-right');
expect(cellGroup).toHaveClass('Grid-cellWrapper--pinned-right');
});

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

0 comments on commit 6e98904

Please sign in to comment.