mirror of
https://github.com/SigNoz/signoz.git
synced 2026-06-22 00:00:27 +01:00
fix: added fix for order by in trace opeartor
This commit is contained in:
@@ -106,6 +106,16 @@ function ListView({
|
||||
];
|
||||
}
|
||||
|
||||
// add order by to trace operator
|
||||
if (query.builder.queryTraceOperator.length > 0) {
|
||||
query.builder.queryTraceOperator[0].orderBy = [
|
||||
{
|
||||
columnName: orderBy.split(':')[0],
|
||||
order: orderBy.split(':')[1] as 'asc' | 'desc',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
return query;
|
||||
}, [stagedQuery, orderBy]);
|
||||
|
||||
|
||||
@@ -102,7 +102,15 @@ function TracesExplorer(): JSX.Element {
|
||||
handleSetConfig(PANEL_TYPES.LIST, DataSource.TRACES);
|
||||
}
|
||||
|
||||
// TODO: remove formula when switching to List view
|
||||
if (
|
||||
(selectedView === ExplorerViews.TRACE ||
|
||||
selectedView === ExplorerViews.LIST) &&
|
||||
stagedQuery?.builder?.queryTraceOperator &&
|
||||
stagedQuery.builder.queryTraceOperator.length > 0
|
||||
) {
|
||||
// remove order by from trace operator
|
||||
stagedQuery.builder.queryTraceOperator[0].orderBy = [];
|
||||
}
|
||||
|
||||
setSelectedView(view);
|
||||
|
||||
@@ -110,7 +118,13 @@ function TracesExplorer(): JSX.Element {
|
||||
view === ExplorerViews.TIMESERIES ? PANEL_TYPES.TIME_SERIES : view,
|
||||
);
|
||||
},
|
||||
[handleSetConfig, handleExplorerTabChange, selectedView, setSelectedView],
|
||||
[
|
||||
handleSetConfig,
|
||||
handleExplorerTabChange,
|
||||
selectedView,
|
||||
setSelectedView,
|
||||
stagedQuery,
|
||||
],
|
||||
);
|
||||
|
||||
const listQuery = useMemo(() => {
|
||||
|
||||
Reference in New Issue
Block a user