summaryrefslogtreecommitdiffstats
path: root/src/components/AppContent
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-09-23 10:23:49 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2022-09-27 19:11:58 +0200
commit240ee34f0515580c13537ea1e8c480dbc41bf7eb (patch)
tree559a4d1f7370a3db946e38982c32ebbe9d0bf36e /src/components/AppContent
parentf388856505cb81aa8a28c6e5d09bba5c466e0cbd (diff)
Save UID and display name for managers of the org chart
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'src/components/AppContent')
-rw-r--r--src/components/AppContent/ChartContent.vue9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/AppContent/ChartContent.vue b/src/components/AppContent/ChartContent.vue
index b77f61a9..e9c3b82f 100644
--- a/src/components/AppContent/ChartContent.vue
+++ b/src/components/AppContent/ChartContent.vue
@@ -44,14 +44,17 @@ export default {
prev.push(transformNode(contact))
const manager = contactsByUid[contact.addressbook.id][contact.managersName]
- if (manager && !manager.managersName && !headManagers.includes(manager.uid)) {
+ if (manager && !manager.managersName && !headManagers.some(m => m.nodeId === manager.uid)) {
prev.push(transformNode(manager))
- headManagers.push(manager.uid)
+ headManagers.push(transformNode(manager))
}
return prev
}, [])
- return headManagers.map(uid => getChart(tempContacts, uid))
+ const charts = headManagers.map(managerNode => getChart(tempContacts, managerNode))
+ // Debugging logs to figure out why a graph might not show. Leave this in place until the logic is bulletproof
+ console.debug('Org charts', charts.map((nodes, index) => nodes.map(n => `list ${index} ${n.nodeId} (${n.fullName}) -> ${n.parentNodeId}`)))
+ return charts
},
},
}