Merging develop into portfolio-management

This commit is contained in:
Philip Love committed 2021-11-08 01:28:05 -05:00
commit 0070eb1f9b
334 files changed
+75812 -19603

No files matched your search

@@ -197,6 +197,11 @@ function newVisualScriptingActionSwitch() {
UI.projects.visualScripting.functionLibraries.attachDetach.referenceDetachNode(action.node)
}
break
case 'Create Reference':
{
UI.projects.visualScripting.functionLibraries.attachDetach.createReference(action.node, action.rootNodes)
}
break
default: {
console.log("[WARN] Action sent to Visual-Scripting Action Switch does not belong here. Verify at the App Schema file of the node that triggered this action that the actionProject is pointing to the right project. -> Action = " + action.name + " -> Action Node Name = " + action.node.name)
@@ -17,7 +17,7 @@ function newVisualScriptingFunctionLibraryOnFocus() {
/* Then we check all of its own children nodes. */
if (node.payload.floatingObject.isCollapsed !== true) {
if (schemaDocument.childrenNodesProperties !== undefined) {
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
let property = schemaDocument.childrenNodesProperties[i]
@@ -2,7 +2,8 @@
function newVisualScriptingFunctionLibraryReferenceAttachDetach() {
let thisObject = {
referenceDetachNode: referenceDetachNode,
referenceAttachNode: referenceAttachNode
referenceAttachNode: referenceAttachNode,
createReference: createReference
}
return thisObject
@@ -18,6 +19,35 @@ function newVisualScriptingFunctionLibraryReferenceAttachDetach() {
completeAttachment(node, attachToNode)
}
function createReference(node, rootNodes) {
let action = { node: node }
let allNodesFound = []
let schemaDocument = getSchemaDocument(node)
let workspaceRootNodes = UI.projects.foundations.spaces.designSpace.workspace.workspaceNode.rootNodes
let compatibleTypes = schemaDocument.referencingRules.compatibleTypes.split('->').filter(i => i)
for (let i = 0; i < compatibleTypes.length; i++) {
for (let j = 0; j < workspaceRootNodes.length; j++) {
let rootNode = workspaceRootNodes[j]
if (rootNode !== null) {
let nodeArray = UI.projects.visualScripting.utilities.branches.nodeBranchToArray(rootNode, compatibleTypes[i])
allNodesFound = allNodesFound.concat(nodeArray)
}
}
}
let eventSubscriptionId = node.payload.uiObject.container.eventHandler.listenToEvent('listSelectorClicked', onListSelect)
node.payload.uiObject.listSelector.activate(action, allNodesFound, eventSubscriptionId)
function onListSelect(event) {
referenceAttachNode(node, event.selectedNode)
node.payload.uiObject.container.eventHandler.stopListening('listSelectorClicked')
}
}
// Store the path to the reference parent to make restoring it possible if the reference parent is updated and given a new id
function storeAttachNodePath(node, attachToNode) {
if (node === undefined) { return }
@@ -16,7 +16,7 @@ function newVisualScriptingFunctionLibraryShortcutKeys() {
/* Check all of its own children nodes. */
if (node.payload.floatingObject.isCollapsed !== true) {
if (schemaDocument.childrenNodesProperties !== undefined) {
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
let property = schemaDocument.childrenNodesProperties[i]
@@ -69,7 +69,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
for (let j = 0; j < plugins.pluginProjects.length; j++) {
let project = plugins.pluginProjects[j]
/*
Miscelaneours Plugin Types
Miscellaneous Plugin Types
*/
if (project.pluginDataMines !== undefined) {
totalPlugin = totalPlugin + project.pluginDataMines.pluginFiles.length
@@ -195,8 +195,8 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
}
/*
If the workspace already contains a root node with the id of the head of the hirierchy
we are loading, we remove it because the plugin file has precedende.
If the workspace already contains a root node with the id of the head of the hierarchy
we are loading, we remove it because the plugin file has precedence.
*/
for (let i = 0; i < node.rootNodes.length; i++) {
let rootNode = node.rootNodes[i]
@@ -241,7 +241,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
}
function addUserDefinedNodes() {
/* Create the workspace UI OBject and then continue with the root nodes. */
/* Create the workspace UI OObject and then continue with the root nodes. */
createUiObject(false, 'Workspace', node.name, node, undefined, undefined, 'Workspace')
if (node.rootNodes !== undefined) {
UI.projects.foundations.utilities.statusBar.changeStatus("Setting up Rootnodes...")
@@ -426,7 +426,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
}
function migrateCodeToConfig(node, schemaDocument) {
/* Code needed to Migrante from Beta 5 to Beta a Workspace */
/* Code needed to Migrate from Beta 5 to Beta a Workspace */
if (schemaDocument.editors !== undefined) {
if (schemaDocument.editors.config === true) {
if (node.code !== undefined) {
@@ -591,7 +591,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
/* Create Children */
if (schemaDocument.childrenNodesProperties !== undefined) {
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
let property = schemaDocument.childrenNodesProperties[i]
if (node[property.name] !== undefined) {
@@ -727,7 +727,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
function connectToParent() {
/* Connect to Parent */
if (parentSchemaDocument.childrenNodesProperties !== undefined) {
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
for (let i = 0; i < parentSchemaDocument.childrenNodesProperties.length; i++) {
let property = parentSchemaDocument.childrenNodesProperties[i]
if (property.childType === type) {
@@ -763,7 +763,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
function autoAddChildren() {
/* Auto Add more Children */
if (schemaDocument.childrenNodesProperties !== undefined) {
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
let property = schemaDocument.childrenNodesProperties[i]
@@ -799,7 +799,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
/* Connect to Parent */
if (schemaDocument.childrenNodesProperties !== undefined) {
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
let property = schemaDocument.childrenNodesProperties[i]
if (property.type === 'node') {
@@ -855,7 +855,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
return
}
/* If there is not a position offset, which happens when we are dropping a node into the designer, we create a cero vector then. */
/* If there is not a position offset, which happens when we are dropping a node into the designer, we create a zero vector then. */
if (positionOffset === undefined) {
positionOffset = {
x: 0,
@@ -888,7 +888,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
/* If we are adding a new object, then we set the initial values for position and targetPosition */
if (userAddingNew === true || uiObjectType === 'Workspace') {
/* Workspace allways to the spawn position */
/* Workspace always to the spawn position */
if (uiObjectType === 'Workspace') {
payload.position = {
x: spawnPosition.x,
@@ -960,7 +960,7 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
/* This is the point where we build a map with all nodes present at the workspace */
mapOfNodes.set(node.id, node)
/* We will collect all tasks at the workspace in order to later syncronize them with the client */
/* We will collect all tasks at the workspace in order to later synchronize them with the client */
if (userAddingNew === false && uiObjectType === 'Task' && node.savedPayload !== undefined) {
if (tasksFoundAtWorkspace !== undefined) { // it might be undefined when you are spawning a task that was backed up
tasksFoundAtWorkspace.push(node)