diff --git a/Projects/Ethereum/Schemas/AppSchema.json b/Projects/Ethereum/Schemas/AppSchema.json index 8cd7da2ad..2528bb9fc 100644 --- a/Projects/Ethereum/Schemas/AppSchema.json +++ b/Projects/Ethereum/Schemas/AppSchema.json @@ -13,6 +13,15 @@ "label": "Add Decentralized Application", "relatedUiObject": "Decentralized Application", "actionFunction": "payload.executeAction" + }, + { + "action": "Delete UI Object", + "askConfirmation": true, + "confirmationLabel": "Confirm to Delete", + "actionFunction": "payload.executeAction", + "label": "Delete", + "iconPathOn": "delete", + "iconPathOff": "delete" } ], "isProjectHead": true, diff --git a/Projects/Superalgos/Function-Libraries/ActionSwitch.js b/Projects/Superalgos/Function-Libraries/ActionSwitch.js index 2a29a46c3..f4d063bde 100644 --- a/Projects/Superalgos/Function-Libraries/ActionSwitch.js +++ b/Projects/Superalgos/Function-Libraries/ActionSwitch.js @@ -26,6 +26,7 @@ function newSuperalgosActionSwitch() { let functionLibraryDataStorageFunctions = newDataStorageFunctions() let functionLibraryChartingSpaceFunctions = newChartingSpaceFunctions() let functionLibraryPluginsFunctions = newPluginsFunctions() + let functionLibraryWorkspaceFunctions = newWorkspaceFunctions() return thisObject @@ -50,6 +51,7 @@ function newSuperalgosActionSwitch() { functionLibraryDataStorageFunctions = undefined functionLibraryChartingSpaceFunctions = undefined functionLibraryPluginsFunctions = undefined + functionLibraryWorkspaceFunctions = undefined } function initialize() { @@ -649,6 +651,11 @@ function newSuperalgosActionSwitch() { functionLibraryPluginsFunctions.pluginMissingTutorials(action.node, action.rootNodes, functionLibraryUiObjectsFromNodes) } break + case 'Add Missing Workspace Projects': + { + functionLibraryWorkspaceFunctions.addMissingWorkspaceProjects(action.node, action.rootNodes, functionLibraryUiObjectsFromNodes) + } + break } } } diff --git a/Projects/Superalgos/Function-Libraries/UiObjectsFromNodes.js b/Projects/Superalgos/Function-Libraries/UiObjectsFromNodes.js index 1221d315b..7861107ac 100644 --- a/Projects/Superalgos/Function-Libraries/UiObjectsFromNodes.js +++ b/Projects/Superalgos/Function-Libraries/UiObjectsFromNodes.js @@ -2,7 +2,7 @@ function newUiObjectsFromNodes() { thisObject = { syncronizeTasksFoundAtWorkspaceWithBackEnd: syncronizeTasksFoundAtWorkspaceWithBackEnd, syncronizeTradingSessionsFoundAtWorkspaceWithBackEnd: syncronizeTradingSessionsFoundAtWorkspaceWithBackEnd, - syncronizeLearningSessionsFoundAtWorkspaceWithBackEnd: syncronizeLearningSessionsFoundAtWorkspaceWithBackEnd, + syncronizeLearningSessionsFoundAtWorkspaceWithBackEnd: syncronizeLearningSessionsFoundAtWorkspaceWithBackEnd, playTutorials: playTutorials, recreateWorkspace: recreateWorkspace, getNodeById: getNodeById, @@ -362,7 +362,7 @@ function newUiObjectsFromNodes() { } } - if (nodeDefinition.isHierarchyHead === true) { + if (nodeDefinition.isHierarchyHead === true || nodeDefinition.isProjectHead) { rootNodes.push(object) createUiObject(true, object.type, object.name, object, parentNode, undefined) return object diff --git a/Projects/Superalgos/Function-Libraries/WorkspaceFunctions.js b/Projects/Superalgos/Function-Libraries/WorkspaceFunctions.js new file mode 100644 index 000000000..2e8175340 --- /dev/null +++ b/Projects/Superalgos/Function-Libraries/WorkspaceFunctions.js @@ -0,0 +1,32 @@ +function newWorkspaceFunctions() { + thisObject = { + addMissingWorkspaceProjects: addMissingWorkspaceProjects + } + + return thisObject + + function addMissingWorkspaceProjects(node, rootNodes, functionLibraryUiObjectsFromNodes) { + let url = 'ProjectNames' + callWebServer(undefined, url, onResponse) + + function onResponse(err, pProjects) { + let projects = JSON.parse(pProjects) + for (let i = 0; i < projects.length; i++) { + let project = projects[i] + let alreadyExist = false + + for (let j = 0; j < rootNodes.length; j++) { + let rootNode = rootNodes[j] + if (rootNode.type === project + ' Project') { + alreadyExist = true + } + } + + if (alreadyExist === false) { + let child = functionLibraryUiObjectsFromNodes.addUIObject(node, project + ' Project', rootNodes) + child.project = project + } + } + } + } +} diff --git a/Projects/Superalgos/Schemas/AppSchema.json b/Projects/Superalgos/Schemas/AppSchema.json index 7a5f5d3bd..0b0041667 100644 --- a/Projects/Superalgos/Schemas/AppSchema.json +++ b/Projects/Superalgos/Schemas/AppSchema.json @@ -1,19 +1,85 @@ [ { "type": "Superalgos Project", + "menuItems": [ + { + "action": "Add Missing Children", + "label": "Add Missing Children", + "relatedUiObject": "Superalgos Project", + "actionFunction": "payload.executeAction" + }, + { + "action": "Delete UI Object", + "askConfirmation": true, + "confirmationLabel": "Confirm to Delete", + "actionFunction": "payload.executeAction", + "label": "Delete", + "iconPathOn": "delete", + "iconPathOff": "delete" + } + ], + "isProjectHead": true, + "isTitleAllwaysVisible": false, + "addLeftIcons": true, + "isPinned": true, + "positionLocked": true, + "icon": "superalgos", + "properties": [ + { + "name": "spaces", + "type": "node", + "childType": "Spaces", + "autoAdd": true + }, + { + "name": "mines", + "type": "node", + "childType": "Mines", + "autoAdd": true + }, + { + "name": "otherHierarchies", + "type": "node", + "childType": "Other Hierarchies", + "autoAdd": true + } + ] + }, + { + "type": "Spaces", "menuItems": [ { "action": "Add UI Object", - "label": "Add Trading System", - "relatedUiObject": "Trading System", + "label": "Add Charting Space", + "relatedUiObject": "Charting Space", "actionFunction": "payload.executeAction" }, { "action": "Add UI Object", - "label": "Add Network", - "relatedUiObject": "Network", + "label": "Add Design Space", + "relatedUiObject": "Design Space", "actionFunction": "payload.executeAction" }, + { + "action": "Delete UI Object", + "askConfirmation": true, + "confirmationLabel": "Confirm to Delete", + "actionFunction": "payload.executeAction", + "label": "Delete", + "iconPathOn": "delete", + "iconPathOff": "delete" + } + ], + "isTitleAllwaysVisible": false, + "addLeftIcons": true, + "isPinned": false, + "level": 2, + "propertyNameAtParent": "spaces", + "icon": "bitcoin" + }, + { + "type": "Mines", + "menuItems": [ { "action": "Add UI Object", "label": "Add Data Mine", @@ -32,6 +98,38 @@ "relatedUiObject": "Learning Mine", "actionFunction": "payload.executeAction" }, + { + "action": "Delete UI Object", + "askConfirmation": true, + "confirmationLabel": "Confirm to Delete", + "actionFunction": "payload.executeAction", + "label": "Delete", + "iconPathOn": "delete", + "iconPathOff": "delete" + } + ], + "isTitleAllwaysVisible": false, + "addLeftIcons": true, + "isPinned": false, + "level": 2, + "propertyNameAtParent": "mines", + "icon": "bitcoin" + }, + { + "type": "Other Hierarchies", + "menuItems": [ + { + "action": "Add UI Object", + "label": "Add Trading System", + "relatedUiObject": "Trading System", + "actionFunction": "payload.executeAction" + }, + { + "action": "Add UI Object", + "label": "Add Network", + "relatedUiObject": "Network", + "actionFunction": "payload.executeAction" + }, { "action": "Add UI Object", "label": "Add Super Scripts", @@ -49,14 +147,23 @@ "label": "Add Tutorial", "relatedUiObject": "Tutorial", "actionFunction": "payload.executeAction" + }, + { + "action": "Delete UI Object", + "askConfirmation": true, + "confirmationLabel": "Confirm to Delete", + "actionFunction": "payload.executeAction", + "label": "Delete", + "iconPathOn": "delete", + "iconPathOff": "delete" } ], - "isProjectHead": true, "isTitleAllwaysVisible": false, "addLeftIcons": true, - "isPinned": true, - "positionLocked": true, - "icon": "superalgos" + "isPinned": false, + "level": 2, + "propertyNameAtParent": "otherHierarchies", + "icon": "bitcoin" }, { "type": "Workspace", @@ -14323,7 +14430,16 @@ "label": "Add Space Settings", "relatedUiObject": "Space Settings", "actionFunction": "payload.executeAction" - } + }, + { + "action": "Delete UI Object", + "askConfirmation": true, + "confirmationLabel": "Confirm to Delete", + "actionFunction": "payload.executeAction", + "label": "Delete", + "iconPathOn": "delete", + "iconPathOff": "delete" + } ], "isHierarchyHead": true, "addLeftIcons": true, @@ -14450,6 +14566,15 @@ "workDoneLabel": "Done", "relatedUiObject": "Dashboard", "actionFunction": "payload.executeAction" + }, + { + "action": "Delete UI Object", + "askConfirmation": true, + "confirmationLabel": "Confirm to Delete", + "actionFunction": "payload.executeAction", + "label": "Delete", + "iconPathOn": "delete", + "iconPathOff": "delete" } ], "isHierarchyHead": true, @@ -14985,7 +15110,7 @@ "childType": "Layer Panel" } ], - "icon": "bitcoin" + "icon": "under-construction" }, { "type": "Layer Panel", @@ -15027,7 +15152,7 @@ }, "propertyNameAtParent": "layerPanels", "properties": [], - "icon": "bitcoin" + "icon": "under-construction" }, { "type": "Layer Polygons", @@ -15067,7 +15192,7 @@ "childType": "Layer Polygon" } ], - "icon": "bitcoin" + "icon": "under-construction" }, { "type": "Layer Polygon", @@ -15109,7 +15234,7 @@ }, "propertyNameAtParent": "layerPolygons", "properties": [], - "icon": "bitcoin" + "icon": "under-construction" }, { "type": "Bot Layers", @@ -17104,7 +17229,6 @@ "autoAdd": false } ], - "icon": "bitcoin", "alternativeIcons": [ { "codeName": "Superalgos",