Replace usages of op.WorkPackage with correct resource

pull/5162/head
Oliver Günther 8 years ago
parent 810d57ebeb
commit 0d37e17873
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 5
      frontend/app/components/api/api-v3/hal-resources/work-package-resource.service.ts
  2. 8
      frontend/app/components/wp-table/timeline/cell-renderer/timeline-cell-renderer.ts
  3. 7
      frontend/app/components/wp-table/timeline/cell-renderer/timeline-milestone-cell-renderer.ts
  4. 1
      frontend/app/components/wp-table/timeline/wp-timeline-cell-mouse-handler.ts
  5. 1
      frontend/app/components/wp-table/timeline/wp-timeline-cell.ts
  6. 4
      frontend/app/components/wp-table/timeline/wp-timeline-container.directive.ts
  7. 1
      frontend/app/components/wp-table/timeline/wp-timeline.today-line.ts
  8. 4
      frontend/app/components/wp-table/timeline/wp-timeline.ts
  9. 36
      frontend/app/typings/open-project.typings.d.ts

@ -60,6 +60,11 @@ interface WorkPackageResourceEmbedded {
type: TypeResource;
version: HalResource|any;
watchers: CollectionResourceInterface;
// For regular work packages
startDate?: string;
dueDate?: string;
// Only for milestones
date?: string;
}
interface WorkPackageResourceLinks extends WorkPackageResourceEmbedded {

@ -19,7 +19,7 @@ export class TimelineCellRenderer {
* For generic work packages, assigns start and due date.
*
*/
public assignDateValues(wp: op.WorkPackage, dates:{[name:string]: moment.Moment}) {
public assignDateValues(wp: WorkPackageResourceInterface, dates:{[name:string]: moment.Moment}) {
this.assignDate(wp, 'startDate', dates['startDate']);
this.assignDate(wp, 'dueDate', dates['dueDate']);
}
@ -27,7 +27,7 @@ export class TimelineCellRenderer {
/**
* Restore the original date, if any was set.
*/
public onCancel(wp: op.WorkPackage, dates:{[name:string]: moment.Moment}) {
public onCancel(wp: WorkPackageResourceInterface, dates:{[name:string]: moment.Moment}) {
this.assignDate(wp, 'startDate', dates['initialStartDate']);
this.assignDate(wp, 'dueDate', dates['initialDueDate']);
}
@ -73,7 +73,7 @@ export class TimelineCellRenderer {
return dates;
}
public update(element:HTMLDivElement, wp: op.WorkPackage, renderInfo:RenderInfo) {
public update(element:HTMLDivElement, wp: WorkPackageResourceInterface, renderInfo:RenderInfo) {
// abort if no start or due date
if (!wp.startDate || !wp.dueDate) {
return;
@ -147,7 +147,7 @@ export class TimelineCellRenderer {
return this.fallbackColor;
}
protected assignDate(wp: op.WorkPackage, attributeName:string, value: moment.Moment) {
protected assignDate(wp: WorkPackageResourceInterface, attributeName:string, value: moment.Moment) {
if (value) {
wp[attributeName] = value.format("YYYY-MM-DD") as any;
}

@ -1,3 +1,4 @@
import {WorkPackageResourceInterface} from './../../../api/api-v3/hal-resources/work-package-resource.service';
import {TimelineCellRenderer} from './timeline-cell-renderer';
import {RenderInfo, calculatePositionValueForDayCount, timelineElementCssClass} from './../wp-timeline';
@ -15,14 +16,14 @@ export class TimelineMilestoneCellRenderer extends TimelineCellRenderer {
* For generic work packages, assigns start and due date.
*
*/
public assignDateValues(wp: op.WorkPackage, dates:{[name:string]: moment.Moment}) {
public assignDateValues(wp: WorkPackageResourceInterface, dates:{[name:string]: moment.Moment}) {
this.assignDate(wp, 'date', dates['date']);
}
/**
* Restore the original date, if any was set.
*/
public onCancel(wp: op.WorkPackage, dates:{[name:string]: moment.Moment}) {
public onCancel(wp: WorkPackageResourceInterface, dates:{[name:string]: moment.Moment}) {
this.assignDate(wp, 'date', dates['initialDate']);
}
@ -48,7 +49,7 @@ export class TimelineMilestoneCellRenderer extends TimelineCellRenderer {
return dates;
}
public update(element:HTMLDivElement, wp: op.WorkPackage, renderInfo:RenderInfo) {
public update(element:HTMLDivElement, wp: WorkPackageResourceInterface, renderInfo:RenderInfo) {
// abort if no start or due date
if (!wp.date) {
return;

@ -28,7 +28,6 @@
import {timelineElementCssClass, RenderInfo} from "./wp-timeline";
import {WorkPackageCacheService} from "../../work-packages/work-package-cache.service";
import IScope = angular.IScope;
import WorkPackage = op.WorkPackage;
import Observable = Rx.Observable;
import IDisposable = Rx.IDisposable;
import Moment = moment.Moment;

@ -33,7 +33,6 @@ import {registerWorkPackageMouseHandler} from "./wp-timeline-cell-mouse-handler"
import {TimelineMilestoneCellRenderer} from './cell-renderer/timeline-milestone-cell-renderer';
import {TimelineCellRenderer} from './cell-renderer/timeline-cell-renderer';
import IScope = angular.IScope;
import WorkPackage = op.WorkPackage;
import Observable = Rx.Observable;
import IDisposable = Rx.IDisposable;
import Moment = moment.Moment;

@ -27,11 +27,11 @@
// ++
import {openprojectModule} from "../../../angular-modules";
import {TimelineViewParameters, RenderInfo, timelineElementCssClass} from "./wp-timeline";
import {WorkPackageResourceInterface} from './../../api/api-v3/hal-resources/work-package-resource.service';
import {InteractiveTableController} from "./../../common/interactive-table/interactive-table.directive";
import {WpTimelineHeader} from "./wp-timeline.header";
import {States} from "./../../states.service";
import WorkPackage = op.WorkPackage;
import Observable = Rx.Observable;
import Moment = moment.Moment;
import IDirective = angular.IDirective;
@ -41,7 +41,7 @@ export class WorkPackageTimelineTableController {
private _viewParameters: TimelineViewParameters = new TimelineViewParameters();
private workPackagesInView: {[id: string]: WorkPackage} = {};
private workPackagesInView: {[id: string]: WorkPackageResourceInterface} = {};
private wpTimelineHeader;

@ -27,7 +27,6 @@
// ++
import {calculatePositionValueForDayCount, TimelineViewParameters} from "./wp-timeline";
import WorkPackage = op.WorkPackage;
import Observable = Rx.Observable;
import Moment = moment.Moment;

@ -26,10 +26,10 @@
// See doc/COPYRIGHT.rdoc for more details.
// ++
import WorkPackage = op.WorkPackage;
import Observable = Rx.Observable;
import Moment = moment.Moment;
import {WorkPackageResourceInterface} from './../../api/api-v3/hal-resources/work-package-resource.service';
export const timelineElementCssClass = "timeline-element";
/**
@ -99,7 +99,7 @@ export class TimelineViewParameters {
*/
export interface RenderInfo {
viewParams: TimelineViewParameters;
workPackage: WorkPackage;
workPackage: WorkPackageResourceInterface;
}
/**

@ -61,31 +61,6 @@ declare namespace api {
raw:string;
html:string;
}
interface WorkPackage {
id:number;
lockVersion:number;
subject:string;
type:string;
description:Formattable;
parentId:number;
startDate:Date;
dueDate:Date;
date:Date;
estimatedTime:Duration;
spentTime:Duration;
percentageDone:number;
createdAt:Date;
updatedAt:Date;
}
interface Project {
}
interface Query {
}
}
/**
@ -195,17 +170,6 @@ declare namespace op {
allowedValues;
}
interface WorkPackageLinks {
schema:FieldSchema;
type: any;
}
interface WorkPackage extends api.v3.WorkPackage, WorkPackageLinks {
getForm();
save();
links:WorkPackageLinks;
}
interface QueryParams {
offset?:number;
pageSize?:number;

Loading…
Cancel
Save