Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: check for cell colouring feature before apply

Ramesh Mane1c3de6e08f4f
diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/cells/index.ts b/packages/nc-gui/components/smartsheet/grid/canvas/cells/index.ts
index 85cfe28665..1ae1f12de5 100644
--- a/packages/nc-gui/components/smartsheet/grid/canvas/cells/index.ts
+++ b/packages/nc-gui/components/smartsheet/grid/canvas/cells/index.ts
@@ -75,7 +75,7 @@ export function useGridCellHandler(params: {
const { isColumnSortedOrFiltered, appearanceConfig: filteredOrSortedAppearanceConfig } = useColumnFilteredOrSorted()
- const { isRowColouringEnabled, getEvaluatedCellColorInfo } = useViewRowColorRender()
+ const { isRowColouringEnabled, isCellColouringEnabled, getEvaluatedCellColorInfo } = useViewRowColorRender()
const { getColor, isDark } = useTheme()
@@ -223,7 +223,7 @@ export function useGridCellHandler(params: {
})
} else if (!rowMeta?.isValidationFailed && isRootCell) {
// First check for cell-specific coloring
- const cellColorInfo = isRowColouringEnabled.value ? getEvaluatedCellColorInfo(row, column.id) : null
+ const cellColorInfo = isCellColouringEnabled.value ? getEvaluatedCellColorInfo(row, column.id) : null
let backgroundColorToRender: string | null = null
let hoverColorToRender: string | null = null
diff --git a/packages/nc-gui/composables/viewRowColor/useViewRowColorRender.ts b/packages/nc-gui/composables/viewRowColor/useViewRowColorRender.ts
index 58835572c3..00061ca7ec 100644
--- a/packages/nc-gui/composables/viewRowColor/useViewRowColorRender.ts
+++ b/packages/nc-gui/composables/viewRowColor/useViewRowColorRender.ts
@@ -5,6 +5,10 @@ export function useViewRowColorRender() {
return activeViewRowColorInfo.value && !!activeViewRowColorInfo.value?.mode
})
+ const isCellColouringEnabled = computed(() => {
+ return isRowColouringEnabled.value
+ })
+
const evaluateRowColor = (_row: any) => {
return null
}
@@ -51,6 +55,7 @@ export function useViewRowColorRender() {
rowColorInfo: activeViewRowColorInfo,
evaluateRowColor,
isRowColouringEnabled,
+ isCellColouringEnabled,
getEvaluatedRowMetaRowColorInfo,
getEvaluatedCellColorInfo,
getCellColorStyle,