mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
chore: use map getter instead of getMap in permissions
This commit is contained in:
parent
0d7c6e451d
commit
a35b37f423
1 changed files with 5 additions and 9 deletions
|
@ -42,10 +42,6 @@ export class MapPermissions {
|
||||||
return !this.map.options.permissions.owner
|
return !this.map.options.permissions.owner
|
||||||
}
|
}
|
||||||
|
|
||||||
getMap() {
|
|
||||||
return this.map
|
|
||||||
}
|
|
||||||
|
|
||||||
_editAnonymous(container) {
|
_editAnonymous(container) {
|
||||||
const fields = []
|
const fields = []
|
||||||
if (this.isOwner()) {
|
if (this.isOwner()) {
|
||||||
|
@ -257,7 +253,7 @@ export class DataLayerPermissions {
|
||||||
return this._isDirty
|
return this._isDirty
|
||||||
}
|
}
|
||||||
|
|
||||||
getMap() {
|
get map() {
|
||||||
return this.datalayer.map
|
return this.datalayer.map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +266,7 @@ export class DataLayerPermissions {
|
||||||
label: translate('Who can edit "{layer}"', {
|
label: translate('Who can edit "{layer}"', {
|
||||||
layer: this.datalayer.getName(),
|
layer: this.datalayer.getName(),
|
||||||
}),
|
}),
|
||||||
selectOptions: this.datalayer.map.options.datalayer_edit_statuses,
|
selectOptions: this.map.options.datalayer_edit_statuses,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
@ -282,8 +278,8 @@ export class DataLayerPermissions {
|
||||||
}
|
}
|
||||||
|
|
||||||
getUrl() {
|
getUrl() {
|
||||||
return Utils.template(this.datalayer.map.options.urls.datalayer_permissions, {
|
return this.map.urls.get('datalayer_permissions', {
|
||||||
map_id: this.datalayer.map.options.umap_id,
|
map_id: this.map.options.umap_id,
|
||||||
pk: this.datalayer.umap_id,
|
pk: this.datalayer.umap_id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -292,7 +288,7 @@ export class DataLayerPermissions {
|
||||||
if (!this.isDirty) return
|
if (!this.isDirty) return
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('edit_status', this.options.edit_status)
|
formData.append('edit_status', this.options.edit_status)
|
||||||
const [data, response, error] = await this.datalayer.map.server.post(
|
const [data, response, error] = await this.map.server.post(
|
||||||
this.getUrl(),
|
this.getUrl(),
|
||||||
{},
|
{},
|
||||||
formData
|
formData
|
||||||
|
|
Loading…
Reference in a new issue