mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix: Shows SubMenu when filtering directly from table (#21017)
* Fix: Shows SubMenu when filtering from table Fixes #20270 * Tests: Updates snapshots * Refactor: Changes after PR comments * Refactor: Changes template
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
import angular, { ILocationService } from 'angular';
|
||||
import _ from 'lodash';
|
||||
import { VariableSrv } from 'app/features/templating/all';
|
||||
import { CoreEvents } from '../../../../types';
|
||||
|
||||
export class SubMenuCtrl {
|
||||
annotations: any;
|
||||
variables: any;
|
||||
dashboard: any;
|
||||
submenuEnabled: boolean;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private variableSrv: VariableSrv, private $location: ILocationService) {
|
||||
this.annotations = this.dashboard.templating.list;
|
||||
this.variables = this.variableSrv.variables;
|
||||
this.submenuEnabled = false;
|
||||
this.dashboard.events.on(CoreEvents.submenuVisibilityChanged, (enabled: boolean) => {
|
||||
this.submenuEnabled = enabled;
|
||||
});
|
||||
}
|
||||
|
||||
annotationStateChanged() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="submenu-controls">
|
||||
<div class="submenu-controls" ng-hide="ctrl.submenuEnabled === false">
|
||||
<div ng-repeat="variable in ctrl.variables" ng-hide="variable.hide === 2" class="submenu-item gf-form-inline">
|
||||
<div class="gf-form">
|
||||
<label
|
||||
|
||||
Reference in New Issue
Block a user