Skip to content

Commit 5b5798a

Browse files
authored
Show version mismatch warning only on OSS (#245)
1 parent 447de70 commit 5b5798a

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

grafana-plugin/src/containers/DefaultPageLayout/DefaultPageLayout.tsx

+17-14
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,23 @@ const DefaultPageLayout: FC<DefaultPageLayoutProps> = observer((props) => {
8989
/>
9090
</Alert>
9191
)}
92-
{store.backendVersion && plugin?.version && store.backendVersion !== plugin?.version && (
93-
<Alert className={styles.alert} severity="warning" title={'Version mismatch!'}>
94-
Please make sure you have the same versions of the Grafana OnCall plugin and the Grafana OnCall engine,
95-
otherwise there could be issues with your Grafana OnCall installation!
96-
<br />
97-
{`Current plugin version: ${plugin.version}, current engine version: ${store.backendVersion}`}
98-
<br />
99-
Please see{' '}
100-
<a href={'https://grafana.com/docs/oncall/latest/open-source/#update-grafana-oncall-oss'}>
101-
the update instructions
102-
</a>
103-
.
104-
</Alert>
105-
)}
92+
{store.backendLicense === 'OpenSource' &&
93+
store.backendVersion &&
94+
plugin?.version &&
95+
store.backendVersion !== plugin?.version && (
96+
<Alert className={styles.alert} severity="warning" title={'Version mismatch!'}>
97+
Please make sure you have the same versions of the Grafana OnCall plugin and the Grafana OnCall engine,
98+
otherwise there could be issues with your Grafana OnCall installation!
99+
<br />
100+
{`Current plugin version: ${plugin.version}, current engine version: ${store.backendVersion}`}
101+
<br />
102+
Please see{' '}
103+
<a href={'https://grafana.com/docs/oncall/latest/open-source/#update-grafana-oncall-oss'}>
104+
the update instructions
105+
</a>
106+
.
107+
</Alert>
108+
)}
106109
{currentTeam?.limits.show_limits_warning &&
107110
currentTeam?.limits.period_title !== 'Version mismatch' && // don't show version mismatch warning twice
108111
!getItem(currentTeam.limits.warning_text) && (

grafana-plugin/src/state/rootBaseStore.ts

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export class RootBaseStore {
4141
@observable
4242
backendVersion = '';
4343

44+
@observable
45+
backendLicense = '';
46+
4447
@observable
4548
pluginIsInitialized = true;
4649

@@ -138,6 +141,7 @@ export class RootBaseStore {
138141
return;
139142
}
140143
this.backendVersion = get_sync_response.version;
144+
this.backendLicense = get_sync_response.license;
141145
this.appLoading = false;
142146
}
143147

0 commit comments

Comments
 (0)