fix: fixed tables view not honouring order by in traces explorer (#6769)

* fix: fixed tables view not honouring order by in traces explorer

* fix: fixed order by count not being honoured in table view - trace
This commit is contained in:
SagarRajput-7 2025-01-15 15:00:40 +05:30 committed by GitHub
parent 5708079c3c
commit efc8c95d59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -572,29 +572,6 @@ export const createTableColumnsFromQuery: CreateTableDataFromQuery = ({
a.queryName < b.queryName ? -1 : 1,
);
// the reason we need this is because the filling of values in rows doesn't account for mismatch enteries
// in the response. Example : Series A -> [label1, label2] and Series B -> [label2,label1] this isn't accounted for
sortedQueryTableData.forEach((q) => {
q.series?.forEach((s) => {
s.labelsArray?.sort((a, b) =>
Object.keys(a)[0] < Object.keys(b)[0] ? -1 : 1,
);
});
q.series?.sort((a, b) => {
let labelA = '';
let labelB = '';
a.labelsArray?.forEach((lab) => {
labelA += Object.values(lab)[0];
});
b.labelsArray?.forEach((lab) => {
labelB += Object.values(lab)[0];
});
return labelA < labelB ? -1 : 1;
});
});
const dynamicColumns = getDynamicColumns(sortedQueryTableData, query);
const { filledDynamicColumns, rowsLength } = fillColumnsData(