Fix user mention for new work packages by setting _type

CKEditor mention requires the passed resource to be of `_type ===
'WorkPackage'`. This is set for all existing work packages but the form
payload does not contain it.

Thus we need to set it explicitly for new work packages

https://community.openproject.com/wp/28472
pull/7542/head
Oliver Günther 5 years ago
parent f0dabd2476
commit 3ad70203ae
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 3
      frontend/src/app/modules/hal/resources/work-package-resource.ts

@ -270,6 +270,9 @@ export class WorkPackageBaseResource extends HalResource {
this.form = Promise.resolve(form);
this.$source.id = 'new';
// Ensure type is set to identify the resource
this._type = 'WorkPackage';
// Since the ID will change upon saving, keep track of the WP
// with the actual creation date
this.__initialized_at = Date.now();

Loading…
Cancel
Save