Skip to content

Commit

Permalink
Merge pull request #618 from Gustry/trailing-space
Browse files Browse the repository at this point in the history
Tip - Trailing spaces can be added
  • Loading branch information
Gustry authored Feb 13, 2025
2 parents 27e6c43 + 5743836 commit bb9fbfd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lizmap/definitions/lizmap_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

# TODO Fixme, the minimum version recommended varies on the LWC version
# When changed, check for occurrences about the date
# TODO change to 3.34 soon, translated text are ready
CLOUD_QGIS_MIN_RECOMMENDED = (3, 28, 0)
# It's used in tests in test_version_info_qgis_server_status
CLOUD_QGIS_MIN_RECOMMENDED = (3, 34, 0)

UPLOAD_EXTENSIONS = ('fgb', 'gpkg', 'xlsx', 'xls', 'csv', 'ods', 'kml', 'geojson')
UPLOAD_MAX_SIZE = 11000000 # 11 Mb
Expand Down
3 changes: 2 additions & 1 deletion lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3182,6 +3182,7 @@ def check_project(
if results:
self.dlg.log_panel.append(tr("Duplicated labels in the legend"), Html.H2)
self.dlg.log_panel.append("<br>")
self.dlg.log_panel.append("<em>" + tr("A leading or a trailing spaces can be added.") + "</em>")
self.dlg.log_panel.start_table()
self.dlg.log_panel.append(
"<tr><th>{}</th><th>{}</th><th>{}</th></tr>".format(tr('Layer'), tr('Label'), tr('Count'))
Expand Down Expand Up @@ -3684,7 +3685,7 @@ def project_config_file(
'QGIS roadmap'
'</a>.'
).format(
month_and_year=tr("February 2024"),
month_and_year=tr("February 2024"), # About QGIS 3.28
)
+ "<br><br>"
+ tr(
Expand Down
6 changes: 6 additions & 0 deletions lizmap/project_checker_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,12 @@ def _clean_result(results: dict) -> dict:
for layer_id, labels in results.items():
data[layer_id] = {}
for label, count in labels.items():
if label == "":
# In a rule based symbology, this can be an empty string
label = tr("(empty string)")
else:
# Add some quotes, to see if they are some leading trailing spaces
label = f'"{label}"'
if count >= 2:
data[layer_id][label] = count

Expand Down
2 changes: 1 addition & 1 deletion lizmap/server_lwc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ def _messages_for_version(
).format(
major=qgis_server[0],
minor=qgis_server[1],
month_and_year=tr("February 2024"),
month_and_year=tr("February 2024"), # About QGIS 3.28
))
level = Qgis.Critical

Expand Down
2 changes: 1 addition & 1 deletion lizmap/test/test_version_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_version_info_qgis_server_status(self):
# QGIS server version = QGIS desktop version
data = {
'lizmap_version': '3.5.11',
'server_version': "3.28.0",
'server_version': "3.34.0",
'login': 'simple_lambda',
'json_path': json_path,
'qgis_desktop': qgis_desktop,
Expand Down
4 changes: 2 additions & 2 deletions lizmap/widgets/check_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ class SourceType:

Field = SourceField
Layer = SourceLayer
Groupe = SourceGroup
Group = SourceGroup


class Error:
Expand Down Expand Up @@ -1188,7 +1188,7 @@ def add_error(self, error: Error, lizmap_cloud: bool = False, severity=None, ico
layer = QgsProject.instance().mapLayer(error.source_type.layer_id)
item.setIcon(QgsMapLayerModel.iconForLayer(layer))
item.setData(self.JSON, error.source_type.layer_id)
elif isinstance(error.source_type, SourceType.Groupe):
elif isinstance(error.source_type, SourceType.Group):
item.setToolTip(error.source_type.name)
item.setIcon(QIcon(":images/themes/default/mActionFolder.svg"))
item.setData(self.JSON, error.source_type.name)
Expand Down

0 comments on commit bb9fbfd

Please sign in to comment.