Update table on WP relation change

pull/4471/head
Alex Dik 9 years ago
parent 1825a78076
commit acf8b2d7dd
  1. 12
      frontend/app/components/wp-relations/wp-relations.directive.ts

@ -72,8 +72,7 @@ export class WorkPackageRelationsController {
this.relationGroup.addWpRelation(this.wpToAddId)
.then(() => {
this.wpToAddId = null;
this.updateFocus(-1);
this.$scope.$emit('workPackageRefreshRequired');
this.handleSuccess(-1);
})
.catch(error => error.data.showErrorNotification());
}
@ -85,8 +84,7 @@ export class WorkPackageRelationsController {
public removeRelation(relation) {
this.relationGroup.removeWpRelation(relation)
.then(index => {
this.updateFocus(index);
this.$scope.$emit('workPackageRefreshRequired');
this.handleSuccess(index);
})
.catch(error => error.data.showErrorNotification());
}
@ -111,6 +109,12 @@ export class WorkPackageRelationsController {
this.$scope.$evalAsync(() => this.$scope.$broadcast('updateFocus'));
}
private handleSuccess(index) {
this.updateFocus(index);
this.$scope.$emit('workPackageRefreshRequired');
this.$scope.$emit('workPackagesRefreshInBackground');
}
}
function wpRelationsDirective() {

Loading…
Cancel
Save