Bug 38201: Fix for inverse boolean checks
We currently check for if a boolean is true but have no way of checking for a falsy value, this patch adds a fix for that Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
89cb2adf0c
commit
a3b77a7c0d
|
|
@ -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") {
|
||||
|
|
|
|||
|
|
@ -796,6 +796,7 @@ export default {
|
|||
componentProps: {
|
||||
disabled: {
|
||||
resourceProperty: "by_expired",
|
||||
qualifier: "!",
|
||||
},
|
||||
},
|
||||
value: "",
|
||||
|
|
|
|||
Loading…
Reference in New Issue