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

UI: DefaultCell and BlocksCell -> fix Link for grouped rows #75

Merged
merged 1 commit into from
Nov 15, 2023
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
2 changes: 1 addition & 1 deletion dist/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/index.js.map

Large diffs are not rendered by default.

2,410 changes: 1,205 additions & 1,205 deletions dist/style/theme.scss

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@weka.io/weka-ui-components",
"version": "1.56.0",
"version": "1.57.0",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ function Table<Values extends Record<string, unknown>>({

const cellGroupIndex = cell.column.groupedIndex
const currentGroupIndex = groupBy.indexOf(
row.groupByID
extendedRow.groupByID
)

return (
Expand All @@ -832,8 +832,8 @@ function Table<Values extends Record<string, unknown>>({
extraClasses?.tableCell
)}
onClick={() => {
if (row.isGrouped) {
row.toggleRowExpanded()
if (extendedRow.isGrouped) {
extendedRow.toggleRowExpanded()
} else {
const onClickCell = columns[index]?.onClickCell

Expand Down Expand Up @@ -866,7 +866,7 @@ function Table<Values extends Record<string, unknown>>({
<>
{groupBy &&
RowSubComponent &&
!row.isGrouped &&
!extendedRow.isGrouped &&
(index === 0 ||
extendedRow.cells[index - 1]
.isPlaceholder) && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/cells/BlocksCell/BlocksCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function BlocksCell<Data extends Record<string, unknown>>({

return isLink && getUrl ? (
<Link
to={getUrl(row.original)}
to={getUrl(row.original || row.values)}
{...(openInNewTab && {
target: '_blank',
rel: 'noopener noreferrer'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/cells/DefaultCell/DefaultCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function DefaultCell({ cell }: CustomCellProps) {
<Tooltip data={tooltip?.toString()}>
{isLink && getUrl ? (
<Link
to={getUrl(row.original)}
to={getUrl(row.original || row.values)}
className='table-link'
{...(openInNewTab && {
target: '_blank',
Expand Down