From d630f8dadc4fcbbffde5baa62fcf86ee7abcd15a Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 3 Oct 2024 16:37:22 +0200 Subject: [PATCH] wip: rename labelSize to labelImportance --- umap/static/umap/js/modules/data/features.js | 2 +- umap/static/umap/js/modules/data/layer.js | 2 +- umap/static/umap/js/modules/rendering/ui.js | 4 ++-- umap/static/umap/js/modules/schema.js | 24 ++++++++++---------- umap/static/umap/js/umap.js | 2 +- umap/static/umap/map.css | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/umap/static/umap/js/modules/data/features.js b/umap/static/umap/js/modules/data/features.js index f9026398..ea16ffb9 100644 --- a/umap/static/umap/js/modules/data/features.js +++ b/umap/static/umap/js/modules/data/features.js @@ -312,7 +312,7 @@ class Feature { 'properties._umap_options.showLabel', 'properties._umap_options.labelDirection', 'properties._umap_options.labelInteractive', - 'properties._umap_options.labelSize', + 'properties._umap_options.labelImportance', 'properties._umap_options.outlink', 'properties._umap_options.outlinkTarget', ] diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index 21b016d2..92923a64 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -697,7 +697,7 @@ export class DataLayer { 'options.showLabel', 'options.labelDirection', 'options.labelInteractive', - 'options.labelSize', + 'options.labelImportance', 'options.outlinkTarget', 'options.interactive', ] diff --git a/umap/static/umap/js/modules/rendering/ui.js b/umap/static/umap/js/modules/rendering/ui.js index 306f1577..f48e35c8 100644 --- a/umap/static/umap/js/modules/rendering/ui.js +++ b/umap/static/umap/js/modules/rendering/ui.js @@ -69,12 +69,12 @@ const FeatureMixin = { const displayName = this.feature.getDisplayName(null) let showLabel = this.feature.getOption('showLabel') const oldLabelHover = this.feature.getOption('labelHover') - const size = this.feature.getOption('labelSize') + const importance = this.feature.getOption('labelImportance') const options = { direction: this.feature.getOption('labelDirection'), interactive: this.feature.getOption('labelInteractive'), - className: `leaflet-tooltip-${size}`, + className: `leaflet-tooltip-${importance}`, } if (oldLabelHover && showLabel) showLabel = null // Retrocompat. diff --git a/umap/static/umap/js/modules/schema.js b/umap/static/umap/js/modules/schema.js index 9cd3b325..cd746515 100644 --- a/umap/static/umap/js/modules/schema.js +++ b/umap/static/umap/js/modules/schema.js @@ -250,6 +250,18 @@ export const SCHEMA = { ], default: 'auto', }, + labelImportance: { + type: String, + impacts: ['data'], + label: translate('Label importance'), + inheritable: true, + choices: [ + ['low', translate('Default')], + ['medium', translate('Medium')], + ['high', translate('High')], + ], + default: 'low', + }, labelInteractive: { type: Boolean, impacts: ['data'], @@ -264,18 +276,6 @@ export const SCHEMA = { label: translate('Label key'), inheritable: true, }, - labelSize: { - type: String, - impacts: ['data'], - label: translate('Label font size'), - inheritable: true, - choices: [ - ['default', translate('Default')], - ['medium', translate('Medium')], - ['big', translate('Big')], - ], - default: 'default', - }, licence: { type: String, impacts: ['ui'], diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 83105656..753a5ad9 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1260,7 +1260,7 @@ U.Map = L.Map.extend({ 'options.showLabel', 'options.labelDirection', 'options.labelInteractive', - 'options.labelSize', + 'options.labelImportance', 'options.outlinkTarget', ] builder = new U.FormBuilder(this, popupFields) diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index 0977a16b..46f98731 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -1188,7 +1188,7 @@ span.popup-icon { .leaflet-tooltip-medium { font-weight: bold; } -.leaflet-tooltip-big { +.leaflet-tooltip-high { font-weight: bold; font-size: 1.2rem; }