clean up after failing tests
This commit is contained in:
@@ -117,28 +117,6 @@ export class PanelEditor extends SceneObjectBase<PanelEditorState> {
|
||||
};
|
||||
}
|
||||
|
||||
private async _autoSelectVisualization(panel: VizPanel) {
|
||||
const dataObject = sceneGraph.getData(panel);
|
||||
|
||||
this._subs.add(
|
||||
dataObject.subscribeToState(async () => {
|
||||
const { data } = dataObject.state;
|
||||
if (hasData(data) && panel.state.pluginId === UNCONFIGURED_PANEL_PLUGIN_ID) {
|
||||
const { suggestions } = await getAllSuggestions(data);
|
||||
|
||||
if (suggestions.length > 0) {
|
||||
const defaultFirstSuggestion = suggestions[0];
|
||||
await panel.changePluginType(
|
||||
defaultFirstSuggestion.pluginId,
|
||||
defaultFirstSuggestion.options,
|
||||
defaultFirstSuggestion.fieldConfig
|
||||
);
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private commitChanges() {
|
||||
if (!this.state.isDirty && !this._changesHaveBeenMade) {
|
||||
// Nothing to commit
|
||||
@@ -150,7 +128,6 @@ export class PanelEditor extends SceneObjectBase<PanelEditorState> {
|
||||
const originalState = this._layoutItemState!;
|
||||
|
||||
this.setState({ editPreview: undefined });
|
||||
this.state.optionsPane?.setState({ editPreviewRef: undefined });
|
||||
|
||||
// Temp fix for old edit mode
|
||||
if (this._layoutItem instanceof DashboardGridItem && !config.featureToggles.dashboardNewLayouts) {
|
||||
|
||||
@@ -293,6 +293,8 @@ export function getDefaultVizPanel(): VizPanel {
|
||||
? ''
|
||||
: t('dashboard.new-panel-title', 'New panel');
|
||||
|
||||
const datasourceSettings = getDataSourceSrv().getInstanceSettings(null);
|
||||
|
||||
return new VizPanel({
|
||||
title: newPanelTitle,
|
||||
pluginId: defaultPluginId,
|
||||
@@ -310,14 +312,16 @@ export function getDefaultVizPanel(): VizPanel {
|
||||
headerActions: new VizPanelHeaderActions({
|
||||
hideGroupByAction: !config.featureToggles.panelGroupBy,
|
||||
}),
|
||||
$data: new SceneDataTransformer({
|
||||
$data: new SceneQueryRunner({
|
||||
queries: [{ refId: 'A' }],
|
||||
datasource: getDataSourceRef(getDataSourceSrv().getInstanceSettings(null)!),
|
||||
$behaviors: [new DashboardDatasourceBehaviour({})],
|
||||
}),
|
||||
transformations: [],
|
||||
}),
|
||||
$data: datasourceSettings
|
||||
? new SceneDataTransformer({
|
||||
$data: new SceneQueryRunner({
|
||||
queries: [{ refId: 'A' }],
|
||||
datasource: getDataSourceRef(datasourceSettings),
|
||||
$behaviors: [new DashboardDatasourceBehaviour({})],
|
||||
}),
|
||||
transformations: [],
|
||||
})
|
||||
: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user