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
cffbb6af
Commit
cffbb6af
authored
Jan 26, 2018
by
Alexander Zobnin
Committed by
Torkel Ödegaard
Jan 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix vertical panel repeat (#10619)
parent
b79017e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
24 deletions
+18
-24
public/app/features/dashboard/dashboard_model.ts
+8
-0
public/app/features/dashboard/specs/repeat.jest.ts
+10
-24
No files found.
public/app/features/dashboard/dashboard_model.ts
View file @
cffbb6af
...
...
@@ -354,6 +354,14 @@ export class DashboardModel {
if
(
panel
.
repeatDirection
===
REPEAT_DIR_VERTICAL
)
{
copy
.
gridPos
.
y
=
yPos
;
yPos
+=
copy
.
gridPos
.
h
;
// Update gridPos for panels below
let
panelBelowIndex
=
panelIndex
+
index
+
1
;
for
(
let
i
=
panelBelowIndex
;
i
<
this
.
panels
.
length
;
i
++
)
{
if
(
this
.
panels
[
i
].
gridPos
.
y
<
yPos
)
{
this
.
panels
[
i
].
gridPos
.
y
+=
copy
.
gridPos
.
h
;
}
}
}
else
{
// set width based on how many are selected
// assumed the repeated panels should take up full row width
...
...
public/app/features/dashboard/specs/repeat.jest.ts
View file @
cffbb6af
...
...
@@ -142,12 +142,9 @@ describe('given dashboard with panel repeat in vertical direction', function() {
beforeEach
(
function
()
{
dashboard
=
new
DashboardModel
({
panels
:
[
{
id
:
2
,
repeat
:
'apps'
,
repeatDirection
:
'v'
,
gridPos
:
{
x
:
5
,
y
:
0
,
h
:
2
,
w
:
8
},
},
{
id
:
1
,
type
:
'row'
,
gridPos
:
{
x
:
0
,
y
:
0
,
h
:
1
,
w
:
24
}
},
{
id
:
2
,
repeat
:
'apps'
,
repeatDirection
:
'v'
,
gridPos
:
{
x
:
5
,
y
:
1
,
h
:
2
,
w
:
8
}
},
{
id
:
3
,
type
:
'row'
,
gridPos
:
{
x
:
0
,
y
:
3
,
h
:
1
,
w
:
24
}
},
],
templating
:
{
list
:
[
...
...
@@ -171,24 +168,13 @@ describe('given dashboard with panel repeat in vertical direction', function() {
});
it
(
'should place on items on top of each other and keep witdh'
,
function
()
{
expect
(
dashboard
.
panels
[
0
].
gridPos
).
toMatchObject
({
x
:
5
,
y
:
0
,
h
:
2
,
w
:
8
,
});
expect
(
dashboard
.
panels
[
1
].
gridPos
).
toMatchObject
({
x
:
5
,
y
:
2
,
h
:
2
,
w
:
8
,
});
expect
(
dashboard
.
panels
[
2
].
gridPos
).
toMatchObject
({
x
:
5
,
y
:
4
,
h
:
2
,
w
:
8
,
});
expect
(
dashboard
.
panels
[
0
].
gridPos
).
toMatchObject
({
x
:
0
,
y
:
0
,
h
:
1
,
w
:
24
});
// first row
expect
(
dashboard
.
panels
[
1
].
gridPos
).
toMatchObject
({
x
:
5
,
y
:
1
,
h
:
2
,
w
:
8
});
expect
(
dashboard
.
panels
[
2
].
gridPos
).
toMatchObject
({
x
:
5
,
y
:
3
,
h
:
2
,
w
:
8
});
expect
(
dashboard
.
panels
[
3
].
gridPos
).
toMatchObject
({
x
:
5
,
y
:
5
,
h
:
2
,
w
:
8
});
expect
(
dashboard
.
panels
[
4
].
gridPos
).
toMatchObject
({
x
:
0
,
y
:
7
,
h
:
1
,
w
:
24
});
// last row
});
});
...
...
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