Skip to content

Commit

Permalink
Remove the aggregation item tooltips (#40461)
Browse files Browse the repository at this point in the history
* Remove the aggregation item tooltips

* Fix relevant unit test
  • Loading branch information
nemanjaglumac committed Mar 21, 2024
1 parent 017afe5 commit ca82de8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
ColumnPickerHeaderContainer,
ColumnPickerHeaderTitleContainer,
ColumnPickerHeaderTitle,
InfoIconContainer,
} from "./AggregationPicker.styled";

interface AggregationPickerProps {
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -285,17 +283,6 @@ function omitItemDescription() {
return null;
}

function renderItemExtra(item: ListItem) {
if (item.description) {
return (
<InfoIconContainer>
<Icon name="question" size={20} tooltip={item.description} />
</InfoIconContainer>
);
}
return null;
}

function getInitialOperator(
query: Lib.Query,
stageIndex: number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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 });
Expand Down

0 comments on commit ca82de8

Please sign in to comment.