Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
4b84a585
Commit
4b84a585
authored
Aug 03, 2018
by
Tobias Skarhed
Committed by
Torkel Ödegaard
Aug 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable submenu when autopanels is enabled
parent
36c406ee
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletions
+21
-1
public/app/features/dashboard/dashboard_ctrl.ts
+3
-1
public/app/features/dashboard/dashboard_model.ts
+5
-0
public/app/features/dashboard/specs/dashboard_model.jest.ts
+13
-0
No files found.
public/app/features/dashboard/dashboard_ctrl.ts
View file @
4b84a585
...
@@ -91,7 +91,7 @@ export class DashboardCtrl implements PanelContainer {
...
@@ -91,7 +91,7 @@ export class DashboardCtrl implements PanelContainer {
);
);
//Consider navbar and submenu controls, padding and margin
//Consider navbar and submenu controls, padding and margin
let
availableHeight
=
window
.
innerHeight
-
8
0
;
let
availableHeight
=
window
.
innerHeight
-
4
0
;
let
availableRows
=
Math
.
floor
(
availableHeight
/
(
GRID_CELL_HEIGHT
+
GRID_CELL_VMARGIN
));
let
availableRows
=
Math
.
floor
(
availableHeight
/
(
GRID_CELL_HEIGHT
+
GRID_CELL_VMARGIN
));
let
scaleFactor
=
maxRows
/
availableRows
;
let
scaleFactor
=
maxRows
/
availableRows
;
...
@@ -99,6 +99,8 @@ export class DashboardCtrl implements PanelContainer {
...
@@ -99,6 +99,8 @@ export class DashboardCtrl implements PanelContainer {
panel
.
gridPos
.
y
=
Math
.
round
(
panel
.
gridPos
.
y
/
scaleFactor
)
||
1
;
panel
.
gridPos
.
y
=
Math
.
round
(
panel
.
gridPos
.
y
/
scaleFactor
)
||
1
;
panel
.
gridPos
.
h
=
Math
.
round
(
panel
.
gridPos
.
h
/
scaleFactor
)
||
1
;
panel
.
gridPos
.
h
=
Math
.
round
(
panel
.
gridPos
.
h
/
scaleFactor
)
||
1
;
});
});
this
.
dashboard
.
meta
.
autofitpanels
=
true
;
console
.
log
(
this
.
dashboard
);
}
}
}
}
...
...
public/app/features/dashboard/dashboard_model.ts
View file @
4b84a585
...
@@ -9,6 +9,7 @@ import sortByKeys from 'app/core/utils/sort_by_keys';
...
@@ -9,6 +9,7 @@ import sortByKeys from 'app/core/utils/sort_by_keys';
import
{
PanelModel
}
from
'./panel_model'
;
import
{
PanelModel
}
from
'./panel_model'
;
import
{
DashboardMigrator
}
from
'./dashboard_migration'
;
import
{
DashboardMigrator
}
from
'./dashboard_migration'
;
import
{
tickStep
}
from
'../../core/utils/ticks'
;
export
class
DashboardModel
{
export
class
DashboardModel
{
id
:
any
;
id
:
any
;
...
@@ -591,6 +592,10 @@ export class DashboardModel {
...
@@ -591,6 +592,10 @@ export class DashboardModel {
updateSubmenuVisibility
()
{
updateSubmenuVisibility
()
{
this
.
meta
.
submenuEnabled
=
(()
=>
{
this
.
meta
.
submenuEnabled
=
(()
=>
{
if
(
this
.
meta
.
autofitpanels
)
{
return
false
;
}
if
(
this
.
links
.
length
>
0
)
{
if
(
this
.
links
.
length
>
0
)
{
return
true
;
return
true
;
}
}
...
...
public/app/features/dashboard/specs/dashboard_model.jest.ts
View file @
4b84a585
...
@@ -305,6 +305,19 @@ describe('DashboardModel', function() {
...
@@ -305,6 +305,19 @@ describe('DashboardModel', function() {
});
});
});
});
describe
(
'updateSubmenuVisibility with autofitpanels enabled'
,
function
()
{
var
model
;
beforeEach
(
function
()
{
model
=
new
DashboardModel
({},
{
autofitpanels
:
true
});
model
.
updateSubmenuVisibility
();
});
it
(
'should not enable submmenu'
,
function
()
{
expect
(
model
.
meta
.
submenuEnabled
).
toBe
(
false
);
});
});
describe
(
'updateSubmenuVisibility with hidden annotation toggle'
,
function
()
{
describe
(
'updateSubmenuVisibility with hidden annotation toggle'
,
function
()
{
var
dashboard
;
var
dashboard
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment