Use trialExpiry for determining if a user is on trial (#47975) (#47998)

(cherry picked from commit 6c1994cb86)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-04-20 20:54:14 +02:00
committed by GitHub
co-authored by Alex Khomenko
parent 644b23aba2
commit 301be18d86
2 changed files with 3 additions and 2 deletions
@@ -42,6 +42,7 @@ export interface LicenseInfo {
stateInfo: string;
edition: GrafanaEdition;
enabledFeatures: { [key: string]: boolean };
trialExpiry?: number;
}
/**
+2 -2
View File
@@ -1,8 +1,8 @@
import { config } from '@grafana/runtime/src';
export function isTrial() {
const settings = (config as any).licensing;
return settings?.isTrial;
const expiry = config.licenseInfo?.trialExpiry;
return !!(expiry && expiry > 0);
}
export const highlightTrial = () => isTrial() && config.featureToggles.featureHighlights;