mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
handle undefined options in GenericCell (#998)
This commit is contained in:
@@ -16,10 +16,8 @@ type Options = {
|
|||||||
primary?: boolean;
|
primary?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const GenericCell = (
|
export const GenericCell = ({ value, valueFormatted }: ICellRendererParams, options?: Options) => {
|
||||||
{ value, valueFormatted }: ICellRendererParams,
|
const { isLink, position, primary } = options || {};
|
||||||
{ isLink, position, primary }: Options,
|
|
||||||
) => {
|
|
||||||
const displayedValue = valueFormatted || value;
|
const displayedValue = valueFormatted || value;
|
||||||
|
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
|||||||
width: 130,
|
width: 130,
|
||||||
},
|
},
|
||||||
path: {
|
path: {
|
||||||
cellRenderer: GenericCell,
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'left' }),
|
||||||
colId: TableColumn.PATH,
|
colId: TableColumn.PATH,
|
||||||
headerName: i18n.t('table.column.path'),
|
headerName: i18n.t('table.column.path'),
|
||||||
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.path : undefined),
|
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.path : undefined),
|
||||||
|
|||||||
Reference in New Issue
Block a user