From 4d01aa31a122ca1c3b52a51cdbb5a9e0fad1b4e3 Mon Sep 17 00:00:00 2001 From: navaneeth Date: Wed, 17 Nov 2021 17:07:06 +0530 Subject: [PATCH] Fixes incorrect resolving of cellValue --- .../src/Editor/Components/Table/Table.jsx | 211 +++++++++--------- 1 file changed, 105 insertions(+), 106 deletions(-) diff --git a/frontend/src/Editor/Components/Table/Table.jsx b/frontend/src/Editor/Components/Table/Table.jsx index 7fed01dac5..76f19473f2 100644 --- a/frontend/src/Editor/Components/Table/Table.jsx +++ b/frontend/src/Editor/Components/Table/Table.jsx @@ -324,7 +324,7 @@ export function Table({ case 'string': case undefined: case 'default': { - const textColor = resolveReferences(column.textColor, currentState, { cellValue }); + const textColor = resolveReferences(column.textColor, currentState, '', { cellValue }); const cellStyles = { color: textColor ?? '', @@ -561,65 +561,65 @@ export function Table({ const leftActionsCellData = leftActions().length > 0 ? [ - { - id: 'leftActions', - Header: 'Actions', - accessor: 'edit', - width: columnSizes.leftActions || defaultColumn.width, - Cell: (cell) => { - return leftActions().map((action) => ( - - )); - }, + { + id: 'leftActions', + Header: 'Actions', + accessor: 'edit', + width: columnSizes.leftActions || defaultColumn.width, + Cell: (cell) => { + return leftActions().map((action) => ( + + )); }, - ] + }, + ] : []; const rightActionsCellData = rightActions().length > 0 ? [ - { - id: 'rightActions', - Header: 'Actions', - accessor: 'edit', - width: columnSizes.rightActions || defaultColumn.width, - Cell: (cell) => { - return rightActions().map((action) => ( - - )); - }, + { + id: 'rightActions', + Header: 'Actions', + accessor: 'edit', + width: columnSizes.rightActions || defaultColumn.width, + Cell: (cell) => { + return rightActions().map((action) => ( + + )); }, - ] + }, + ] : []; const IndeterminateCheckbox = React.forwardRef(({ indeterminate, ...rest }, ref) => { @@ -835,9 +835,8 @@ export function Table({ return ( { e.stopPropagation(); @@ -899,62 +898,62 @@ export function Table({ Object.keys(componentState.changeSet || {}).length > 0 || showFilterButton || showDownloadButton) && ( -
-
-
- {(clientSidePagination || serverSidePagination) && ( - - )} -
- - {showBulkUpdateActions && Object.keys(componentState.changeSet || {}).length > 0 && ( +
+
- - + {(clientSidePagination || serverSidePagination) && ( + + )}
- )} -
- {showFilterButton && ( - showFilters()}> - - {filters.length > 0 && ( - - )} - - )} - {showDownloadButton && ( - exportData('csv', true)} - > - - + {showBulkUpdateActions && Object.keys(componentState.changeSet || {}).length > 0 && ( +
+ + +
)} + +
+ {showFilterButton && ( + showFilters()}> + + {filters.length > 0 && ( + + )} + + )} + {showDownloadButton && ( + exportData('csv', true)} + > + + + )} +
-
- )} + )} {isFiltersVisible && (