-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
editoast, front : fix step update erasing parts of the study in studies page #10382
Conversation
…partial erasure Signed-off-by: Alice Khoudli <[email protected]>
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #10382 +/- ##
==========================================
+ Coverage 81.65% 81.78% +0.12%
==========================================
Files 1066 1073 +7
Lines 105692 106565 +873
Branches 727 731 +4
==========================================
+ Hits 86302 87149 +847
- Misses 19349 19377 +28
+ Partials 41 39 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement for editoast
form's. We should actually bring that to other forms now that we know 😄.
I actually tested a PUT
on /studies
with {"description":"something"}
, then with {"study_type":"something"}
(checking that description
has not been erased in the process) and it works well. Then finally with {"description":null}
which works also as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
That's actually quite a lot of them 😨 I came to really dislike the |
We could definitely set the real end date to null if the status is set to anything but ended, but I wanted to keep to the letter of the issue, which stated "The dates should not change, except the REAL END date that sould follow today's date when Status is set to Ended". I don't have a strong opinion on the subject though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM & tested ✅
I'm ok with the current behaviour, but I don't have a strong opinon on this too
Signed-off-by: Alice Khoudli <[email protected]>
… as finished in study page Signed-off-by: Alice Khoudli <[email protected]>
…ject using serde with double option Signed-off-by: Alice Khoudli <[email protected]>
0cf05aa
to
071f721
Compare
Close #6455
I believe the issue came from the fact editoast does not properly handles a partial studyForm, as the attributes are nullable and editoast does not seem to distinguish between an undefined attribute and a null one. The study changeset is indeed option<option>, but the studyForm is simply option. I am unsure if we can handle this better, considering the limitations of open api and type conversions between js and rust.
In the meantime, we now send the full study everytime.
Also fix a couple inconsistent translations in study dates
Edit : patches now properly handled in editoast thanks to serde with double option, we only send partial study patches again