diff --git a/public/app/core/components/AlertBox/AlertBox.tsx b/public/app/core/components/AlertBox/AlertBox.tsx index 2de43bbd0b2..c99bf11ed7c 100644 --- a/public/app/core/components/AlertBox/AlertBox.tsx +++ b/public/app/core/components/AlertBox/AlertBox.tsx @@ -17,7 +17,8 @@ function getIconFromSeverity(severity: AppNotificationSeverity): string { case AppNotificationSeverity.Success: { return 'fa fa-check'; } - default: return null; + default: + return null; } } diff --git a/public/app/features/dashboard/containers/DashboardPage.test.tsx b/public/app/features/dashboard/containers/DashboardPage.test.tsx index 94aa0b32d46..3c5ed8e9b11 100644 --- a/public/app/features/dashboard/containers/DashboardPage.test.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.test.tsx @@ -210,4 +210,24 @@ describe('DashboardPage', () => { expect(ctx.dashboard.panels[0].type).toBe('add-panel'); }); }); + + dashboardPageScenario("Given panel with id 0", (ctx) => { + ctx.setup(() => { + ctx.mount(); + ctx.setDashboardProp({ + panels: [{ id: 0, type: 'graph'}], + schemaVersion: 17, + }); + ctx.wrapper.setProps({ + urlEdit: true, + urlFullscreen: true, + urlPanelId: '0' + }); + }); + + it('Should go into edit mode' , () => { + expect(ctx.wrapper.state().isEditing).toBe(true); + expect(ctx.wrapper.state().fullscreenPanel.id).toBe(0); + }); + }); }); diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index 4e059e9ee6c..27118e297b5 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -90,7 +90,6 @@ export class DashboardPage extends PureComponent { } componentWillUnmount() { - console.log('unmount', this.props.cleanUpDashboard); if (this.props.dashboard) { this.props.cleanUpDashboard(); } @@ -118,7 +117,7 @@ export class DashboardPage extends PureComponent { // Sync url state with model if (urlFullscreen !== dashboard.meta.fullscreen || urlEdit !== dashboard.meta.isEditing) { - if (urlPanelId) { + if (!isNaN(parseInt(urlPanelId, 10))) { this.onEnterFullscreen(); } else { this.onLeaveFullscreen(); diff --git a/public/app/features/dashboard/services/DashboardSrv.ts b/public/app/features/dashboard/services/DashboardSrv.ts index 4030765a5a3..72e0a2e3c07 100644 --- a/public/app/features/dashboard/services/DashboardSrv.ts +++ b/public/app/features/dashboard/services/DashboardSrv.ts @@ -60,7 +60,7 @@ export class DashboardSrv { delete urlParams.edit; } - if (options.panelId) { + if (options.panelId !== undefined) { urlParams.panelId = options.panelId; } else { delete urlParams.panelId;