Show version mismatch warning only on OSS (#245)

This commit is contained in:
Vadim Stepanov 2022-07-18 15:37:02 +01:00 committed by GitHub
parent 447de7059a
commit 5b5798a4e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 14 deletions

View file

@ -89,20 +89,23 @@ const DefaultPageLayout: FC<DefaultPageLayoutProps> = observer((props) => {
/>
</Alert>
)}
{store.backendVersion && plugin?.version && store.backendVersion !== plugin?.version && (
<Alert className={styles.alert} severity="warning" title={'Version mismatch!'}>
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!
<br />
{`Current plugin version: ${plugin.version}, current engine version: ${store.backendVersion}`}
<br />
Please see{' '}
<a href={'https://grafana.com/docs/oncall/latest/open-source/#update-grafana-oncall-oss'}>
the update instructions
</a>
.
</Alert>
)}
{store.backendLicense === 'OpenSource' &&
store.backendVersion &&
plugin?.version &&
store.backendVersion !== plugin?.version && (
<Alert className={styles.alert} severity="warning" title={'Version mismatch!'}>
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!
<br />
{`Current plugin version: ${plugin.version}, current engine version: ${store.backendVersion}`}
<br />
Please see{' '}
<a href={'https://grafana.com/docs/oncall/latest/open-source/#update-grafana-oncall-oss'}>
the update instructions
</a>
.
</Alert>
)}
{currentTeam?.limits.show_limits_warning &&
currentTeam?.limits.period_title !== 'Version mismatch' && // don't show version mismatch warning twice
!getItem(currentTeam.limits.warning_text) && (

View file

@ -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;
}