Commit 9d04dfe4 by Lukas Siatka Committed by GitHub

Explore: adds table result dataframes sorting to get response columns order…

Explore: adds table result dataframes sorting to get response columns order based on queries order (#25131)

* Chore: updates Explore result processor to sort dataframes based on their refId so results are displayed in a correct order

* Chore: adds types to Explore ResultProcessor getTableResult DataFrames
parent da027bb4
...@@ -50,7 +50,20 @@ export class ResultProcessor { ...@@ -50,7 +50,20 @@ export class ResultProcessor {
return null; return null;
} }
const onlyTables = this.dataFrames.filter(frame => shouldShowInVisualisationType(frame, 'table')); const onlyTables = this.dataFrames
.filter((frame: DataFrame) => shouldShowInVisualisationType(frame, 'table'))
.sort((frameA: DataFrame, frameB: DataFrame) => {
const frameARefId = frameA.refId!;
const frameBRefId = frameB.refId!;
if (frameARefId > frameBRefId) {
return 1;
}
if (frameARefId < frameBRefId) {
return -1;
}
return 0;
});
if (onlyTables.length === 0) { if (onlyTables.length === 0) {
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment