|
|
@ -59,13 +59,12 @@ export class WorkPackageCacheService { |
|
|
|
updateWorkPackageList(list: WorkPackageResource[]) { |
|
|
|
updateWorkPackageList(list: WorkPackageResource[]) { |
|
|
|
for (var wp of list) { |
|
|
|
for (var wp of list) { |
|
|
|
const workPackageId = getWorkPackageId(wp.id); |
|
|
|
const workPackageId = getWorkPackageId(wp.id); |
|
|
|
|
|
|
|
|
|
|
|
const wpState = this.states.workPackages.get(workPackageId); |
|
|
|
const wpState = this.states.workPackages.get(workPackageId); |
|
|
|
if (wpState.hasValue() && wpState.getCurrentValue().dirty) { |
|
|
|
const wpForPublish = wpState.hasValue() && wpState.getCurrentValue().dirty |
|
|
|
continue; |
|
|
|
? wpState.getCurrentValue() // dirty, use current wp
|
|
|
|
} |
|
|
|
: wp; // not dirty or unknown, use new wp
|
|
|
|
|
|
|
|
|
|
|
|
this.states.workPackages.put(workPackageId, wp); |
|
|
|
this.states.workPackages.put(workPackageId, wpForPublish); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|