From 2bb1429028b3b4709b2410156860509c82c13810 Mon Sep 17 00:00:00 2001 From: Spikatrix <12792882+Spikatrix@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:29:38 +0000 Subject: [PATCH 1/3] Fix grafana bugs --- .../app/features/dashboard/containers/DashboardPage.tsx | 3 ++- .../app/features/dashboard/containers/SoloPanelPage.tsx | 2 +- public/app/features/dashboard/state/initDashboard.ts | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index 9c5b113a681f0..0559787c3fff5 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -60,6 +60,7 @@ export interface DashboardPageRouteParams { type?: string; slug?: string; accessToken?: string; + version?: number; } export type DashboardPageRouteSearchParams = { @@ -250,7 +251,7 @@ export class UnthemedDashboardPage extends PureComponent { routeName: this.props.route.routeName, fixUrl: !isPublic && !FNDashboard, accessToken: match.params.accessToken, - keybindingSrv: this.context.keybindings, + keybindingSrv: this.context?.keybindings, }); // small delay to start live updates diff --git a/public/app/features/dashboard/containers/SoloPanelPage.tsx b/public/app/features/dashboard/containers/SoloPanelPage.tsx index 04fc483129a5f..aa4a1673e36e6 100644 --- a/public/app/features/dashboard/containers/SoloPanelPage.tsx +++ b/public/app/features/dashboard/containers/SoloPanelPage.tsx @@ -52,7 +52,7 @@ export class SoloPanelPage extends Component { urlType: match.params.type, routeName: route.routeName, fixUrl: false, - keybindingSrv: this.context.keybindings, + keybindingSrv: this.context?.keybindings, }); } diff --git a/public/app/features/dashboard/state/initDashboard.ts b/public/app/features/dashboard/state/initDashboard.ts index 77219541c60d5..336f545ff9226 100644 --- a/public/app/features/dashboard/state/initDashboard.ts +++ b/public/app/features/dashboard/state/initDashboard.ts @@ -41,7 +41,7 @@ export interface InitDashboardArgs { accessToken?: string; routeName?: string; fixUrl: boolean; - keybindingSrv: KeybindingSrv; + keybindingSrv?: KeybindingSrv; } async function fetchDashboard( @@ -79,7 +79,12 @@ async function fetchDashboard( return await dashboardLoaderSrv.loadDashboard('public', args.urlSlug, args.accessToken, args.version); } case DashboardRoutes.Normal: { - const dashDTO: DashboardDTO = await dashboardLoaderSrv.loadDashboard(args.urlType, args.urlSlug, args.urlUid, args.version); + const dashDTO: DashboardDTO = await dashboardLoaderSrv.loadDashboard( + args.urlType, + args.urlSlug, + args.urlUid, + args.version + ); if (args.fixUrl && dashDTO.meta.url && !playlistSrv.isPlaying) { // check if the current url is correct (might be old slug) From f430b26d80af066c37d92f6fee3855aac9e2d9ee Mon Sep 17 00:00:00 2001 From: Spikatrix <12792882+Spikatrix@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:47:57 +0000 Subject: [PATCH 2/3] Update grafana font to source sans pro --- packages/grafana-data/src/themes/createTypography.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grafana-data/src/themes/createTypography.ts b/packages/grafana-data/src/themes/createTypography.ts index cebba1421c2f9..787ee21b89671 100644 --- a/packages/grafana-data/src/themes/createTypography.ts +++ b/packages/grafana-data/src/themes/createTypography.ts @@ -63,8 +63,8 @@ export interface ThemeTypographyInput { htmlFontSize?: number; } -const defaultFontFamily = 'Nunito, Roboto, Arial'; //'"Roboto", "Helvetica", "Arial", sans-serif'; -const defaultFontFamilyMonospace = "'Nunito Mono', monospace"; +const defaultFontFamily = '"Source Sans Pro", Nunito, Roboto, Arial'; //'"Roboto", "Helvetica", "Arial", sans-serif'; +const defaultFontFamilyMonospace = "'Nunito Mono', 'Roboto Mono', monospace"; // "'Roboto Mono', monospace"; export function createTypography(colors: ThemeColors, typographyInput: ThemeTypographyInput = {}): ThemeTypography { const { From 95b694c31b397da2f207cea645277174c0da766a Mon Sep 17 00:00:00 2001 From: Spikatrix <12792882+Spikatrix@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:50:44 +0000 Subject: [PATCH 3/3] Revert code format change --- public/app/features/dashboard/state/initDashboard.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/public/app/features/dashboard/state/initDashboard.ts b/public/app/features/dashboard/state/initDashboard.ts index 336f545ff9226..0b71cb9d9e32f 100644 --- a/public/app/features/dashboard/state/initDashboard.ts +++ b/public/app/features/dashboard/state/initDashboard.ts @@ -79,12 +79,7 @@ async function fetchDashboard( return await dashboardLoaderSrv.loadDashboard('public', args.urlSlug, args.accessToken, args.version); } case DashboardRoutes.Normal: { - const dashDTO: DashboardDTO = await dashboardLoaderSrv.loadDashboard( - args.urlType, - args.urlSlug, - args.urlUid, - args.version - ); + const dashDTO: DashboardDTO = await dashboardLoaderSrv.loadDashboard(args.urlType, args.urlSlug, args.urlUid, args.version); if (args.fixUrl && dashDTO.meta.url && !playlistSrv.isPlaying) { // check if the current url is correct (might be old slug)