From 5b5798a4e28d4d4901e7c1da218b8e5dacecb515 Mon Sep 17 00:00:00 2001 From: Vadim Stepanov Date: Mon, 18 Jul 2022 15:37:02 +0100 Subject: [PATCH] Show version mismatch warning only on OSS (#245) --- .../DefaultPageLayout/DefaultPageLayout.tsx | 31 ++++++++++--------- grafana-plugin/src/state/rootBaseStore.ts | 4 +++ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/grafana-plugin/src/containers/DefaultPageLayout/DefaultPageLayout.tsx b/grafana-plugin/src/containers/DefaultPageLayout/DefaultPageLayout.tsx index 2f4cf07f..af3260d1 100644 --- a/grafana-plugin/src/containers/DefaultPageLayout/DefaultPageLayout.tsx +++ b/grafana-plugin/src/containers/DefaultPageLayout/DefaultPageLayout.tsx @@ -89,20 +89,23 @@ const DefaultPageLayout: FC = observer((props) => { /> )} - {store.backendVersion && plugin?.version && store.backendVersion !== plugin?.version && ( - - Please make sure you have the same versions of the Grafana OnCall plugin and the Grafana OnCall engine, - otherwise there could be issues with your Grafana OnCall installation! -
- {`Current plugin version: ${plugin.version}, current engine version: ${store.backendVersion}`} -
- Please see{' '} - - the update instructions - - . -
- )} + {store.backendLicense === 'OpenSource' && + store.backendVersion && + plugin?.version && + store.backendVersion !== plugin?.version && ( + + Please make sure you have the same versions of the Grafana OnCall plugin and the Grafana OnCall engine, + otherwise there could be issues with your Grafana OnCall installation! +
+ {`Current plugin version: ${plugin.version}, current engine version: ${store.backendVersion}`} +
+ Please see{' '} + + the update instructions + + . +
+ )} {currentTeam?.limits.show_limits_warning && currentTeam?.limits.period_title !== 'Version mismatch' && // don't show version mismatch warning twice !getItem(currentTeam.limits.warning_text) && ( diff --git a/grafana-plugin/src/state/rootBaseStore.ts b/grafana-plugin/src/state/rootBaseStore.ts index 0c2e933f..3746d9eb 100644 --- a/grafana-plugin/src/state/rootBaseStore.ts +++ b/grafana-plugin/src/state/rootBaseStore.ts @@ -41,6 +41,9 @@ export class RootBaseStore { @observable backendVersion = ''; + @observable + backendLicense = ''; + @observable pluginIsInitialized = true; @@ -138,6 +141,7 @@ export class RootBaseStore { return; } this.backendVersion = get_sync_response.version; + this.backendLicense = get_sync_response.license; this.appLoading = false; }