DashGPT: Autogenerate panel title and description on scenes (#84726)

Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
This commit is contained in:
Ivan Ortega Alba
2024-03-22 11:56:19 +01:00
committed by GitHub
parent 016d6f2f6d
commit 521d686ca4
8 changed files with 67 additions and 48 deletions

View File

@@ -5,8 +5,10 @@ import { VizPanel } from '@grafana/scenes';
import { OptionFilter } from 'app/features/dashboard/components/PanelEditor/OptionsPaneOptions';
import { DashboardGridItem } from '../scene/DashboardGridItem';
import { DashboardScene } from '../scene/DashboardScene';
import { LibraryVizPanel } from '../scene/LibraryVizPanel';
import { vizPanelToPanel } from '../serialization/transformSceneToSaveModel';
import * as utils from '../utils/utils';
import { PanelOptions } from './PanelOptions';
import { VizPanelManager } from './VizPanelManager';
@@ -17,6 +19,9 @@ jest.mock('react-router-dom', () => ({
}),
}));
// Needed when the panel is not part of an DashboardScene
jest.spyOn(utils, 'getDashboardSceneFor').mockReturnValue(new DashboardScene({}));
describe('PanelOptions', () => {
it('gets library panel options when the editing a library panel', async () => {
const panel = new VizPanel({