diff --git a/engine/apps/api/serializers/organization.py b/engine/apps/api/serializers/organization.py index 49179049..58013052 100644 --- a/engine/apps/api/serializers/organization.py +++ b/engine/apps/api/serializers/organization.py @@ -3,7 +3,6 @@ from datetime import timedelta import humanize import pytz from django.apps import apps -from django.conf import settings from django.utils import timezone from rest_framework import fields, serializers @@ -110,25 +109,7 @@ class CurrentOrganizationSerializer(OrganizationSerializer): def get_limits(self, obj): user = self.context["request"].user - if not settings.OSS_INSTALLATION: - return obj.notifications_limit_web_report(user) - - # show a version warning on OSS installations in case backend and frontend are different versions - frontend_version = self.context["request"].headers.get("X-OnCall-Plugin-Version") - backend_version = settings.VERSION - version_warning = {} - if backend_version and frontend_version and backend_version != frontend_version: - text = ( - "Version mismatch! Please make sure you have the same versions of the Grafana OnCall plugin " - "and Grafana OnCall engine, " - "otherwise there could be issues with your Grafana OnCall installation! " - f"Current plugin version: {frontend_version}, current engine version: {backend_version}. " - "Please see the update instructions: " - "https://grafana.com/docs/oncall/latest/open-source/#update-grafana-oncall-oss" - ) - version_warning = {"period_title": "Version mismatch", "show_limits_warning": True, "warning_text": text} - - return version_warning or obj.notifications_limit_web_report(user) + return obj.notifications_limit_web_report(user) def get_env_status(self, obj): LiveSetting.populate_settings_if_needed() diff --git a/grafana-plugin/src/containers/DefaultPageLayout/DefaultPageLayout.tsx b/grafana-plugin/src/containers/DefaultPageLayout/DefaultPageLayout.tsx index 5cefb3b1..64e9b877 100644 --- a/grafana-plugin/src/containers/DefaultPageLayout/DefaultPageLayout.tsx +++ b/grafana-plugin/src/containers/DefaultPageLayout/DefaultPageLayout.tsx @@ -93,8 +93,14 @@ const DefaultPageLayout: FC = observer((props) => { {store.backendLicense === GRAFANA_LICENSE_OSS && store.backendVersion && plugin?.version && - store.backendVersion !== plugin?.version && ( - + store.backendVersion !== plugin?.version && + !getItem(`version_mismatch_${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!
@@ -107,16 +113,6 @@ const DefaultPageLayout: FC = observer((props) => { .
)} - {currentTeam?.limits.show_limits_warning && - currentTeam?.limits.period_title !== 'Version mismatch' && // don't show version mismatch warning twice - !getItem(currentTeam.limits.warning_text) && ( - - )} {Boolean( currentTeam && currentUser &&