wip
This commit is contained in:
parent
feef3450b7
commit
7890b4e6cb
|
@ -158,6 +158,8 @@
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 1px solid var(--grey-4);
|
border: 1px solid var(--grey-4);
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
transition: width 300ms ease-in, height 300ms ease-in, top 300ms ease-in, left 300ms ease-in;
|
transition: width 300ms ease-in, height 300ms ease-in, top 300ms ease-in, left 300ms ease-in;
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,8 +96,6 @@
|
||||||
const onOptionMouseleave = (e, option) => {
|
const onOptionMouseleave = (e, option) => {
|
||||||
updateTooltip(e, null);
|
updateTooltip(e, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
$: console.log(schema)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Multiselect
|
<Multiselect
|
||||||
|
|
|
@ -273,9 +273,8 @@
|
||||||
staticSettings = instanceSettings.staticSettings
|
staticSettings = instanceSettings.staticSettings
|
||||||
dynamicSettings = instanceSettings.dynamicSettings
|
dynamicSettings = instanceSettings.dynamicSettings
|
||||||
|
|
||||||
console.log(settingsDefinition, settingsDefinitionMap);
|
|
||||||
// Check if we have any missing required settings
|
// Check if we have any missing required settings
|
||||||
missingRequiredSettings = Object.values(settingsDefinitionMap).filter(setting => {
|
missingRequiredSettings = settingsDefinition.filter(setting => {
|
||||||
let empty = instance[setting.key] == null || instance[setting.key] === ""
|
let empty = instance[setting.key] == null || instance[setting.key] === ""
|
||||||
let missing = setting.required && empty
|
let missing = setting.required && empty
|
||||||
|
|
||||||
|
@ -284,22 +283,32 @@
|
||||||
const dependsOnKey = setting.dependsOn.setting || setting.dependsOn
|
const dependsOnKey = setting.dependsOn.setting || setting.dependsOn
|
||||||
const dependsOnValue = setting.dependsOn.value
|
const dependsOnValue = setting.dependsOn.value
|
||||||
const realDependentValue = instance[dependsOnKey]
|
const realDependentValue = instance[dependsOnKey]
|
||||||
let foo = false && instance._component === "@budibase/standard-components/chartblock" && setting.type === "multifield"
|
|
||||||
|
const sectionDependsOnKey = setting.sectionDependsOn?.setting || setting.sectionDependsOn
|
||||||
|
const sectionDependsOnValue = setting.sectionDependsOn?.value
|
||||||
|
const sectionRealDependentValue = instance[sectionDependsOnKey]
|
||||||
|
|
||||||
|
|
||||||
|
let foo = instance._component === "@budibase/standard-components/chartblock" && setting.type === "multifield"
|
||||||
|
if (dependsOnValue == null && realDependentValue == null) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (dependsOnValue != null && dependsOnValue !== realDependentValue) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sectionDependsOnValue == null && sectionRealDependentValue == null) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (sectionDependsOnValue != null && sectionDependsOnValue !== sectionRealDependentValue) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
if (foo) {
|
if (foo) {
|
||||||
console.log(setting)
|
console.log(setting)
|
||||||
console.log(instance);
|
console.log(instance);
|
||||||
}
|
console.log(dependsOnValue);
|
||||||
if (dependsOnValue === undefined && realDependentValue) {
|
console.log(realDependentValue);
|
||||||
if (foo) console.log("in 0");
|
console.log("")
|
||||||
return missing
|
|
||||||
}
|
|
||||||
if (dependsOnValue == null && realDependentValue == null) {
|
|
||||||
if (foo) console.log("in 1");
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (dependsOnValue !== realDependentValue) {
|
|
||||||
if (foo) console.log("in 2");
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,14 +101,14 @@ export const propsUseBinding = (props, bindingKey) => {
|
||||||
/**
|
/**
|
||||||
* Gets the definition of this component's settings from the manifest
|
* Gets the definition of this component's settings from the manifest
|
||||||
*/
|
*/
|
||||||
export const getSettingsDefinition = definition => {
|
export const getSettingsDefinition = (definition) => {
|
||||||
if (!definition) {
|
if (!definition) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
let settings = []
|
let settings = []
|
||||||
definition.settings?.forEach(setting => {
|
definition.settings?.forEach(setting => {
|
||||||
if (setting.section) {
|
if (setting.section) {
|
||||||
settings = settings.concat(setting.settings || [])
|
settings = settings.concat((setting.settings || [])?.map(childSetting => ({ ...childSetting, sectionDependsOn: setting.dependsOn })))
|
||||||
} else {
|
} else {
|
||||||
settings.push(setting)
|
settings.push(setting)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue