Skip to content

Commit

Permalink
Add a QGIS server warning for cloud customer
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Jan 18, 2024
1 parent dce5918 commit 2d406ee
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lizmap/definitions/lizmap_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@

CLOUD_ONLINE_URL = 'https://docs.lizmap.cloud'
CLOUD_ONLINE_LANGUAGES = ('en', 'fr')

CLOUD_QGIS_MIN_RECOMMENDED = 32800
39 changes: 37 additions & 2 deletions lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@
from lizmap.definitions.filter_by_login import FilterByLoginDefinitions
from lizmap.definitions.filter_by_polygon import FilterByPolygonDefinitions
from lizmap.definitions.layouts import LayoutsDefinitions
from lizmap.definitions.lizmap_cloud import CLOUD_MAX_PARENT_FOLDER, CLOUD_NAME
from lizmap.definitions.lizmap_cloud import (
CLOUD_MAX_PARENT_FOLDER,
CLOUD_NAME,
CLOUD_QGIS_MIN_RECOMMENDED,
)
from lizmap.definitions.locate_by_layer import LocateByLayerDefinitions
from lizmap.definitions.online_help import (
MAPPING_INDEX_DOC,
Expand Down Expand Up @@ -3232,7 +3236,7 @@ def project_config_file(

if is_lizmap_cloud(server_metadata):
if self.dlg.current_server_info(ServerComboData.LwcBranchStatus.value) == ReleaseStatus.Retired:
QMessageBox.information(
QMessageBox.warning(
self.dlg,
CLOUD_NAME,
tr(
Expand All @@ -3259,6 +3263,37 @@ def project_config_file(
QMessageBox.Ok
)

qgis_server_info = server_metadata.get('qgis_server_info')
md = qgis_server_info.get('metadata')
if md.get('version_int') < CLOUD_QGIS_MIN_RECOMMENDED:
QMessageBox.warning(
self.dlg,
CLOUD_NAME,
tr(
'You current server <a href="{server_url}">{server_url}</a> is running '
'QGIS Server {version}.'
).format(
server_url=self.dlg.current_server_info(ServerComboData.ServerUrl.value),
version=md.get('version'),
)
+ "<br><br>"
+ tr(
'This version of QGIS Server has now reached its end of life and is not supported '
'anymore by QGIS.org since February 2023, see the '
'<a href="https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule">'
'QGIS roadmap'
'</a>.'
)
+ "<br><br>"
+ tr(
'Please visit your administration panel in your web browser, in the dashboard, and '
'ask for the update.'
)
+ "<br><br>"
+ tr('This is not blocking your current usage of the plugin, only to advise you.'),
QMessageBox.Ok
)

metadata = {
'qgis_desktop_version': qgis_version(),
'lizmap_plugin_version_str': current_version,
Expand Down

0 comments on commit 2d406ee

Please sign in to comment.