diff --git a/pkg/api/dtos/frontend_settings.go b/pkg/api/dtos/frontend_settings.go index 33a06b2982e..61f21faef16 100644 --- a/pkg/api/dtos/frontend_settings.go +++ b/pkg/api/dtos/frontend_settings.go @@ -111,6 +111,7 @@ type FrontendSettingsWhitelabelingDTO struct { LoginSubtitle *string `json:"loginSubtitle,omitempty"` LoginBoxBackground *string `json:"loginBoxBackground,omitempty"` LoadingLogo *string `json:"loadingLogo,omitempty"` + HideEdition *bool `json:"hideEdition,omitempty"` PublicDashboardFooter *FrontendSettingsPublicDashboardFooterConfigDTO `json:"publicDashboardFooter,omitempty"` // PR TODO: type this properly } diff --git a/public/app/core/components/Branding/Branding.tsx b/public/app/core/components/Branding/Branding.tsx index 3b1b302ce16..0082d219c0f 100644 --- a/public/app/core/components/Branding/Branding.tsx +++ b/public/app/core/components/Branding/Branding.tsx @@ -61,6 +61,7 @@ export class Branding { static LoginBoxBackground = LoginBoxBackground; static AppTitle = 'Grafana'; static LoginTitle = 'Welcome to Grafana'; + static HideEdition = false; static GetLoginSubTitle = (): null | string => { return null; }; diff --git a/public/app/core/components/Branding/types.ts b/public/app/core/components/Branding/types.ts index ed7c6bde557..d80b98f9b7f 100644 --- a/public/app/core/components/Branding/types.ts +++ b/public/app/core/components/Branding/types.ts @@ -12,5 +12,6 @@ export interface BrandingSettings { menuLogo?: string; favIcon?: string; loadingLogo?: string; + hideEdition?: boolean; appleTouchIcon?: string; } diff --git a/public/app/core/components/Footer/Footer.tsx b/public/app/core/components/Footer/Footer.tsx index 3ebe9e3b733..62739518c0c 100644 --- a/public/app/core/components/Footer/Footer.tsx +++ b/public/app/core/components/Footer/Footer.tsx @@ -48,17 +48,19 @@ export function getVersionMeta(version: string) { }; } -export function getVersionLinks(): FooterLink[] { +export function getVersionLinks(hideEdition?: boolean): FooterLink[] { const { buildInfo, licenseInfo } = config; const links: FooterLink[] = []; const stateInfo = licenseInfo.stateInfo ? ` (${licenseInfo.stateInfo})` : ''; - links.push({ - target: '_blank', - id: 'license', - text: `${buildInfo.edition}${stateInfo}`, - url: licenseInfo.licenseUrl, - }); + if (!hideEdition) { + links.push({ + target: '_blank', + id: 'license', + text: `${buildInfo.edition}${stateInfo}`, + url: licenseInfo.licenseUrl, + }); + } if (buildInfo.hideVersion) { return links; @@ -93,10 +95,11 @@ export function setFooterLinksFn(fn: typeof getFooterLinks) { export interface Props { /** Link overrides to show specific links in the UI */ customLinks?: FooterLink[] | null; + hideEdition?: boolean; } -export const Footer = React.memo(({ customLinks }: Props) => { - const links = (customLinks || getFooterLinks()).concat(getVersionLinks()); +export const Footer = React.memo(({ customLinks, hideEdition }: Props) => { + const links = (customLinks || getFooterLinks()).concat(getVersionLinks(hideEdition)); return (