Skip to content

Commit

Permalink
feat(dashboards): Disable multiple filters for EAP dataset (#80599)
Browse files Browse the repository at this point in the history
Explore only supports a single filter query. Disable the Add Query
button to remain consistent.
  • Loading branch information
narsaynorath authored Nov 12, 2024
1 parent b5979bc commit ed150b9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions static/app/views/dashboards/widgetBuilder/widgetBuilder.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2675,5 +2675,37 @@ describe('WidgetBuilder', function () {
await userEvent.click(screen.getByText(`count(…)`));
expect(screen.getByText('plan')).toBeInTheDocument();
});

it('does not show the Add Query button', async function () {
const dashboard = mockDashboard({
widgets: [
WidgetFixture({
widgetType: WidgetType.SPANS,
// Add Query is only available for timeseries charts
displayType: DisplayType.LINE,
queries: [
{
name: 'Test Widget',
fields: ['count(span.duration)'],
columns: [],
conditions: '',
orderby: '',
aggregates: ['count(span.duration)'],
},
],
}),
],
});
renderTestComponent({
dashboard,
orgFeatures: [...defaultOrgFeatures],
params: {
widgetIndex: '0',
},
});

await screen.findByText('Line Chart');
expect(screen.queryByText('Add Query')).not.toBeInTheDocument();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ function WidgetBuilder({

const canAddSearchConditions =
[DisplayType.LINE, DisplayType.AREA, DisplayType.BAR].includes(state.displayType) &&
state.dataSet !== DataSet.SPANS &&
state.queries.length < 3;

const hideLegendAlias = [DisplayType.TABLE, DisplayType.BIG_NUMBER].includes(
Expand Down

0 comments on commit ed150b9

Please sign in to comment.