Commit b57802e6 by Torkel Ödegaard Committed by GitHub

NewPanelEdit: Copy untransformed result from source panel (#24211)

parent 7e1bf0e7
...@@ -18,11 +18,8 @@ import { ...@@ -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 { ...@@ -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;
} }
......
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