From 6a565e930bbe263ab342436082f185a953abba98 Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Mon, 6 Jan 2025 17:06:49 +0100 Subject: [PATCH] Use correct online help and Git repository according to the correct QGIS Server wrapper used --- lizmap/app/system/mainconfig.ini.php | 2 +- .../locales/en_US/admin.UTF-8.properties | 4 +- .../admin/templates/server_information.tpl | 42 +++++++++++-------- .../playwright/server-information.spec.js | 2 +- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/lizmap/app/system/mainconfig.ini.php b/lizmap/app/system/mainconfig.ini.php index cb6620feaf..e1761c0c1f 100644 --- a/lizmap/app/system/mainconfig.ini.php +++ b/lizmap/app/system/mainconfig.ini.php @@ -35,7 +35,7 @@ ; QGIS server required minimum version qgisServer="3.22" ; Lizmap server QGIS plugin required minimum version -lizmapServerPlugin="2.11.2" +lizmapServerPlugin="2.12.0" ; Lizmap QGIS desktop plugin required/recommended minimum version for newly or updated project only ; This version MUST match at least on https://plugins.qgis.org/plugins/lizmap/#plugin-versions ; with the minimum QGIS server version supported above. diff --git a/lizmap/modules/admin/locales/en_US/admin.UTF-8.properties b/lizmap/modules/admin/locales/en_US/admin.UTF-8.properties index 0b8cf696f7..51e08ed0f1 100644 --- a/lizmap/modules/admin/locales/en_US/admin.UTF-8.properties +++ b/lizmap/modules/admin/locales/en_US/admin.UTF-8.properties @@ -269,7 +269,6 @@ server.information.qgis.label=QGIS Server server.information.qgis.metadata=Version server.information.qgis.version=Number server.information.qgis.name=Name -server.information.qgis.commit_id=Commit ID server.information.qgis.action=Action server.information.qgis.plugins=Plugins @@ -277,6 +276,9 @@ server.information.qgis.plugins.version=Version number server.information.qgis.plugin=Plugin server.information.qgis.plugin.version=Version server.information.qgis.plugin.action=Action +server.information.qgis.plugin.help=Help +server.information.qgis.wrapper=QJazz or Py-QGIS-Server +server.information.qgis.wrapper.not.installed=Not installed server.information.qgis.test.ok=QGIS Server is correctly installed and returns the expected response for OGC requests. server.information.qgis.test.error=QGIS Server is not correctly installed in your server or the URL for OGC requests given in Lizmap configuration is not correct. diff --git a/lizmap/modules/admin/templates/server_information.tpl b/lizmap/modules/admin/templates/server_information.tpl index 1eec41fd02..dca7035427 100644 --- a/lizmap/modules/admin/templates/server_information.tpl +++ b/lizmap/modules/admin/templates/server_information.tpl @@ -92,6 +92,8 @@ {$data['qgis_server_info']['metadata']['version']} + - + {$data['qgis_server_info']['metadata']['commit_id']} @@ -100,32 +102,38 @@ {$data['qgis_server_info']['metadata']['name']} - {@admin.server.information.qgis.commit_id@} - {$data['qgis_server_info']['metadata']['commit_id']} - - - Py-QGIS-Server - - {if $data['qgis_server_info']['py_qgis_server']['found']} + {if $data['qgis_server_info']['py_qgis_server']['found']} + + {$data['qgis_server_info']['py_qgis_server']['name']} + {if $data['qgis_server_info']['py_qgis_server']['documentation_url']} + + {@admin.server.information.qgis.plugin.help@} + + {/if} + + {if $data['qgis_server_info']['py_qgis_server']['stable']} {if $data['qgis_server_info']['py_qgis_server']['version'] == 'n/a'} {* If the value is n/a, Py-QGIS-Server failed to fetch the version *} {* https://github.com/3liz/py-qgis-server/blob/b11bba45495d32e348457c0802fe08f2bf952b8b/pyqgisserver/version.py#L17 *} {$data['qgis_server_info']['py_qgis_server']['version']} {else} - - {$data['qgis_server_info']['py_qgis_server']['version']} - + {if $data['qgis_server_info']['py_qgis_server']['git_repository_url']} + + {$data['qgis_server_info']['py_qgis_server']['version']} + + {/if} {/if} {else} - - {$data['qgis_server_info']['py_qgis_server']['version']} - {$data['qgis_server_info']['py_qgis_server']['commit_id']} - + + {$data['qgis_server_info']['py_qgis_server']['version']} - {$data['qgis_server_info']['py_qgis_server']['commit_id']} + {/if} - {else} - {$data['qgis_server_info']['py_qgis_server']['version']} - {/if} - + + {else} + {* When Py-QGIS-Server and QJazz were not found *} + {@admin.server.information.qgis.wrapper@}{@admin.server.information.qgis.wrapper.not.installed@} + {/if} {if $qgisServerNeedsUpdate } diff --git a/tests/end2end/playwright/server-information.spec.js b/tests/end2end/playwright/server-information.spec.js index cfc5580405..dbac74756f 100644 --- a/tests/end2end/playwright/server-information.spec.js +++ b/tests/end2end/playwright/server-information.spec.js @@ -26,7 +26,7 @@ test.describe('Server information', () => { } // Check that QGIS Server table contains 4 lines const qgisServerRows = page.locator('#lizmap_server_information table.table-qgis-server tr') - await expect(qgisServerRows).toHaveCount(4); + await expect(qgisServerRows).toHaveCount(3); for (const row of await qgisServerRows.all()) { await expect(row.locator('th')).toHaveCount(1); await expect(await row.locator('th').innerText()).not.toEqual('');