Refactor relation group services

pull/4589/head
Alex Dik 8 years ago committed by Oliver Günther
parent 0e6b4411df
commit 9c2c9fa034
  1. 8
      frontend/app/components/wp-relations/wp-relation-group/wp-child-relation-group.service.ts
  2. 8
      frontend/app/components/wp-relations/wp-relation-group/wp-parent-relation-group.service.ts
  3. 6
      frontend/app/components/wp-relations/wp-relation-group/wp-relation-group.service.ts

@ -45,7 +45,7 @@ export class WorkPackageChildRelationsGroup extends WorkPackageRelationGroup {
return relation.$load();
}
public addWpRelation() {
public addWpRelation():ng.IPromise<any> {
return this.workPackage.project.$load()
.then(() => {
const args = [
@ -60,7 +60,7 @@ export class WorkPackageChildRelationsGroup extends WorkPackageRelationGroup {
args[0] = 'work-packages.new';
}
$state.go(...args);
(<any>$state).go(...args);
});
}
@ -91,8 +91,8 @@ export class WorkPackageChildRelationsGroup extends WorkPackageRelationGroup {
}
}
function wpChildRelationsGroupService() {
[$state, $q] = arguments;
function wpChildRelationsGroupService(...args) {
[$state, $q] = args;
return WorkPackageChildRelationsGroup;
}

@ -26,8 +26,8 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
import {WorkPackageRelationGroup} from "./wp-relation-group.service";
import {wpTabsModule} from "../../../angular-modules";
import {WorkPackageRelationGroup} from './wp-relation-group.service';
import {wpTabsModule} from '../../../angular-modules';
var HalResource;
var PathHelper:any;
@ -72,8 +72,8 @@ export class WorkPackageParentRelationGroup extends WorkPackageRelationGroup {
}
}
function wpParentRelationGroupService() {
[HalResource, PathHelper] = arguments;
function wpParentRelationGroupService(...args) {
[HalResource, PathHelper] = args;
return WorkPackageParentRelationGroup;
}

@ -100,7 +100,7 @@ export class WorkPackageRelationGroup {
return deferred.promise;
}
public addWpRelation(wpId:number):ng.IPromise {
public addWpRelation(wpId:number):ng.IPromise<any> {
return this.workPackage.addRelation({
to_id: wpId,
relation_type: this.id
@ -126,8 +126,8 @@ export class WorkPackageRelationGroup {
}
}
function wpRelationGroupService() {
[$q, $http, PathHelper] = arguments;
function wpRelationGroupService(...args) {
[$q, $http, PathHelper] = args;
return WorkPackageRelationGroup;
}

Loading…
Cancel
Save