Config: Use license info instead of build info for feature toggling (#21558)

This commit is contained in:
Emil Tullstedt
2020-01-17 15:44:12 +01:00
committed by GitHub
parent 0e3a7b1a6f
commit 26f72ccc4e
8 changed files with 16 additions and 9 deletions
+8 -1
View File
@@ -5,7 +5,7 @@ import { GrafanaTheme, GrafanaThemeType, PanelPluginMeta, DataSourceInstanceSett
export interface BuildInfo {
version: string;
commit: string;
isEnterprise: boolean;
isEnterprise: boolean; // deprecated: use licenseInfo.hasLicense instead
env: string;
latestVersion: string;
hasUpdate: boolean;
@@ -17,6 +17,12 @@ interface FeatureToggles {
expressions: boolean;
newEdit: boolean;
}
interface LicenseInfo {
hasLicense: boolean;
expiry: number;
}
export class GrafanaBootConfig {
datasources: { [str: string]: DataSourceInstanceSettings } = {};
panels: { [key: string]: PanelPluginMeta } = {};
@@ -55,6 +61,7 @@ export class GrafanaBootConfig {
expressions: false,
newEdit: false,
};
licenseInfo: LicenseInfo = {} as LicenseInfo;
constructor(options: GrafanaBootConfig) {
this.theme = options.bootData.user.lightTheme ? getTheme(GrafanaThemeType.Light) : getTheme(GrafanaThemeType.Dark);