fix: do not add select columns when the datasource is logs (#5515)

* fix: do not add select columns when the datasource is logs

* chore: added data test id
This commit is contained in:
Vikrant Gupta 2024-07-22 13:43:47 +05:30 committed by GitHub
parent 89fd3e4f55
commit b08e859426
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -125,10 +125,9 @@ function GridCardGraph({
offset: 0, offset: 0,
limit: updatedQuery.builder.queryData[0].limit || 0, limit: updatedQuery.builder.queryData[0].limit || 0,
}, },
// we do not need select columns in case of logs
selectColumns: selectColumns:
initialDataSource === DataSource.LOGS initialDataSource === DataSource.TRACES && widget.selectedTracesFields,
? widget.selectedLogFields
: widget.selectedTracesFields,
}, },
fillGaps: widget.fillSpans, fillGaps: widget.fillSpans,
}; };

View File

@ -309,6 +309,7 @@ function ExplorerColumnsRenderer({
> >
<Button <Button
className="action-btn" className="action-btn"
data-testid="add-columns-button"
icon={ icon={
<PlusCircle <PlusCircle
size={16} size={16}

View File

@ -563,11 +563,11 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
if (selectedGraph === PANEL_TYPES.LIST) { if (selectedGraph === PANEL_TYPES.LIST) {
const initialDataSource = currentQuery.builder.queryData[0].dataSource; const initialDataSource = currentQuery.builder.queryData[0].dataSource;
if (initialDataSource === DataSource.LOGS) { if (initialDataSource === DataSource.LOGS) {
// we do not need selected log columns in the request data as the entire response contains all the necessary data
setRequestData((prev) => ({ setRequestData((prev) => ({
...prev, ...prev,
tableParams: { tableParams: {
...prev.tableParams, ...prev.tableParams,
selectColumns: selectedLogFields,
}, },
})); }));
} else if (initialDataSource === DataSource.TRACES) { } else if (initialDataSource === DataSource.TRACES) {