Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Clean up metrics viewer token action menu (#75206)

Anderson79b7c2a60488
diff --git a/frontend/src/metabase/metrics-viewer/components/MetricSearch/MetricPill/MetricPill.tsx b/frontend/src/metabase/metrics-viewer/components/MetricSearch/MetricPill/MetricPill.tsx
index 9d0fb0f59be..bb87bc70634 100644
--- a/frontend/src/metabase/metrics-viewer/components/MetricSearch/MetricPill/MetricPill.tsx
+++ b/frontend/src/metabase/metrics-viewer/components/MetricSearch/MetricPill/MetricPill.tsx
@@ -233,13 +233,9 @@ export function MetricPill({
</Menu.Item>
</>
)}
- {metric.sourceType === "metric" &&
- dimensions.size > 0 &&
- definition && <Menu.Divider role="separator" />}
{metric.sourceType === "metric" && (
<Menu.Item
- leftSection={<Icon name="info" />}
- rightSection={<Icon name="external" />}
+ leftSection={<Icon name="home" />}
component={ForwardRefLink}
to={Urls.metricQuestionUrl({
id: metric.id,
diff --git a/frontend/src/metabase/metrics-viewer/components/MetricSearch/MetricPill/MetricPill.unit.spec.tsx b/frontend/src/metabase/metrics-viewer/components/MetricSearch/MetricPill/MetricPill.unit.spec.tsx
index 2ca8181a9b8..6f30d789aa4 100644
--- a/frontend/src/metabase/metrics-viewer/components/MetricSearch/MetricPill/MetricPill.unit.spec.tsx
+++ b/frontend/src/metabase/metrics-viewer/components/MetricSearch/MetricPill/MetricPill.unit.spec.tsx
@@ -69,11 +69,13 @@ describe("MetricPill action menu", () => {
expect(screen.getByText("Replace")).toBeInTheDocument();
expect(screen.getByText("Go to metric home page")).toBeInTheDocument();
+ expect(screen.getByLabelText("home icon")).toBeInTheDocument();
+ expect(screen.queryByLabelText("external icon")).not.toBeInTheDocument();
// No separator when there are no breakout items between them.
expect(screen.queryByRole("separator")).not.toBeInTheDocument();
});
- it("should show 'Replace', 'Add a series breakout', and 'Go to metric home page' with a separator when dimensions exist", async () => {
+ it("should show 'Replace', 'Add a series breakout', and 'Go to metric home page' when dimensions exist", async () => {
const metadata = createMetricMetadata([REVENUE_METRIC]);
const definition = setupDefinition(metadata, REVENUE_METRIC.id);
@@ -86,8 +88,6 @@ describe("MetricPill action menu", () => {
expect(screen.getByText("Replace")).toBeInTheDocument();
expect(screen.getByText("Add a series breakout")).toBeInTheDocument();
expect(screen.getByText("Go to metric home page")).toBeInTheDocument();
- // One separator between breakout items and 'Go to metric home page'.
- expect(screen.getAllByRole("separator")).toHaveLength(1);
});
it("should open the MetricSearchDropdown when Replace is clicked", async () => {