mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelEdit: Fixed timing and state related issues (#22131)
* PanelEdit: Fixed timing and state related issues * Added unit test and changed some logic * Fixed id logic * Updated snapshots * Update public/app/features/dashboard/state/PanelModel.ts Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { getBackendSrv } from '@grafana/runtime';
|
||||
import { createSuccessNotification } from 'app/core/copy/appNotification';
|
||||
// Actions
|
||||
import { loadPluginDashboards } from '../../plugins/state/actions';
|
||||
import { loadDashboardPermissions, dashboardPanelTypeChanged } from './reducers';
|
||||
import { loadDashboardPermissions, panelModelAndPluginReady } from './reducers';
|
||||
import { notifyApp } from 'app/core/actions';
|
||||
import { loadPanelPlugin } from 'app/features/plugins/state/actions';
|
||||
// Types
|
||||
@@ -122,6 +122,8 @@ export function initDashboardPanel(panel: PanelModel): ThunkResult<void> {
|
||||
if (!panel.plugin) {
|
||||
panel.pluginLoaded(plugin);
|
||||
}
|
||||
|
||||
dispatch(panelModelAndPluginReady({ panelId: panel.id, plugin }));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -139,6 +141,7 @@ export function changePanelPlugin(panel: PanelModel, pluginId: string): ThunkRes
|
||||
}
|
||||
|
||||
panel.changePlugin(plugin);
|
||||
dispatch(dashboardPanelTypeChanged({ panelId: panel.id, pluginId }));
|
||||
|
||||
dispatch(panelModelAndPluginReady({ panelId: panel.id, plugin }));
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user