diff --git a/CHANGELOG.md b/CHANGELOG.md index 43243e64..90d64f86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Columns not sizing correctly when headers change +- Not displaying repeatable set values ## [9.0.0] - 2026-02-02 diff --git a/src/components/formStore/table/ColumnFilters.tsx b/src/components/formStore/table/ColumnFilters.tsx index 4b291197..7d2104e7 100644 --- a/src/components/formStore/table/ColumnFilters.tsx +++ b/src/components/formStore/table/ColumnFilters.tsx @@ -45,8 +45,8 @@ function ColumnFilters({ filter }: Props) { filter.onChange( e.target.value ? { - $eq: e.target.value, - } + $eq: e.target.value, + } : undefined, true, ) @@ -69,10 +69,10 @@ function ColumnFilters({ filter }: Props) { filter.onChange( e.target.value ? { - $regex: e.target.value, - // hard code case in-sensitive and multi-line searching - $options: 'im', - } + $regex: e.target.value, + // hard code case in-sensitive and multi-line searching + $options: 'im', + } : undefined, true, ) @@ -101,9 +101,9 @@ function ColumnFilters({ filter }: Props) { typeof filter.value?.$lte === 'number' || newValue !== undefined ? { - ...filter.value, - $gte: newValue, - } + ...filter.value, + $gte: newValue, + } : undefined, true, ) @@ -127,9 +127,9 @@ function ColumnFilters({ filter }: Props) { typeof filter.value?.$gte === 'number' || newValue !== undefined ? { - ...filter.value, - $lte: newValue, - } + ...filter.value, + $lte: newValue, + } : undefined, true, ) @@ -159,9 +159,9 @@ function ColumnFilters({ filter }: Props) { filter.onChange( filter.value?.$lte || !!newDate ? { - ...filter.value, - $gte: newDate, - } + ...filter.value, + $gte: newDate, + } : undefined, false, ) @@ -185,9 +185,9 @@ function ColumnFilters({ filter }: Props) { filter.onChange( filter.value?.$gte || !!newDate ? { - ...filter.value, - $lte: newDate, - } + ...filter.value, + $lte: newDate, + } : undefined, false, ) @@ -217,14 +217,13 @@ function ColumnFilters({ filter }: Props) { filter.onChange( filter.value?.$lte || !!newDate ? { - ...filter.value, - $gte: newDate, - } + ...filter.value, + $gte: newDate, + } : undefined, false, ) - } - } + }} /> @@ -244,9 +243,9 @@ function ColumnFilters({ filter }: Props) { filter.onChange( filter.value?.$gte || !!newDate ? { - ...filter.value, - $lte: newDate, - } + ...filter.value, + $lte: newDate, + } : undefined, false, ) @@ -287,8 +286,8 @@ function ColumnFilters({ filter }: Props) { filter.onChange( newValue.length ? { - $in: newValue, - } + $in: newValue, + } : undefined, false, ) @@ -305,10 +304,10 @@ function ColumnFilters({ filter }: Props) { filter.onChange( newValue.length ? { - $elemMatch: { - $in: newValue, - }, - } + $elemMatch: { + $in: newValue, + }, + } : undefined, false, ) diff --git a/src/components/formStore/table/RepeatableSetCell.tsx b/src/components/formStore/table/RepeatableSetCell.tsx index e9e742f1..c3d889b1 100644 --- a/src/components/formStore/table/RepeatableSetCell.tsx +++ b/src/components/formStore/table/RepeatableSetCell.tsx @@ -3,7 +3,11 @@ import { Typography, Divider as MuiDivider, styled } from '@mui/material' import { FormTypes, SubmissionTypes } from '@oneblink/types' import useBooleanState from '../../../hooks/useBooleanState' import generateColumns from './generateColumns' -import { getCoreRowModel, useReactTable } from '@tanstack/react-table' +import { + flexRender, + getCoreRowModel, + useReactTable, +} from '@tanstack/react-table' import RepeatableSetCellAccordion from './RepeatableSetCellAccordion' const Wrapper = styled('div')({ @@ -66,12 +70,15 @@ const RepeatableSetCell = ({ formElement, value }: Props) => { onChange={toggleVisibility} > - {getRowModel().rows.map((row, i) => { + {rows.map((row, i) => { const isLast = i === rows.length - 1 return ( {row.getAllCells().map((cell) => { - const cellValue = cell.getValue() + const cellValue = flexRender( + cell.column.columnDef.cell, + cell.getContext(), + ) if (!cellValue) return null return ( @@ -80,7 +87,7 @@ const RepeatableSetCell = ({ formElement, value }: Props) => { {cell.column.columnDef.header?.toString() || ''}: - {cellValue as string} + {cellValue} ) })}