Skip to content

Commit 6c3c31e

Browse files
fix(dashboards): Hide group by option for series display Issue widgets (#104370)
Timeseries Issue widgets don't support groupbys at the moment, so hide the selector from the widget builder.
1 parent 5409b53 commit 6c3c31e

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

static/app/views/dashboards/widgetBuilder/components/widgetBuilderSlideout.spec.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,4 +656,36 @@ describe('WidgetBuilderSlideout', () => {
656656

657657
expect(screen.queryByLabelText('Add a search term')).not.toBeInTheDocument();
658658
});
659+
660+
it('should not show the group by selector if the widget is an issue and a chart display type', () => {
661+
render(
662+
<WidgetBuilderProvider>
663+
<WidgetBuilderSlideout
664+
dashboard={DashboardFixture([])}
665+
dashboardFilters={{release: undefined}}
666+
isWidgetInvalid={false}
667+
onClose={jest.fn()}
668+
onQueryConditionChange={jest.fn()}
669+
onSave={jest.fn()}
670+
setIsPreviewDraggable={jest.fn()}
671+
openWidgetTemplates={false}
672+
setOpenWidgetTemplates={jest.fn()}
673+
/>
674+
</WidgetBuilderProvider>,
675+
{
676+
organization,
677+
router: RouterFixture({
678+
location: LocationFixture({
679+
query: {
680+
dataset: WidgetType.ISSUE,
681+
displayType: DisplayType.LINE,
682+
},
683+
}),
684+
}),
685+
deprecatedRouterMocks: true,
686+
}
687+
);
688+
689+
expect(screen.queryByText('Group by')).not.toBeInTheDocument();
690+
});
659691
});

static/app/views/dashboards/widgetBuilder/components/widgetBuilderSlideout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ function WidgetBuilderSlideout({
129129
const showQueryFilterBuilder = !(
130130
state.dataset === WidgetType.ISSUE && isChartDisplayType(state.displayType)
131131
);
132+
const showGroupBySelector = isChartWidget && !(state.dataset === WidgetType.ISSUE);
132133

133134
const customPreviewRef = useRef<HTMLDivElement>(null);
134135
const templatesPreviewRef = useRef<HTMLDivElement>(null);
@@ -368,7 +369,7 @@ function WidgetBuilderSlideout({
368369
/>
369370
</Section>
370371
)}
371-
{isChartWidget && (
372+
{showGroupBySelector && (
372373
<Section>
373374
<WidgetBuilderGroupBySelector
374375
validatedWidgetResponse={validatedWidgetResponse}

0 commit comments

Comments
 (0)