From efc8c95d598b6d9ad9a1fced3f06359da9e8cc7c Mon Sep 17 00:00:00 2001 From: SagarRajput-7 <162284829+SagarRajput-7@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:00:40 +0530 Subject: [PATCH] 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 --- .../lib/query/createTableColumnsFromQuery.ts | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/frontend/src/lib/query/createTableColumnsFromQuery.ts b/frontend/src/lib/query/createTableColumnsFromQuery.ts index 190f7996aa..ff5ee7a9ad 100644 --- a/frontend/src/lib/query/createTableColumnsFromQuery.ts +++ b/frontend/src/lib/query/createTableColumnsFromQuery.ts @@ -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(