Transformations: Allow queries without dataframe results to be selectable as filters (#107152)
* Add mention of external type to correlations docs
* 🆗
* Merge request targets in with results
* Ensure we do not mutate result set
This commit is contained in:
+11
-1
@@ -138,7 +138,17 @@ export const TransformationOperationRow = ({
|
||||
.subscribe(setOutput);
|
||||
const prevOutputSubscription = transformDataFrame(prevInputTransforms, data.series, ctx)
|
||||
.pipe(mergeMap((before) => transformDataFrame(prevOutputTransforms, before, ctx)))
|
||||
.subscribe(setPrevOutput);
|
||||
.subscribe((result) => {
|
||||
let mergedResult = [...result];
|
||||
// add refIds that were requested even if they did not return a result
|
||||
data.request?.targets.forEach((series) => {
|
||||
const refIdInResult = mergedResult.some((frame) => frame.refId === series.refId);
|
||||
if (!refIdInResult) {
|
||||
mergedResult.push({ refId: series.refId, fields: [], length: 0 });
|
||||
}
|
||||
});
|
||||
setPrevOutput(mergedResult);
|
||||
});
|
||||
|
||||
return function unsubscribe() {
|
||||
inputSubscription.unsubscribe();
|
||||
|
||||
+2
@@ -5,6 +5,7 @@ import { Unsubscribable } from 'rxjs';
|
||||
|
||||
import {
|
||||
DataFrame,
|
||||
DataQueryRequest,
|
||||
DataTransformerConfig,
|
||||
PanelData,
|
||||
SelectableValue,
|
||||
@@ -44,6 +45,7 @@ export type viewAllType = 'viewAll';
|
||||
export type FilterCategory = TransformerCategory | viewAllType;
|
||||
|
||||
export interface TransformationData {
|
||||
request?: DataQueryRequest;
|
||||
series: DataFrame[];
|
||||
annotations?: DataFrame[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user