App Schema Auto Fix Feature

This commit is contained in:
Luis Fernando Molina committed 2021-10-11 20:07:37 +02:00
1 parent 9bbabb14ca
commit 23f13fa0c3
6 files changed
+212 -41

No files matched your search

@@ -1,4 +1,4 @@
function newFoundationsActionSwitch() {
function newVisualScriptingActionSwitch() {
let thisObject = {
executeAction: executeAction,
@@ -186,7 +186,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
for (let i = 0; i < node.rootNodes.length; i++) {
let rootNode = node.rootNodes[i]
if (rootNode.id === receivedNode.id) {
console.log('[WARN] The node with name "' + rootNode.name + '" and type "' + rootNode.type + '" will be replaced by the node with name "' + receivedNode.name + '" and type "' + receivedNode.type +'" because they both have the same node.id')
console.log('[WARN] The node with name "' + rootNode.name + '" and type "' + rootNode.type + '" will be replaced by the node with name "' + receivedNode.name + '" and type "' + receivedNode.type + '" because they both have the same node.id')
node.rootNodes.splice(i, 1)
break
}
@@ -601,8 +601,11 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
let schemaDocument = getSchemaDocument(object, project)
if (schemaDocument === undefined) {
console.log('Cannot addUIOBject of type "' + type + '" and project "' + project + '" because that type it is not defined at the APP_SCHEMA.')
return
schemaDocument = getSchemaDocument(object, 'Foundations') // TODO: This is provisional until all actions can have the relatedUiObject project explicitly set.
if (schemaDocument === undefined) {
console.log('Cannot addUIOBject of type "' + type + '" and project "' + project + '" because that type it is not defined at the APP_SCHEMA.')
return
}
}
if (schemaDocument.initialValues !== undefined) {
@@ -767,7 +770,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
if (property.type === 'node') {
if (property.name !== previousPropertyName) {
if (node[property.name] === undefined) {
let currenAngleToParent = node.payload.floatingObject.angleToParent
let currenAngleToParent = node.payload.floatingObject.angleToParent
node.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
let uiObject = addUIObject(node, property.childType, rootNodes, property.project)
node.payload.floatingObject.angleToParent = currenAngleToParent