mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
DashboardScene: Fixes issue saving new dashboard from panel edit (#86477)
This commit is contained in:
parent
3870ecd2e0
commit
1327bdf575
@ -102,6 +102,27 @@ describe('DashboardScene', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Given new dashboard in edit mode', () => {
|
||||
it('when saving it should clear isNew state', () => {
|
||||
const scene = buildTestScene({
|
||||
meta: { isNew: true },
|
||||
});
|
||||
|
||||
scene.activate();
|
||||
scene.onEnterEditMode();
|
||||
scene.saveCompleted({} as Dashboard, {
|
||||
id: 1,
|
||||
slug: 'slug',
|
||||
uid: 'dash-1',
|
||||
url: 'sss',
|
||||
version: 2,
|
||||
status: 'aaa',
|
||||
});
|
||||
|
||||
expect(scene.state.meta.isNew).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Given scene in edit mode', () => {
|
||||
let scene: DashboardScene;
|
||||
let deactivateScene: () => void;
|
||||
|
@ -252,6 +252,7 @@ export class DashboardScene extends SceneObjectBase<DashboardSceneState> {
|
||||
url: result.url,
|
||||
slug: result.slug,
|
||||
folderUid: folderUid,
|
||||
isNew: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user