Fix issue where required settings that depend on other settings were still blocking rendering
This commit is contained in:
parent
8fbcf86d40
commit
11c5ed1f6a
|
@ -207,10 +207,23 @@
|
||||||
|
|
||||||
// Check if we have any missing required settings
|
// Check if we have any missing required settings
|
||||||
missingRequiredSettings = settingsDefinition.filter(setting => {
|
missingRequiredSettings = settingsDefinition.filter(setting => {
|
||||||
return (
|
let empty = instance[setting.key] == null || instance[setting.key] === ""
|
||||||
setting.required &&
|
let missing = setting.required && empty
|
||||||
(instance[setting.key] == null || instance[setting.key] === "")
|
|
||||||
)
|
// Check if this setting depends on another, as it may not be required
|
||||||
|
if (setting.dependsOn) {
|
||||||
|
const dependsOnKey = setting.dependsOn.setting || setting.dependsOn
|
||||||
|
const dependsOnValue = setting.dependsOn.value
|
||||||
|
const realDependentValue = instance[dependsOnKey]
|
||||||
|
if (dependsOnValue == null && realDependentValue == null) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (dependsOnValue !== realDependentValue) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return missing
|
||||||
})
|
})
|
||||||
|
|
||||||
// Force an initial enrichment of the new settings
|
// Force an initial enrichment of the new settings
|
||||||
|
|
Loading…
Reference in New Issue