From 95a7f9e9b386184de42c2fa9b94379038a9dcc85 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:39:05 +1200 Subject: [PATCH] Bug Fix: Adding in iconProject to fix broken CircularMenuItems --- .../Schemas/App-Schema/bot-data-dependencies.json | 4 ++-- .../Schemas/App-Schema/other-hierarchies.json | 1 + .../Schemas/App-Schema/plugin-tutorials.json | 1 + .../UI/Spaces/Floating-Space/CircularMenu.js | 1 + .../UI/Spaces/Floating-Space/CircularMenuItem.js | 13 +++++++++++-- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Projects/Foundations/Schemas/App-Schema/bot-data-dependencies.json b/Projects/Foundations/Schemas/App-Schema/bot-data-dependencies.json index 4bb8dd2ca..bee3c1661 100644 --- a/Projects/Foundations/Schemas/App-Schema/bot-data-dependencies.json +++ b/Projects/Foundations/Schemas/App-Schema/bot-data-dependencies.json @@ -9,8 +9,8 @@ }, { "action": "Add UI Object", - "label": "Add Dependency Product Folder", - "relatedUiObject": "Dependency Product Folder", + "label": "Add Data Dependency Folder", + "relatedUiObject": "Data Dependency Folder", "actionFunction": "payload.executeAction" }, { diff --git a/Projects/Foundations/Schemas/App-Schema/other-hierarchies.json b/Projects/Foundations/Schemas/App-Schema/other-hierarchies.json index 96a182740..b167e079f 100644 --- a/Projects/Foundations/Schemas/App-Schema/other-hierarchies.json +++ b/Projects/Foundations/Schemas/App-Schema/other-hierarchies.json @@ -10,6 +10,7 @@ { "action": "Add UI Object", "label": "Add Tutorial", + "iconProject": "Education", "relatedUiObject": "Tutorial", "actionFunction": "payload.executeAction" }, diff --git a/Projects/Foundations/Schemas/App-Schema/plugin-tutorials.json b/Projects/Foundations/Schemas/App-Schema/plugin-tutorials.json index 266c90700..ba844f57f 100644 --- a/Projects/Foundations/Schemas/App-Schema/plugin-tutorials.json +++ b/Projects/Foundations/Schemas/App-Schema/plugin-tutorials.json @@ -4,6 +4,7 @@ { "action": "Add Missing Plugin Tutorials", "label": "Add Missing Tutorials", + "iconProject": "Education", "askConfirmation": true, "confirmationLabel": "Confirm to Proceed", "workDoneLabel": "Done", diff --git a/Projects/Foundations/UI/Spaces/Floating-Space/CircularMenu.js b/Projects/Foundations/UI/Spaces/Floating-Space/CircularMenu.js index 121b59176..f49dcd25b 100644 --- a/Projects/Foundations/UI/Spaces/Floating-Space/CircularMenu.js +++ b/Projects/Foundations/UI/Spaces/Floating-Space/CircularMenu.js @@ -73,6 +73,7 @@ function newCircularMenu() { menuItem.visible = menuItemInitialValue.visible menuItem.iconPathOn = menuItemInitialValue.iconPathOn menuItem.iconPathOff = menuItemInitialValue.iconPathOff + menuItem.iconProject = menuItemInitialValue.iconProject menuItem.rawRadius = menuItemInitialValue.rawRadius menuItem.targetRadius = menuItemInitialValue.label menuItem.currentRadius = menuItemInitialValue.currentRadius diff --git a/Projects/Foundations/UI/Spaces/Floating-Space/CircularMenuItem.js b/Projects/Foundations/UI/Spaces/Floating-Space/CircularMenuItem.js index e0e99082b..29032cbc9 100644 --- a/Projects/Foundations/UI/Spaces/Floating-Space/CircularMenuItem.js +++ b/Projects/Foundations/UI/Spaces/Floating-Space/CircularMenuItem.js @@ -9,6 +9,7 @@ function newCircularMenuItem() { confirmationLabel: undefined, iconOn: undefined, iconOff: undefined, + iconProject: undefined, icons: undefined, currentIcon: undefined, disableIfPropertyIsDefined: undefined, @@ -94,6 +95,7 @@ function newCircularMenuItem() { thisObject.container = undefined thisObject.iconOn = undefined thisObject.iconOff = undefined + thisObject.iconProject = undefined thisObject.icons = undefined thisObject.currentIcon = undefined thisObject.payload = undefined @@ -261,11 +263,18 @@ function newCircularMenuItem() { thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName('Foundations', thisObject.secondaryIcon) thisObject.iconOff = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName('Foundations', thisObject.secondaryIcon) } else { - if (thisObject.relatedUiObject !== undefined) { + if (thisObject.label === "Add Dependency Product Folder") { console.log ("Test") } + if (thisObject.relatedUiObject !== undefined && thisObject.iconProject !== undefined) { + thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.iconProject, thisObject.relatedUiObject) + thisObject.iconOff = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.iconProject, thisObject.relatedUiObject) + } else if (thisObject.relatedUiObject !== undefined && thisObject.iconProject === undefined) { thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.payload.node.project, thisObject.relatedUiObject) thisObject.iconOff = UI.projects.foundations.spaces.designSpace.getIconByProjectAndType(thisObject.payload.node.project, thisObject.relatedUiObject) } else { - if (thisObject.iconPathOn !== undefined && thisObject.iconPathOff !== undefined) { + if (thisObject.iconPathOn !== undefined && thisObject.iconPathOff !== undefined && thisObject.iconProject !== undefined) { + thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName(thisObject.iconProject, thisObject.iconPathOn) + thisObject.iconOff = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName(thisObject.iconProject, thisObject.iconPathOff) + } else if (thisObject.iconPathOn !== undefined && thisObject.iconPathOff !== undefined && thisObject.iconProject === undefined) { thisObject.iconOn = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName('Foundations', thisObject.iconPathOn) thisObject.iconOff = UI.projects.foundations.spaces.designSpace.getIconByProjectAndName('Foundations', thisObject.iconPathOff) } else {