mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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
This commit is contained in:
parent
da027bb49f
commit
9d04dfe41a
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user