in src/app/overview/overview.component.ts [62:95]
createDashboardMap(dashboardWeeklyData: any, dashboardMonthlyData: any) {
//console.log(dashboardMonthlyData);
const customerTaskMap = new Map();
dashboardMonthlyData.forEach(element => {
//console.log(element.customer);
const existingTasks = customerTaskMap.get(element.customer);
//console.log(existingTasks);
if (existingTasks == undefined) {
console.log('need to add to customer map', element.tasks.items);
customerTaskMap.set(element.customer, element.tasks.items);
} else {
existingTasks.push.apply(existingTasks, element.tasks.items);
customerTaskMap.set(element.customer, existingTasks);
}
});
dashboardWeeklyData.forEach(element => {
//console.log(element.customer);
const existingTasks = customerTaskMap.get(element.customer);
//console.log(existingTasks);
if (existingTasks == undefined) {
console.log('need to add to customer map', element.tasks.items);
customerTaskMap.set(element.customer, element.tasks.items);
} else {
console.log('pushing data', existingTasks, element.tasks.items);
existingTasks.push.apply(existingTasks, element.tasks.items);
customerTaskMap.set(element.customer, existingTasks);
}
});
console.log(customerTaskMap);
return customerTaskMap;
}