mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
Fixed handling of orgId
This commit is contained in:
parent
7634e04231
commit
f695975f65
@ -68,5 +68,5 @@ const bootData = (window as any).grafanaBootData || {
|
||||
const options = bootData.settings;
|
||||
options.bootData = bootData;
|
||||
|
||||
const config = new Settings(options);
|
||||
export const config = new Settings(options);
|
||||
export default config;
|
||||
|
@ -9,6 +9,7 @@ export class DashboardSrv {
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, private $rootScope, private $location) {
|
||||
appEvents.on('save-dashboard', this.saveDashboard.bind(this), $rootScope);
|
||||
appEvents.on('save-dashboard', this.saveDashboard.bind(this), $rootScope);
|
||||
}
|
||||
|
||||
create(dashboard, meta) {
|
||||
|
@ -6,6 +6,7 @@ import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
import { AnnotationsSrv } from 'app/features/annotations/annotations_srv';
|
||||
import { VariableSrv } from 'app/features/templating/variable_srv';
|
||||
import { KeybindingSrv } from 'app/core/services/keybindingSrv';
|
||||
import { config } from 'app/core/config';
|
||||
|
||||
// Actions
|
||||
import { updateLocation } from 'app/core/actions';
|
||||
@ -88,7 +89,7 @@ export function initDashboard({
|
||||
|
||||
if (dashboardUrl !== currentPath) {
|
||||
// replace url to not create additional history items and then return so that initDashboard below isn't executed multiple times.
|
||||
dispatch(updateLocation({path: dashboardUrl, partial: true, replace: true}));
|
||||
dispatch(updateLocation({ path: dashboardUrl, partial: true, replace: true }));
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -117,6 +118,11 @@ export function initDashboard({
|
||||
return;
|
||||
}
|
||||
|
||||
// add missing orgId query param
|
||||
if (!getState().location.query.orgId) {
|
||||
dispatch(updateLocation({ query: { orgId: config.bootData.user.orgId }, partial: true, replace: true }));
|
||||
}
|
||||
|
||||
// init services
|
||||
const timeSrv: TimeSrv = $injector.get('timeSrv');
|
||||
const annotationsSrv: AnnotationsSrv = $injector.get('annotationsSrv');
|
||||
|
@ -25,7 +25,6 @@ describe('VariableSrv init', function(this: any) {
|
||||
};
|
||||
|
||||
const $injector = {} as any;
|
||||
|
||||
let ctx = {} as any;
|
||||
|
||||
function describeInitScenario(desc, fn) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { DashboardSearchHit } from './search';
|
||||
import { DashboardSearchHit } from './search';
|
||||
|
||||
export interface OrgUser {
|
||||
avatarUrl: string;
|
||||
|
Loading…
Reference in New Issue
Block a user