NewPanelEdit: Copy untransformed result from source panel (#24211)
This commit is contained in:
@@ -18,11 +18,8 @@ import {
|
|||||||
ScopedVars,
|
ScopedVars,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { EDIT_PANEL_ID } from 'app/core/constants';
|
import { EDIT_PANEL_ID } from 'app/core/constants';
|
||||||
|
|
||||||
import config from 'app/core/config';
|
import config from 'app/core/config';
|
||||||
|
|
||||||
import { PanelQueryRunner } from './PanelQueryRunner';
|
import { PanelQueryRunner } from './PanelQueryRunner';
|
||||||
import { take } from 'rxjs/operators';
|
|
||||||
|
|
||||||
export const panelAdded = eventFactory<PanelModel | undefined>('panel-added');
|
export const panelAdded = eventFactory<PanelModel | undefined>('panel-added');
|
||||||
export const panelRemoved = eventFactory<PanelModel | undefined>('panel-removed');
|
export const panelRemoved = eventFactory<PanelModel | undefined>('panel-removed');
|
||||||
@@ -426,10 +423,10 @@ export class PanelModel implements DataConfigSource {
|
|||||||
const sourceQueryRunner = this.getQueryRunner();
|
const sourceQueryRunner = this.getQueryRunner();
|
||||||
|
|
||||||
// pipe last result to new clone query runner
|
// pipe last result to new clone query runner
|
||||||
sourceQueryRunner
|
const lastResult = sourceQueryRunner.getLastResult();
|
||||||
.getData()
|
if (lastResult) {
|
||||||
.pipe(take(1))
|
clone.getQueryRunner().pipeDataToSubject(lastResult);
|
||||||
.subscribe(val => clone.getQueryRunner().pipeDataToSubject(val));
|
}
|
||||||
|
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user