Hide the work package lookup in modal

pull/8306/head
bsatarnejad 5 years ago committed by Henriette Dinger
parent fa33c9511f
commit c5a14f06c4
  1. 17
      frontend/src/app/modules/time_entries/create/create.service.ts
  2. 6
      frontend/src/app/modules/time_entries/form/form.component.html

@ -46,16 +46,17 @@ export class TimeEntryCreateService {
}
public createNewTimeEntry(date:Moment, wp?:WorkPackageResource) {
// Todo handle case that wp is not given
let payload = {
spentOn: date.format('YYYY-MM-DD'),
'_links': {
'workPackage': {
'href': wp!.href
let payload:any = {
spentOn: date.format('YYYY-MM-DD')
};
if(wp) {
payload['_links'] = {
workPackage: {
href: wp.href
}
}
};
}
return this.timeEntryDm.createForm(payload).then(form => {
return this.fromCreateForm(form);

@ -27,11 +27,13 @@
</editable-attribute-field>
</div>
<div class="attributes-map--key"
<div *ngIf="!entry.workPackage"
class="attributes-map--key"
[ngClass]="{'-required': isRequired('workPackage')}"
[textContent]="text.attributes.workPackage">
</div>
<div class="attributes-map--value">
<div *ngIf="!entry.workPackage"
class="attributes-map--value">
<editable-attribute-field [resource]="entry"
[fieldName]="'workPackage'">
</editable-attribute-field>

Loading…
Cancel
Save