Clear validation processing when crossing into a side panel component

This commit is contained in:
Dean 2023-06-30 09:48:07 +01:00
parent fe669b7e54
commit cd43a1a2c2
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}`