From b440a0bd9a3b4da59e5d6d75a2d58cc045ce423e Mon Sep 17 00:00:00 2001 From: mazzitsolution Date: Sat, 17 Dec 2022 19:09:47 +0000 Subject: [PATCH 1/2] bugfix/tharaka_authenticate_form_input_value_process2 bugfix/tharaka_authenticate_form_input_value_process2 --- .../src/CodeGen/app-builder/utils.ts | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/backend-builder/src/CodeGen/app-builder/utils.ts b/backend-builder/src/CodeGen/app-builder/utils.ts index 8463ae4..8f24f38 100644 --- a/backend-builder/src/CodeGen/app-builder/utils.ts +++ b/backend-builder/src/CodeGen/app-builder/utils.ts @@ -119,7 +119,19 @@ export const draftJsStuff = ( let currentComponent: StructuredComponent | null = null bits.forEach(bit => { if (!currentComponent) { - const comp = rootComponents.find(p => p._id.toString() === bit) + var comp: any; + rootComponents.forEach(element => { + element.children.forEach(grandChildElement => { + if (grandChildElement._id.toString() === bit) { + comp = grandChildElement; + } + grandChildElement.children.forEach(xx => { + if (xx._id.toString() === bit) { + comp = xx; + } + }) + }) + }); if (comp) { currentComponent = comp } @@ -135,9 +147,8 @@ export const draftJsStuff = ( } }) if (currentComponent !== null) { - replacementText = `\${${ - (currentComponent as Component).name - }${dataPath ? dataPath : ''}}` + //replacementText = `\${${(currentComponent as Component).name}${dataPath ? dataPath : ''}}` + replacementText = (currentComponent as Component).name + (dataPath ? dataPath : '') } break case 'LOCAL_DATA': @@ -627,19 +638,19 @@ export function functionBuilder( value: 'login', }) propsBuilder.push( - `const success = await login({ variables: { username: \`${draftJsStuff( + `const success = await login({ variables: { username: ${draftJsStuff( action.username, rootComponents, projectInfo, packages, assetFolder - )}\`, password: \`${draftJsStuff( + )}, password: ${draftJsStuff( action.password, rootComponents, projectInfo, packages, assetFolder - )}\`}});` + )}}});` ) if (action.onSucess) { propsBuilder.push(`if (success.data) {`) From c80dfc721cac8546bc18dbec6cd920814dd84de0 Mon Sep 17 00:00:00 2001 From: mazzitsolution Date: Sat, 17 Dec 2022 19:13:40 +0000 Subject: [PATCH 2/2] Update Component.entity.ts --- .../src/Projects/AppConfig/Components/Component.entity.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend-builder/src/Projects/AppConfig/Components/Component.entity.ts b/backend-builder/src/Projects/AppConfig/Components/Component.entity.ts index 9c14307..51b36a5 100644 --- a/backend-builder/src/Projects/AppConfig/Components/Component.entity.ts +++ b/backend-builder/src/Projects/AppConfig/Components/Component.entity.ts @@ -119,4 +119,8 @@ export class Component { @Field() @Property() layerSort!: string; + + @Field() + @Property() + children!: Component[]; }