Skip to content
Snippets Groups Projects
Commit 2282c924 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Merge branch 'edition-form-rights' into 'master'

Ensure element rights are available in edition form

Closes #821

See merge request !1079
parents 539475c4 594a6d31
No related branches found
No related tags found
1 merge request!1079Ensure element rights are available in edition form
......@@ -231,6 +231,22 @@ export default {
this.deleteLoading = false
}
}
},
watch: {
element: {
immediate: true,
handler (element) {
if (!element.id) return
/*
* Do not retrieve the element again if it already exists in the store,
* unless it lacks some of the attributes only available from RetrieveElement.
* Some elements in the store can come from list endpoints such as those of the children tree.
* This ensures there are no strange behaviors where some actions are only sometimes disabled when they shouldn't,
* or some element attributes are not displayed at all.
*/
if (!element.rights) this.$store.dispatch('elements/get', { id: element.id })
}
}
}
}
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment