WIP timeline

pull/5091/head
Roman Roelofsen 8 years ago
parent 5e4e359b90
commit 22f74b2ad2
  1. 6
      frontend/app/components/wp-table/timeline/wp-timeline-cell.ts
  2. 19
      frontend/app/components/wp-table/wp-row/wp-row.directive.js

@ -26,10 +26,10 @@
// See doc/COPYRIGHT.rdoc for more details.
// ++
import {states} from "../../../states";
import {WorkPackageResource} from "../../api/api-v3/hal-resources/work-package-resource.service";
import {State} from "../../../helpers/reactive-fassade";
import IScope = angular.IScope;
import {States} from "../../states.service";
export class WorkPackageTimelineCell {
@ -37,7 +37,7 @@ export class WorkPackageTimelineCell {
private bar: HTMLDivElement;
constructor(private scope: IScope, private workPackageId: string, private timelineCell: HTMLTableElement) {
constructor(private scope: IScope, states: States, private workPackageId: string, private timelineCell: HTMLTableElement) {
this.state = states.workPackages.get(workPackageId);
}
@ -49,7 +49,7 @@ export class WorkPackageTimelineCell {
this.timelineCell.appendChild(this.bar);
this.state.observe(this.scope).subscribe(wp => {
console.log("new wp:" + wp);
console.log("new wp for cell:" + wp);
});
}

@ -26,9 +26,6 @@
// See doc/COPYRIGHT.rdoc for more details.
// ++
angular
.module('openproject.workPackages.directives')
.directive('wpRow', wpRow);
var WorkPackagesTimelineCell = require("../timeline/wp-timeline-cell").WorkPackageTimelineCell;
@ -46,11 +43,15 @@ function wpRow(WorkPackagesTableService){
return {
restrict: 'A',
link: function(scope, elem) {
const workPackageId = scope.row.object.id;
const timelineTd = elem.find("td.wp-timeline-cell")[0];
new WorkPackagesTimelineCell(scope, workPackageId, timelineTd).init();
controller: function (states, $scope, $element) {
"ngInject";
var workPackageId = $scope.row.object.id;
var timelineTd = $element.find("td.wp-timeline-cell")[0];
new WorkPackagesTimelineCell($scope, states, workPackageId, timelineTd).init();
},
link: function(scope) {
scope.workPackage = scope.row.object;
setCheckboxTitle(scope);
@ -64,3 +65,7 @@ function wpRow(WorkPackagesTableService){
}
};
}
angular
.module('openproject.workPackages.directives')
.directive('wpRow', wpRow);

Loading…
Cancel
Save