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

Merge branch 'ensure-element-classifications' into 'master'

Ensure RetrieveElement is called from the DetailsPanel for classifications

Closes #803

See merge request !1062
parents d8f87294 79acd3c5
No related branches found
Tags 1.3.2-rc1
1 merge request!1062Ensure RetrieveElement is called from the DetailsPanel for classifications
......@@ -286,11 +286,12 @@ export default {
if (!id) return
/*
* Do not retrieve the element again if it already exists in the store,
* unless it lacks the `rights` attribute: this attribute is only available from RetrieveElement,
* and 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.
* 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 (this.element?.id !== id || !this.element?.rights) this.$store.dispatch('elements/get', { id })
if (!this.element || this.element.id !== id || !this.element.rights || !this.element.classifications) this.$store.dispatch('elements/get', { id })
}
},
elementType: {
......
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