PanelChrome: Use react Panel Header for angular panels. (#21265)

* WIP: Angular panel chrome, this is going to be tricky

* AngularPanelChrome: initial render works

* Options are showing up

* viz options working

* Fixed singlestat background

* AngularPanels: Fixed alert tab

* Removed anuglar loading spinner

* Dashboard: Refactor dashboard reducer & actions

* Dashboard: minor refactoring

* PanelChrome: loading state moved to header

* Subscribe to render events to solve title update issue

* Time info and query errors now works

* PanelHeader: unifying angular and react behavior

* added getPanelMenu test

* Scrollable now works again

* Various fixes

* Making stuff work

* seperate event emitter for angular

* Fixed issue sending updated dimensions to angular panel

* Minor tweaks

* Fixed tests

* Alerting: alert state now works

* Fixed unit tests

* Fixed a few null check errors

* Simplified events handling

* Fixed strict null checks
This commit is contained in:
Torkel Ödegaard
2020-02-09 10:53:34 +01:00
committed by GitHub
parent 2feaad8b0d
commit 34c397002c
37 changed files with 641 additions and 807 deletions

View File

@@ -22,31 +22,10 @@ import { PanelModel } from 'app/features/dashboard/state/PanelModel';
import { MetricsPanelCtrl } from '../metrics_panel_ctrl';
describe('MetricsPanelCtrl', () => {
describe('when getting additional menu items', () => {
describe('and has no datasource set but user has access to explore', () => {
it('should not return any items', async () => {
const ctrl = setupController({ hasAccessToExplore: true });
expect((await ctrl.getAdditionalMenuItems()).length).toBe(0);
});
});
describe('and has datasource set that supports explore and user does not have access to explore', () => {
it('should not return any items', async () => {
const ctrl = setupController({ hasAccessToExplore: false });
ctrl.datasource = { meta: { explore: true } } as any;
expect((await ctrl.getAdditionalMenuItems()).length).toBe(0);
});
});
describe('and has datasource set that supports explore and user has access to explore', () => {
it('should return one item', async () => {
const ctrl = setupController({ hasAccessToExplore: true });
ctrl.datasource = { meta: { explore: true } } as any;
expect((await ctrl.getAdditionalMenuItems()).length).toBe(1);
});
describe('can setup', () => {
it('should return controller', async () => {
const ctrl = setupController({ hasAccessToExplore: true });
expect((await ctrl.getAdditionalMenuItems()).length).toBe(0);
});
});
});