Chore: Add type info for grafana boot data (#45322)

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
This commit is contained in:
kay delaney
2022-03-30 10:48:58 +01:00
committed by GitHub
parent 6889e39526
commit f1c3177e79
15 changed files with 142 additions and 65 deletions

View File

@@ -53,7 +53,7 @@ describe('ShareEmbed', () => {
user: {
orgId: 1,
},
};
} as any;
});
afterAll(() => {

View File

@@ -110,7 +110,7 @@ describe('ShareModal', () => {
user: {
orgId: 1,
},
};
} as any;
ctx.mount({
panel: new PanelModel({ id: 22, options: {}, fieldConfig: { defaults: {}, overrides: [] } }),
});
@@ -202,7 +202,7 @@ describe('when default_home_dashboard_path is set in the grafana config', () =>
user: {
orgId: 1,
},
};
} as any;
});
afterAll(() => {

View File

@@ -36,7 +36,7 @@ describe('buildParams', () => {
to: 2000,
raw: { from: 'now-6h', to: 'now' },
} as unknown as TimeRange;
const orgId = '2';
const orgId = 2;
const result = buildParams({ useCurrentTimeRange, selectedTheme, panel, search, range, orgId });
expect(result.toString()).toEqual(expected);

View File

@@ -9,7 +9,7 @@ export interface BuildParamsArgs {
panel?: PanelModel;
search?: string;
range?: TimeRange;
orgId?: string;
orgId?: number;
}
export function buildParams({
@@ -24,7 +24,7 @@ export function buildParams({
searchParams.set('from', String(range.from.valueOf()));
searchParams.set('to', String(range.to.valueOf()));
searchParams.set('orgId', orgId);
searchParams.set('orgId', String(orgId));
if (!useCurrentTimeRange) {
searchParams.delete('from');