Handle missing summarized cost entries

If costs isn't activated for subprojects the summarized cost entries are
missing in the API response for the current project's work package.
pull/6827/head
Hagen Schink 10 years ago
parent c7159adef7
commit 2d75f7ecb2
  1. 4
      app/assets/javascripts/angular/openproject-costs-app.js

@ -35,7 +35,9 @@ openprojectCostsApp.run(['HookService', function(HookService) {
switch (params.type) {
case "spentUnits":
if (params.workPackage.embedded.summarizedCostEntries.length > 0) {
var summarizedCostEntries = params.workPackage.embedded.summarizedCostEntries;
if (summarizedCostEntries && summarizedCostEntries.length > 0) {
directive = "summarized-cost-entries";
}
break;

Loading…
Cancel
Save