diff --git a/umap/static/umap/js/modules/importer.js b/umap/static/umap/js/modules/importer.js index b3199ebf..ef450da6 100644 --- a/umap/static/umap/js/modules/importer.js +++ b/umap/static/umap/js/modules/importer.js @@ -235,7 +235,7 @@ export default class Importer { this.map.importFromUrl(this.url, this.format) } } catch (e) { - this.map.alert.open({ content: translate('Invalid umap data'), level: 'error' }) + Alert.error(translate('Invalid umap data')) console.error(e) } } diff --git a/umap/static/umap/js/modules/importers/geodatamine.js b/umap/static/umap/js/modules/importers/geodatamine.js index fc03ef11..5c73be00 100644 --- a/umap/static/umap/js/modules/importers/geodatamine.js +++ b/umap/static/umap/js/modules/importers/geodatamine.js @@ -2,6 +2,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' +import { uMapAlert as Alert } from '../../components/alerts/alert.js' const BOUNDARY_TYPES = { admin_6: 'département', @@ -76,9 +77,7 @@ export class Importer { }) const confirm = () => { if (!boundary || !select.value) { - this.map.alert.open({ - content: translate('Please choose a theme and a boundary first.'), - }) + Alert.error(translate('Please choose a theme and a boundary first.')) return } importer.url = `${this.baseUrl}/data/${select.value}/${boundary}?format=geojson&aspoint=${asPoint.checked}` diff --git a/umap/static/umap/js/modules/importers/overpass.js b/umap/static/umap/js/modules/importers/overpass.js index 94e4615c..8d7d5ac8 100644 --- a/umap/static/umap/js/modules/importers/overpass.js +++ b/umap/static/umap/js/modules/importers/overpass.js @@ -1,6 +1,7 @@ import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js' import { BaseAjax, SingleMixin } from '../autocomplete.js' import { translate } from '../i18n.js' +import { uMapAlert as Alert } from '../../components/alerts/alert.js' const TEMPLATE = `

Overpass

@@ -60,9 +61,7 @@ export class Importer { const confirm = () => { let tags = container.querySelector('[name=tags]').value if (!tags) { - this.map.alert.open({ - content: translate('Please define an expression for the query first'), - }) + Alert.error(translate('Please define an expression for the query first')) return } const outMode = container.querySelector('[name=out-mode]').value