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
d88286ab
Commit
d88286ab
authored
Feb 23, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orgs: set orgId as query param on load
ref #1613
parent
73830a44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
public/app/features/dashboard/viewStateSrv.js
+3
-1
public/test/specs/dashboardViewStateSrv-specs.js
+11
-6
No files found.
public/app/features/dashboard/viewStateSrv.js
View file @
d88286ab
...
...
@@ -2,8 +2,9 @@ define([
'angular'
,
'lodash'
,
'jquery'
,
'app/core/config'
],
function
(
angular
,
_
,
$
)
{
function
(
angular
,
_
,
$
,
config
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.services'
);
...
...
@@ -63,6 +64,7 @@ function (angular, _, $) {
state
.
fullscreen
=
state
.
fullscreen
?
true
:
null
;
state
.
edit
=
(
state
.
edit
===
"true"
||
state
.
edit
===
true
)
||
null
;
state
.
editview
=
state
.
editview
||
null
;
state
.
orgId
=
config
.
bootData
.
user
.
orgId
;
return
state
;
};
...
...
public/test/specs/dashboardViewStateSrv-specs.js
View file @
d88286ab
define
([
'app/features/dashboard/viewStateSrv'
],
function
()
{
'app/features/dashboard/viewStateSrv'
,
'app/core/config'
],
function
(
viewStateSrv
,
config
)
{
'use strict'
;
describe
(
'when updating view state'
,
function
()
{
...
...
@@ -12,7 +13,13 @@ define([
orgId
:
19
}
};
beforeEach
(
function
()
{
config
.
bootData
=
{
user
:
{
orgId
:
1
}
};
});
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
module
(
function
(
$provide
)
{
$provide
.
value
(
'timeSrv'
,
timeSrv
);
...
...
@@ -31,7 +38,7 @@ define([
it
(
'should update querystring and view state'
,
function
()
{
var
updateState
=
{
fullscreen
:
true
,
edit
:
true
,
panelId
:
1
};
viewState
.
update
(
updateState
);
expect
(
location
.
search
()).
to
.
eql
({
fullscreen
:
true
,
edit
:
true
,
panelId
:
1
});
expect
(
location
.
search
()).
to
.
eql
({
fullscreen
:
true
,
edit
:
true
,
panelId
:
1
,
orgId
:
1
});
expect
(
viewState
.
dashboard
.
meta
.
fullscreen
).
to
.
be
(
true
);
expect
(
viewState
.
state
.
fullscreen
).
to
.
be
(
true
);
});
...
...
@@ -45,7 +52,5 @@ define([
expect
(
viewState
.
state
.
fullscreen
).
to
.
be
(
null
);
});
});
});
});
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