Merge pull request #11079 from Budibase/fix/component-validation

Clear validation processing when crossing into a side panel component
This commit is contained in:
deanhannigan 2023-06-30 11:24:01 +01:00 committed by GitHub
commit ac21f8f915
2 changed files with 8 additions and 1 deletions

View File

@ -235,6 +235,7 @@ export const getFrontendStore = () => {
legalDirectChildren = [] legalDirectChildren = []
) => { ) => {
const type = component._component const type = component._component
if (illegalChildren.includes(type)) { if (illegalChildren.includes(type)) {
return type return type
} }
@ -248,10 +249,13 @@ export const getFrontendStore = () => {
return return
} }
if (type === "@budibase/standard-components/sidepanel") {
illegalChildren = []
}
const definition = store.actions.components.getDefinition( const definition = store.actions.components.getDefinition(
component._component component._component
) )
// Reset whitelist for direct children // Reset whitelist for direct children
legalDirectChildren = [] legalDirectChildren = []
if (definition?.legalDirectChildren?.length) { if (definition?.legalDirectChildren?.length) {

View File

@ -52,6 +52,9 @@
// Build up list of illegal children from ancestors // Build up list of illegal children from ancestors
let illegalChildren = definition.illegalChildren || [] let illegalChildren = definition.illegalChildren || []
path.forEach(ancestor => { path.forEach(ancestor => {
if (ancestor._component === `@budibase/standard-components/sidepanel`) {
illegalChildren = []
}
const def = store.actions.components.getDefinition(ancestor._component) const def = store.actions.components.getDefinition(ancestor._component)
const blacklist = def?.illegalChildren?.map(x => { const blacklist = def?.illegalChildren?.map(x => {
return `@budibase/standard-components/${x}` return `@budibase/standard-components/${x}`