From ca82de8137d990ac3760431ed0c7b248c91788d3 Mon Sep 17 00:00:00 2001 From: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com> Date: Thu, 21 Mar 2024 19:18:04 +0100 Subject: [PATCH] Remove the aggregation item tooltips (#40461) * Remove the aggregation item tooltips * Fix relevant unit test --- .../AggregationPicker.styled.tsx | 11 ------- .../AggregationPicker/AggregationPicker.tsx | 13 -------- .../AggregationPicker.unit.spec.tsx | 32 +------------------ 3 files changed, 1 insertion(+), 55 deletions(-) diff --git a/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.styled.tsx b/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.styled.tsx index 87a8c10941665..41a1176bd3802 100644 --- a/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.styled.tsx +++ b/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.styled.tsx @@ -31,14 +31,3 @@ export const ColumnPickerHeaderTitle = styled.span` font-weight: 700; font-size: 1.17em; `; - -export const InfoIconContainer = styled.div` - display: flex; - align-items: center; - justify-content: center; - - padding-right: 0.5rem; - - opacity: 0.7; - cursor: pointer; -`; diff --git a/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.tsx b/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.tsx index 70e710c29fafe..bd1209541a314 100644 --- a/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.tsx +++ b/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.tsx @@ -18,7 +18,6 @@ import { ColumnPickerHeaderContainer, ColumnPickerHeaderTitleContainer, ColumnPickerHeaderTitle, - InfoIconContainer, } from "./AggregationPicker.styled"; interface AggregationPickerProps { @@ -251,7 +250,6 @@ export function AggregationPicker({ itemIsSelected={checkIsItemSelected} renderItemName={renderItemName} renderItemDescription={omitItemDescription} - renderItemExtra={renderItemExtra} // disable scrollbars inside the list style={{ overflow: "visible" }} maxHeight={Infinity} @@ -285,17 +283,6 @@ function omitItemDescription() { return null; } -function renderItemExtra(item: ListItem) { - if (item.description) { - return ( - - - - ); - } - return null; -} - function getInitialOperator( query: Lib.Query, stageIndex: number, diff --git a/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.unit.spec.tsx b/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.unit.spec.tsx index 8e7a4c769e2be..dc94cdc736243 100644 --- a/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.unit.spec.tsx +++ b/frontend/src/metabase/common/components/AggregationPicker/AggregationPicker.unit.spec.tsx @@ -3,7 +3,7 @@ import _ from "underscore"; import { createMockMetadata } from "__support__/metadata"; import { createMockEntitiesState } from "__support__/store"; -import { renderWithProviders, screen, within } from "__support__/ui"; +import { renderWithProviders, screen } from "__support__/ui"; import { checkNotNull } from "metabase/lib/types"; import * as Lib from "metabase-lib"; import { @@ -232,20 +232,6 @@ describe("AggregationPicker", () => { }); }); - it("should show operator descriptions", () => { - setup(); - - const sumOfOption = screen.getByRole("option", { name: "Sum of ..." }); - const infoIcon = within(sumOfOption).getByRole("img", { - name: "question icon", - }); - userEvent.hover(infoIcon); - - expect(screen.getByRole("tooltip")).toHaveTextContent( - "Sum of all the values of a column", - ); - }); - it("should apply a column-less operator", () => { const { getRecentClauseInfo } = setup(); @@ -370,22 +356,6 @@ describe("AggregationPicker", () => { expect(screen.queryByText(PRODUCT_METRIC.name)).not.toBeInTheDocument(); }); - it("should show a description for each metric", () => { - setupMetrics({ metadata: createMetadata({ metrics: [TEST_METRIC] }) }); - - const metricOption = screen.getByRole("option", { - name: TEST_METRIC.name, - }); - const infoIcon = within(metricOption).getByRole("img", { - name: "question icon", - }); - userEvent.hover(infoIcon); - - expect(screen.getByRole("tooltip")).toHaveTextContent( - TEST_METRIC.description, - ); - }); - it("should allow picking a metric", () => { const metadata = createMetadata({ metrics: [TEST_METRIC] }); const { getRecentClauseInfo } = setupMetrics({ metadata });