Files
openproject/lib/api
Christophe Bliard 9b657120bd Avoid sending the remainingTime in create form when status-based
In status based mode, `remainingTime` is marked as `writable: false`.
The popover edit field tries to write it, but that is ignored when
submitting the creation, and it renders nil instead. When then
submitting, this nil value will be submitted and result in the error
"Remaining work must be set when work is set".

By setting `render_nil: false` for `remainingTime` in the
`WorkPackageRepresenter`, the field is not returned back from the form
endpoint when it is not set. This way, the field is not rendered in the
form on submit, and the error is avoided.

In work-based mode, the remainingTime being not sent back by the form
anymore when it is nil means we have to deal with it being undefined,
which is why the progress popover had to be modified too.
2024-04-22 12:24:46 +02:00
..
2024-01-02 16:23:54 +01:00