|
|
|
@ -54,20 +54,16 @@ angular.module('openproject.workPackages.controllers') |
|
|
|
|
|
|
|
|
|
function initialSetup() { |
|
|
|
|
$scope.operatorsAndLabelsByFilterType = OPERATORS_AND_LABELS_BY_FILTER_TYPE; |
|
|
|
|
$scope.loading = false; |
|
|
|
|
$scope.disableFilters = false; |
|
|
|
|
|
|
|
|
|
var getWorkPackages, params; |
|
|
|
|
if($scope.query_id){ |
|
|
|
|
getWorkPackages = WorkPackageService.getWorkPackagesByQueryId; |
|
|
|
|
params = [$scope.projectIdentifier, $scope.query_id]; |
|
|
|
|
getWorkPackages = WorkPackageService.getWorkPackagesByQueryId($scope.projectIdentifier, $scope.query_id); |
|
|
|
|
} else { |
|
|
|
|
getWorkPackages = WorkPackageService.getWorkPackagesFromUrlQueryParams; |
|
|
|
|
params = [$scope.projectIdentifier, $location]; |
|
|
|
|
getWorkPackages = WorkPackageService.getWorkPackagesFromUrlQueryParams($scope.projectIdentifier, $location); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$scope.withLoading(getWorkPackages, params) |
|
|
|
|
.then(setupPage); |
|
|
|
|
$scope.settingUpPage = getWorkPackages.then(setupPage); |
|
|
|
|
|
|
|
|
|
loadProjectTypesAndQueries(); |
|
|
|
|
} |
|
|
|
@ -171,8 +167,10 @@ angular.module('openproject.workPackages.controllers') |
|
|
|
|
$scope.updateResults = function() { |
|
|
|
|
$scope.$broadcast('openproject.workPackages.updateResults'); |
|
|
|
|
|
|
|
|
|
return $scope.withLoading(WorkPackageService.getWorkPackages, [$scope.projectIdentifier, $scope.query, PaginationService.getPaginationOptions()]) |
|
|
|
|
$scope.refreshWorkPackages = WorkPackageService.getWorkPackages($scope.projectIdentifier, $scope.query, PaginationService.getPaginationOptions()) |
|
|
|
|
.then(setupWorkPackagesTable); |
|
|
|
|
|
|
|
|
|
return $scope.refreshWorkPackages; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// More
|
|
|
|
@ -182,10 +180,6 @@ angular.module('openproject.workPackages.controllers') |
|
|
|
|
$scope.isLoading = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$scope.withLoading = function(callback, params){ |
|
|
|
|
return WorkPackageLoadingHelper.withLoading($scope, callback, params, serviceErrorHandler); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// Go
|
|
|
|
|
|
|
|
|
|
initialSetup(); |
|
|
|
|