Merge pull request #5076 from opf/fix/24359/path-to-time-entries

[24359] Use PathHelper to locate path to time entries
pull/5081/head
ulferts 8 years ago committed by GitHub
commit c7e4a87d85
  1. 12
      frontend/app/components/wp-display/field-types/wp-display-spent-time-field.module.ts

@ -35,22 +35,24 @@ export class SpentTimeDisplayField extends DurationDisplayField {
public timeEntriesLink: string;
public isManualRenderer = false;
private PathHelper:any;
constructor(public resource: WorkPackageResourceInterface,
public name: string,
public schema) {
super(resource, name, schema);
this.PathHelper = this.$injector.get('PathHelper');
this.text = {
linkTitle: this.I18n.t('js.work_packages.message_view_spent_time')
};
if (resource.project) {
resource.project.$load().then(project => {
this.timeEntriesLink =
URI
.expand('/projects/{identifier}/time_entries', project)
.search({ work_package_id: resource.id })
.toString();
this.timeEntriesLink = URI(this.PathHelper.projectTimeEntriesPath(project.identifier))
.search({ work_package_id: resource.id })
.toString();
});
}
}

Loading…
Cancel
Save