grand-challenge.org icon indicating copy to clipboard operation
grand-challenge.org copied to clipboard

Support all interface types in display set UI

Open MikeOverkamp-diag opened this issue 1 year ago • 11 comments

Closes https://github.com/DIAGNijmegen/rse-grand-challenge-admin/issues/50, closes https://github.com/DIAGNijmegen/rse-grand-challenge-admin/issues/12, closes https://github.com/comic/grand-challenge.org/issues/2553

This PR implements all changes for https://github.com/DIAGNijmegen/rse-roadmap/issues/159

  • It adds a create view for a single display set
  • It fixes the widget for json type interface values that are stored as a file
  • It adds the option to upload a new file/image for an interface in the display set update view
  • It adds the option to add a new interface to a display set via the update view

Peek 2022-07-11 13-23

MikeOverkamp-diag avatar Jul 10 '22 08:07 MikeOverkamp-diag

Codecov Report

Merging #2575 (15fbd08) into main (011d2d9) will increase coverage by 0.06%. The diff coverage is 94.23%.

@@            Coverage Diff             @@
##             main    #2575      +/-   ##
==========================================
+ Coverage   93.84%   93.90%   +0.06%     
==========================================
  Files         844      846       +2     
  Lines       31564    32056     +492     
==========================================
+ Hits        29621    30102     +481     
- Misses       1943     1954      +11     
Impacted Files Coverage Δ
app/grandchallenge/algorithms/forms.py 88.08% <ø> (ø)
app/grandchallenge/archives/forms.py 98.78% <ø> (ø)
app/grandchallenge/reader_studies/urls.py 100.00% <ø> (ø)
app/tests/cases_tests/test_forms.py 100.00% <ø> (ø)
app/grandchallenge/components/models.py 92.35% <80.85%> (+2.06%) :arrow_up:
app/grandchallenge/components/form_fields.py 95.00% <85.71%> (-0.13%) :arrow_down:
app/grandchallenge/reader_studies/views.py 90.43% <88.55%> (-0.43%) :arrow_down:
...cations/migrations/0004_alter_notification_type.py 100.00% <100.00%> (ø)
app/grandchallenge/notifications/models.py 98.41% <100.00%> (+0.89%) :arrow_up:
app/grandchallenge/reader_studies/forms.py 97.51% <100.00%> (+0.98%) :arrow_up:
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Jul 10 '22 10:07 codecov[bot]

I think it is getting slower because we initialize all the forms in the list view on load. I'll have a look at that after i finish the create view and after I process the other comments on this one.

MikeOverkamp-diag avatar Jul 13 '22 13:07 MikeOverkamp-diag

I removed the check that loads all forms when the list view loads. I understand the rationale behind it, but IMO it is not worth the hit on loading times.

MikeOverkamp-diag avatar Jul 14 '22 09:07 MikeOverkamp-diag

Also it appears that updating a display set with a json file (json type but not stored in database) does not work. The DisplaySetUpdate view tries to save the file as a value (see form_valid() on L1414 in this PR, can't seem to comment there directly).

amickan avatar Jul 15 '22 09:07 amickan

@jmsmkn I reverted the changes to the is_file_kind and is_json_kind methods, but I think we need to keep the changes made to the form_fields and the additional line for allowed mimetypes. We could get rid of the form_fields changes only if we add the interface instance or the store_in_database property, as it is a class method that has no knowledge of the instance.

MikeOverkamp-diag avatar Jul 19 '22 13:07 MikeOverkamp-diag

@jmsmkn I reverted the changes to the is_file_kind and is_json_kind methods, but I think we need to keep the changes made to the form_fields and the additional line for allowed mimetypes. We could get rid of the form_fields changes only if we add the interface instance or the store_in_database property, as it is a class method that has no knowledge of the instance.

If the default widget is a property of the instance and not of a class why wouldn't the classmethod be changed to an instance method?

jmsmkn avatar Jul 20 '22 07:07 jmsmkn

Good point! I'll change it.

MikeOverkamp-diag avatar Jul 20 '22 07:07 MikeOverkamp-diag

It looks like something goes wrong when adding a json file for interface Multiple 2D bounding boxes, the value never gets added and the interface is also not added to the case. There is no error shown. I tested with a json file with invalid content, no error is shown to the user.

When uploading a json file for interface Multiple 2D bounding boxes, the help text below the upload widget says: "The following file formats are supported: .m2db". Which should be ".json".

miriam-groeneveld avatar Jul 21 '22 15:07 miriam-groeneveld

It looks like something goes wrong when adding a json file for interface Multiple 2D bounding boxes, the value never gets added and the interface is also not added to the case. There is no error shown. I tested with a json file with invalid content, no error is shown to the user.

When uploading a json file for interface Multiple 2D bounding boxes, the help text below the upload widget says: "The following file formats are supported: .m2db". Which should be ".json".

Where did you test this and was it on the latest commit?

MikeOverkamp-diag avatar Jul 21 '22 16:07 MikeOverkamp-diag

Ah, I can reproduce this. The error message gets too long for the notification message field. I'll also check the help text.

MikeOverkamp-diag avatar Jul 21 '22 16:07 MikeOverkamp-diag

It is now fixed. You get any validation errors for your files via a notification.

MikeOverkamp-diag avatar Jul 21 '22 16:07 MikeOverkamp-diag