From fbd1bc452fdfeba74ae1c57a13161e5291499f1b Mon Sep 17 00:00:00 2001 From: kdeterme Date: Fri, 9 Oct 2026 19:52:11 +0200 Subject: [PATCH] fix(mobile): resolve nature tree marker symbology and attribute serialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Serialize management_type, managing_authority, is_remarkable, is_dead, vitality, and botanical names in mobile_assets_search - Allow regional (Bruxelles Mobilité), remarkable, and dead trees to display differentiated icons and colors on mobile map - Fallback tree display name to vernacular/scientific name - Update asset_symbology.js cachebuster version in mobile template - Add unit test coverage for nature tree search serialization --- loko/assets/static/assets/asset_symbology.js | 5 +- .../mobile/assets/assets_index_mobile.html | 7 ++- loko/mobile/tests_asset_mobile.py | 62 +++++++++++++++++++ loko/mobile/views.py | 37 +++++++++++ 4 files changed, 108 insertions(+), 3 deletions(-) diff --git a/loko/assets/static/assets/asset_symbology.js b/loko/assets/static/assets/asset_symbology.js index 0ab91b9..7969cf2 100644 --- a/loko/assets/static/assets/asset_symbology.js +++ b/loko/assets/static/assets/asset_symbology.js @@ -291,7 +291,7 @@ naturetree: { thematic: 'nature', color: '#2e7d32', - iconUrl: '/static/assets/nature_tree_icon.svg?v=20260521a', + iconUrl: '/static/assets/nature_tree_icon.svg?v=20261009_round', iconSize: 56, iconClass: 'bi-tree-fill', glyphCodepoint: 'f5e1', @@ -613,7 +613,8 @@ } const isRemarkable = item.is_remarkable === true || item.is_remarkable === 'true' || item.is_remarkable === 1; const isRegional = item.management_type === 'regional' || - (typeof item.managing_authority === 'string' && (item.managing_authority.toLowerCase().includes('région') || item.managing_authority.toLowerCase().includes('mobilité'))); + (typeof item.managing_authority === 'string' && (item.managing_authority.toLowerCase().includes('région') || item.managing_authority.toLowerCase().includes('mobilité'))) || + (typeof item.code === 'string' && item.code.toUpperCase().startsWith('BM-ARB')); if (isRemarkable && ASSET_TYPE_OVERRIDES.naturetree_remarkable) { return Object.assign({}, ASSET_TYPE_OVERRIDES.naturetree_remarkable); } diff --git a/loko/mobile/templates/mobile/assets/assets_index_mobile.html b/loko/mobile/templates/mobile/assets/assets_index_mobile.html index 97c2959..1a16343 100644 --- a/loko/mobile/templates/mobile/assets/assets_index_mobile.html +++ b/loko/mobile/templates/mobile/assets/assets_index_mobile.html @@ -1135,7 +1135,7 @@ {% endblock content %} {% block extra_scripts %} - +