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
3b04efa4
Commit
3b04efa4
authored
Feb 16, 2018
by
Mitsuhiro Tanda
Committed by
Torkel Ödegaard
Feb 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate minSpan (#10924)
parent
244ae555
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
public/app/features/dashboard/dashboard_migration.ts
+3
-0
public/app/features/dashboard/specs/dashboard_migration.jest.ts
+8
-0
No files found.
public/app/features/dashboard/dashboard_migration.ts
View file @
3b04efa4
...
@@ -429,6 +429,9 @@ export class DashboardMigrator {
...
@@ -429,6 +429,9 @@ export class DashboardMigrator {
for
(
let
panel
of
row
.
panels
)
{
for
(
let
panel
of
row
.
panels
)
{
panel
.
span
=
panel
.
span
||
DEFAULT_PANEL_SPAN
;
panel
.
span
=
panel
.
span
||
DEFAULT_PANEL_SPAN
;
if
(
panel
.
minSpan
)
{
panel
.
minSpan
=
Math
.
min
(
GRID_COLUMN_COUNT
,
GRID_COLUMN_COUNT
/
12
*
panel
.
minSpan
);
}
const
panelWidth
=
Math
.
floor
(
panel
.
span
)
*
widthFactor
;
const
panelWidth
=
Math
.
floor
(
panel
.
span
)
*
widthFactor
;
const
panelHeight
=
panel
.
height
?
getGridHeight
(
panel
.
height
)
:
rowGridHeight
;
const
panelHeight
=
panel
.
height
?
getGridHeight
(
panel
.
height
)
:
rowGridHeight
;
...
...
public/app/features/dashboard/specs/dashboard_migration.jest.ts
View file @
3b04efa4
...
@@ -363,6 +363,14 @@ describe('DashboardModel', function() {
...
@@ -363,6 +363,14 @@ describe('DashboardModel', function() {
expect
(
dashboard
.
panels
[
0
].
repeat
).
toBe
(
'server'
);
expect
(
dashboard
.
panels
[
0
].
repeat
).
toBe
(
'server'
);
expect
(
dashboard
.
panels
.
length
).
toBe
(
2
);
expect
(
dashboard
.
panels
.
length
).
toBe
(
2
);
});
});
it
(
'minSpan should be twice'
,
function
()
{
model
.
rows
=
[
createRow
({
height
:
8
},
[[
6
]])];
model
.
rows
[
0
].
panels
[
0
]
=
{
minSpan
:
12
};
let
dashboard
=
new
DashboardModel
(
model
);
expect
(
dashboard
.
panels
[
0
].
minSpan
).
toBe
(
24
);
});
});
});
});
});
...
...
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