Skip to content

Commit 2bb1429

Browse files
committed
Fix grafana bugs
1 parent 03dd9cc commit 2bb1429

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

public/app/features/dashboard/containers/DashboardPage.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export interface DashboardPageRouteParams {
6060
type?: string;
6161
slug?: string;
6262
accessToken?: string;
63+
version?: number;
6364
}
6465

6566
export type DashboardPageRouteSearchParams = {
@@ -250,7 +251,7 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
250251
routeName: this.props.route.routeName,
251252
fixUrl: !isPublic && !FNDashboard,
252253
accessToken: match.params.accessToken,
253-
keybindingSrv: this.context.keybindings,
254+
keybindingSrv: this.context?.keybindings,
254255
});
255256

256257
// small delay to start live updates

public/app/features/dashboard/containers/SoloPanelPage.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class SoloPanelPage extends Component<Props, State> {
5252
urlType: match.params.type,
5353
routeName: route.routeName,
5454
fixUrl: false,
55-
keybindingSrv: this.context.keybindings,
55+
keybindingSrv: this.context?.keybindings,
5656
});
5757
}
5858

public/app/features/dashboard/state/initDashboard.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface InitDashboardArgs {
4141
accessToken?: string;
4242
routeName?: string;
4343
fixUrl: boolean;
44-
keybindingSrv: KeybindingSrv;
44+
keybindingSrv?: KeybindingSrv;
4545
}
4646

4747
async function fetchDashboard(
@@ -79,7 +79,12 @@ async function fetchDashboard(
7979
return await dashboardLoaderSrv.loadDashboard('public', args.urlSlug, args.accessToken, args.version);
8080
}
8181
case DashboardRoutes.Normal: {
82-
const dashDTO: DashboardDTO = await dashboardLoaderSrv.loadDashboard(args.urlType, args.urlSlug, args.urlUid, args.version);
82+
const dashDTO: DashboardDTO = await dashboardLoaderSrv.loadDashboard(
83+
args.urlType,
84+
args.urlSlug,
85+
args.urlUid,
86+
args.version
87+
);
8388

8489
if (args.fixUrl && dashDTO.meta.url && !playlistSrv.isPlaying) {
8590
// check if the current url is correct (might be old slug)

0 commit comments

Comments
 (0)