mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
handle undefined options in GenericCell (#998)
This commit is contained in:
parent
cd2d531c54
commit
b7a0b7f997
2 changed files with 3 additions and 5 deletions
|
|
@ -16,10 +16,8 @@ type Options = {
|
|||
primary?: boolean;
|
||||
};
|
||||
|
||||
export const GenericCell = (
|
||||
{ value, valueFormatted }: ICellRendererParams,
|
||||
{ isLink, position, primary }: Options,
|
||||
) => {
|
||||
export const GenericCell = ({ value, valueFormatted }: ICellRendererParams, options?: Options) => {
|
||||
const { isLink, position, primary } = options || {};
|
||||
const displayedValue = valueFormatted || value;
|
||||
|
||||
if (value === undefined) {
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
|||
width: 130,
|
||||
},
|
||||
path: {
|
||||
cellRenderer: GenericCell,
|
||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'left' }),
|
||||
colId: TableColumn.PATH,
|
||||
headerName: i18n.t('table.column.path'),
|
||||
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.path : undefined),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue