Compare commits

...

7 commits

Author SHA1 Message Date
Yohan Boniface
8f7e5c7252 chore: add missing import in cadastrefr
Some checks failed
Test & Docs / docs (push) Has been cancelled
Test & Docs / tests (postgresql, 3.10) (push) Has been cancelled
Test & Docs / tests (postgresql, 3.12) (push) Has been cancelled
Test & Docs / lint (push) Has been cancelled
2024-12-03 18:07:26 +01:00
Yohan Boniface
c9d532508d
chore: change cadastrefr buttons (#2333)
We remove the cancel button and change the accept label.
2024-12-03 17:56:57 +01:00
Yohan Boniface
6221b709f4
fix: importer.map is undefined in geodatamine importer (#2332)
Broken since the map split I guess.
2024-12-03 17:54:20 +01:00
Yohan Boniface
2b2580fa22
feat: swap import and settings buttons in edit toolbar (#2329)
fix #2297


![image](https://github.com/user-attachments/assets/2c7a98db-03dd-4cc2-afd3-1b5da3ae6964)
2024-12-03 17:53:51 +01:00
Yohan Boniface
26ff82e838 chore: change cadastrefr buttons
We remove the cancel button and change the accept label.
2024-12-03 16:24:30 +01:00
Yohan Boniface
8fa26a02a2 fix: importer.map is undefined
Broken this the map split I guess.
2024-12-03 16:21:37 +01:00
Yohan Boniface
9a900319af feat: swap import and settings buttons in edit toolbar
fix #2297
2024-12-03 15:20:22 +01:00
3 changed files with 9 additions and 5 deletions

View file

@ -2,6 +2,8 @@ import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js'
import { BaseAjax, SingleMixin } from '../autocomplete.js' import { BaseAjax, SingleMixin } from '../autocomplete.js'
import * as Util from '../utils.js' import * as Util from '../utils.js'
import { AutocompleteCommunes } from './communesfr.js' import { AutocompleteCommunes } from './communesfr.js'
import { translate } from '../i18n.js'
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
const TEMPLATE = ` const TEMPLATE = `
<h3>Cadastre</h3> <h3>Cadastre</h3>
@ -56,6 +58,8 @@ export class Importer {
.open({ .open({
template: container, template: container,
className: `${this.id} importer dark`, className: `${this.id} importer dark`,
cancel: false,
accept: translate('Choose this data'),
}) })
.then(confirm) .then(confirm)
} }

View file

@ -37,8 +37,8 @@ class Autocomplete extends SingleMixin(BaseAjax) {
} }
export class Importer { export class Importer {
constructor(map, options = {}) { constructor(umap, options = {}) {
this.map = map this.umap = umap
this.name = options.name || 'GeoDataMine' this.name = options.name || 'GeoDataMine'
this.baseUrl = options?.url || 'https://geodatamine.fr' this.baseUrl = options?.url || 'https://geodatamine.fr'
this.id = 'geodatamine' this.id = 'geodatamine'
@ -49,7 +49,7 @@ export class Importer {
let boundaryName = null let boundaryName = null
const container = DomUtil.create('div') const container = DomUtil.create('div')
container.innerHTML = TEMPLATE container.innerHTML = TEMPLATE
const response = await importer.map.request.get(`${this.baseUrl}/themes`) const response = await this.umap.request.get(`${this.baseUrl}/themes`)
const select = container.querySelector('select') const select = container.querySelector('select')
if (response?.ok) { if (response?.ok) {
const { themes } = await response.json() const { themes } = await response.json()

View file

@ -44,12 +44,12 @@ const ControlsMixin = {
new U.DrawToolbar({ map: this }).addTo(this) new U.DrawToolbar({ map: this }).addTo(this)
const editActions = [ const editActions = [
U.EditCaptionAction, U.EditCaptionAction,
U.EditPropertiesAction, U.ImportAction,
U.EditLayersAction, U.EditLayersAction,
U.ChangeTileLayerAction, U.ChangeTileLayerAction,
U.UpdateExtentAction, U.UpdateExtentAction,
U.UpdatePermsAction, U.UpdatePermsAction,
U.ImportAction, U.EditPropertiesAction,
] ]
if (this.options.editMode === 'advanced') { if (this.options.editMode === 'advanced') {
new U.SettingsToolbar({ actions: editActions }).addTo(this) new U.SettingsToolbar({ actions: editActions }).addTo(this)