The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Fix conditional formatting for mini bar cells (#76025)
Anderson8894b2a7ebc5
diff --git a/frontend/src/metabase/data-grid/components/BaseCell/BaseCell.tsx b/frontend/src/metabase/data-grid/components/BaseCell/BaseCell.tsxindex ef6fc453ecc..b75e1cc835a 100644--- a/frontend/src/metabase/data-grid/components/BaseCell/BaseCell.tsx+++ b/frontend/src/metabase/data-grid/components/BaseCell/BaseCell.tsx@@ -23,6 +23,7 @@ export const BaseCell = memo(function BaseCell({className,hasHover = true,children,+ style,...rest}: BaseCellProps) {const cellStyle = useMemo(() => {@@ -64,7 +65,7 @@ export const BaseCell = memo(function BaseCell({},className,)}- style={cellStyle}+ style={{ ...cellStyle, ...style }}{...rest}>{children}diff --git a/frontend/src/metabase/visualizations/components/TableInteractive/cells/MiniBarCell.tsx b/frontend/src/metabase/visualizations/components/TableInteractive/cells/MiniBarCell.tsxindex ac926f8c9be..07932c3e80b 100644--- a/frontend/src/metabase/visualizations/components/TableInteractive/cells/MiniBarCell.tsx+++ b/frontend/src/metabase/visualizations/components/TableInteractive/cells/MiniBarCell.tsx@@ -97,6 +97,7 @@ export const MiniBarCell = <TValue,>({return (<BaseCell+ data-testid="mini-bar-cell"className={S.root}backgroundColor={backgroundColor}align={align}diff --git a/frontend/src/metabase/visualizations/components/TableInteractive/cells/MiniBarCell.unit.spec.tsx b/frontend/src/metabase/visualizations/components/TableInteractive/cells/MiniBarCell.unit.spec.tsxindex 114826501a9..cd052d22a76 100644--- a/frontend/src/metabase/visualizations/components/TableInteractive/cells/MiniBarCell.unit.spec.tsx+++ b/frontend/src/metabase/visualizations/components/TableInteractive/cells/MiniBarCell.unit.spec.tsx@@ -44,4 +44,26 @@ describe("MiniBarCell", () => {const miniBar = screen.getByTestId("mini-bar");expect(miniBar).toHaveStyle({ width: "100%" });});++ it("should apply backgroundColor to the cell wrapper (#75095)", () => {+ const columnSettings = {+ show_mini_bar: true,+ number_style: "decimal",+ };+ render(+ <MiniBarCell+ formatter={formatter}+ value={0.5}+ extent={[0.5, 0.8]}+ columnSettings={columnSettings}+ rowIndex={rowIndex}+ columnId={columnId}+ backgroundColor="rgb(237, 110, 110)"+ />,+ );++ expect(screen.getByTestId("mini-bar-cell")).toHaveStyle({+ "--cell-bg-color": "rgb(237, 110, 110)",+ });+ });});