From e90ad4b9cd09b025fd92fddd05ac552525345c3b Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 12 Jun 2024 09:16:15 +0200 Subject: [PATCH] wip: sort themes in GeoDataMine importer --- umap/static/umap/js/modules/importers/geodatamine.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/umap/static/umap/js/modules/importers/geodatamine.js b/umap/static/umap/js/modules/importers/geodatamine.js index acbed11f..fc03ef11 100644 --- a/umap/static/umap/js/modules/importers/geodatamine.js +++ b/umap/static/umap/js/modules/importers/geodatamine.js @@ -1,6 +1,7 @@ import { DomUtil, DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js' import { BaseAjax, SingleMixin } from '../autocomplete.js' import { translate } from '../i18n.js' +import * as Utils from '../utils.js' const BOUNDARY_TYPES = { admin_6: 'département', @@ -52,6 +53,7 @@ export class Importer { const select = container.querySelector('select') if (response && response.ok) { const { themes } = await response.json() + themes.sort((a, b) => Utils.naturalSort(a['name:fr'], b ['name:fr'])) for (const theme of themes) { DomUtil.element({ tagName: 'option',