diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseElement.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseElement.vue index a7f3ede070..128ad782a1 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseElement.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseElement.vue @@ -44,13 +44,19 @@ export default { acc[key] = this.resource; } if (prop.hasOwnProperty("resourceProperty")) { + let propertyValue; if (prop.resourceProperty.includes(".")) { - acc[key] = this.accessNestedProperty( + propertyValue = this.accessNestedProperty( prop.resourceProperty, this.resource ); } else { - acc[key] = this.resource[prop.resourceProperty]; + propertyValue = this.resource[prop.resourceProperty]; + } + if (Object.keys(prop).length === 1) { + acc[key] = propertyValue; + } else { + prop.value = propertyValue; } } if (key === "relationshipStrings") { @@ -72,8 +78,19 @@ export default { } if (key === "disabled") { - const currentValue = acc[key]; - acc[key] = !!currentValue; + if ( + typeof prop === "object" && + prop.hasOwnProperty("qualifier") + ) { + let currentValue = prop.value; + if (prop.qualifier === "!") { + currentValue = !currentValue; + } + acc[key] = !!currentValue; + } else { + const currentValue = acc[key]; + acc[key] = !!currentValue; + } } if (prop.type === "filter") { diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue index 14abd281de..3e509c8c55 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue @@ -796,6 +796,7 @@ export default { componentProps: { disabled: { resourceProperty: "by_expired", + qualifier: "!", }, }, value: "",