Skip to content
Snippets Groups Projects
Commit 9263e616 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #8887: check for updates and check for undefined vars

parent 8791be70
Branches
Tags
No related merge requests found
...@@ -171,8 +171,11 @@ ganttProjectControllerMod.controller('GanttProjectController', ['$scope', 'dataS ...@@ -171,8 +171,11 @@ ganttProjectControllerMod.controller('GanttProjectController', ['$scope', 'dataS
}; };
$scope.$watch('dataService.tasks', updateGanttData, true); $scope.$watch('dataService.tasks', updateGanttData, true);
$scope.$watch('dataService.filteredTasks', updateGanttData, true); $scope.$watch('dataService.resources', updateGanttData);
$scope.$watch('dataService.tasktypes', updateGanttData, true); $scope.$watch('dataService.resourceClaims', updateGanttData, true);
$scope.$watch('dataService.resourceGroups', updateGanttData);
$scope.$watch('dataService.resourceGroupMemberships', updateGanttData);
$scope.$watch('dataService.filteredTaskDict', updateGanttData);
$scope.$watch('dataService.momProjectsDict', updateGanttData, true); $scope.$watch('dataService.momProjectsDict', updateGanttData, true);
} }
]); ]);
...@@ -94,6 +94,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat ...@@ -94,6 +94,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
var createGanttRowTree = function(groupId, parentRow) { var createGanttRowTree = function(groupId, parentRow) {
var resourceGroup = resourceGroupsDict[groupId]; var resourceGroup = resourceGroupsDict[groupId];
if(resourceGroup) {
var groupRowId = 'group_' + groupId; var groupRowId = 'group_' + groupId;
if(parentRow) { if(parentRow) {
groupRowId += '_parent' + parentRow.id; groupRowId += '_parent' + parentRow.id;
...@@ -120,6 +121,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat ...@@ -120,6 +121,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
var childGroupId = resourceGroupMemberships.groups[groupId].child_ids[i]; var childGroupId = resourceGroupMemberships.groups[groupId].child_ids[i];
createGanttRowTree(childGroupId, ganttRow); createGanttRowTree(childGroupId, ganttRow);
} }
}
}; };
//build tree of resourceGroups //build tree of resourceGroups
...@@ -153,6 +155,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat ...@@ -153,6 +155,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
//since each resourceGroup itself can have multiple parents //since each resourceGroup itself can have multiple parents
var parentGanttRows = resourceGroup2GanttRows[parentGroupId]; var parentGanttRows = resourceGroup2GanttRows[parentGroupId];
if(parentGanttRows) {
for(var parentGanttRow of parentGanttRows) { for(var parentGanttRow of parentGanttRows) {
var resourceGanttRowId = 'resource_' + resource.id + '_' + parentGanttRow.id; var resourceGanttRowId = 'resource_' + resource.id + '_' + parentGanttRow.id;
var ganttRow = { var ganttRow = {
...@@ -174,6 +177,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat ...@@ -174,6 +177,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
} }
} }
} }
}
//there are also resources which are not part of a group //there are also resources which are not part of a group
//add these as well. //add these as well.
...@@ -240,6 +244,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat ...@@ -240,6 +244,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
for(var resourceId of resourceIds) { for(var resourceId of resourceIds) {
var claims = resource2Claims[resourceId]; var claims = resource2Claims[resourceId];
if(claims) {
for(var claim of claims) { for(var claim of claims) {
var taskId = claim.task_id; var taskId = claim.task_id;
if(taskId in aggregatedClaims) { if(taskId in aggregatedClaims) {
...@@ -255,6 +260,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat ...@@ -255,6 +260,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
} }
} }
} }
}
var childGroupIds = resourceGroupMemberships.groups[groupId].child_ids; var childGroupIds = resourceGroupMemberships.groups[groupId].child_ids;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment