mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
73830a44fe
commit
d88286ab81
@ -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;
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user