Improvement: Adding List Selector for Missing Projects
This commit is contained in:
1 parent
9a0ce7ae68
commit
335637cb09
3 files changed
+51
-1
No files matched your search
@@ -39,6 +39,13 @@
|
||||
"actionFunction": "payload.executeAction",
|
||||
"relatedUiObjectProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add Specified Workspace Project",
|
||||
"label": "Add Specified Workspace Project",
|
||||
"relatedUiObject": "Workspace",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"relatedUiObjectProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Check For Missing References",
|
||||
"label": "Check For Missing References",
|
||||
@@ -58,7 +65,8 @@
|
||||
"config": "{\"docsLanguage\": \"EN\"}"
|
||||
},
|
||||
"editors": {
|
||||
"config": true
|
||||
"config": true,
|
||||
"list": true
|
||||
},
|
||||
"isTitleAllwaysVisible": true,
|
||||
"addLeftIcons": false,
|
||||
|
||||
@@ -407,6 +407,11 @@ function newFoundationsActionSwitch() {
|
||||
UI.projects.foundations.functionLibraries.workspaceFunctions.addMissingWorkspaceProjects(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Specified Workspace Project':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.workspaceFunctions.addSpecifiedWorkspaceProject(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Check For Missing References':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.workspaceFunctions.checkForMissingReferences(action.rootNodes)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
function newFoundationsFunctionLibraryWorkspaceFunctions() {
|
||||
let thisObject = {
|
||||
addMissingWorkspaceProjects: addMissingWorkspaceProjects,
|
||||
addSpecifiedWorkspaceProject: addSpecifiedWorkspaceProject,
|
||||
checkForMissingReferences: checkForMissingReferences,
|
||||
fixMissingReferences: fixMissingReferences
|
||||
}
|
||||
@@ -32,6 +33,42 @@ function newFoundationsFunctionLibraryWorkspaceFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
function addSpecifiedWorkspaceProject(node, rootNodes) {
|
||||
let action = { node: node }
|
||||
let validProjects = PROJECTS_SCHEMA
|
||||
|
||||
// Find the Projects not already part of the Workspace
|
||||
for (let i = 0; i < PROJECTS_SCHEMA.length; i++) {
|
||||
let projectDefinition = PROJECTS_SCHEMA[i]
|
||||
let project = projectDefinition.name
|
||||
|
||||
for (let k = 0; k < rootNodes.length; k++) {
|
||||
let rootNode = rootNodes[k]
|
||||
if (rootNode.type === project + ' Project') {
|
||||
validProjects = validProjects.filter(function(val) {
|
||||
return val.name + ' Project' !== rootNode.type
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create the Projects as an Array
|
||||
let projectList = []
|
||||
|
||||
for (let i = 0; i < validProjects.length; i++) {
|
||||
projectList.push(validProjects[i].name)
|
||||
}
|
||||
|
||||
let eventSubscriptionId = node.payload.uiObject.container.eventHandler.listenToEvent('listSelectorClicked', onListSelect)
|
||||
node.payload.uiObject.listSelector.activate(action, projectList, eventSubscriptionId)
|
||||
|
||||
function onListSelect(event) {
|
||||
UI.projects.visualScripting.functionLibraries.uiObjectsFromNodes.addUIObject(node, event.selectedNode + ' Project', rootNodes, event.selectedNode)
|
||||
node.payload.uiObject.container.eventHandler.stopListening('listSelectorClicked')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// This function scales the current workspace and highlights any nodes that have unresolved references
|
||||
function checkForMissingReferences(rootNodes) {
|
||||
let nodes
|
||||
|
||||
Reference in new issue
Block a user