openreview / openreview-web

The official web interface for OpenReview.net
https://openreview.net
GNU Affero General Public License v3.0
14 stars 2 forks source link

Note Editor: support 'hidden' property for more fields #299

Closed melisabok closed 3 years ago

melisabok commented 4 years ago

Support new property hidden at the same level of order or required to specify if the UI should hide the field in the note editor.

This property should be restricted to field that contain values that can not be changed by the user, for example: values, value, values-copied.

melisabok commented 4 years ago

I remember this is working for 'authors' only. We should do it for any field the invitation.reply says hidden:true

carlosmondra commented 4 years ago

@melisabok, @zbialecki, @xkopenreview I think this requires more changes in the front end since I believe that openreview/openreview#2027 did the required part in the backend. Let me know if you want me to do it though

zbialecki commented 3 years ago

This is currently working for fields of type values, but not value or values-copied.

melisabok commented 3 years ago

I'm increasing the priority of this issue, I need it to hide more fields in the paper assignment configuration note, I would like to remove this:

    view.hideNoteEditorFields('#note-editor-modal', [
      'config_invitation', 'assignment_invitation', 'error_message', 'status',
    ])

https://github.com/openreview/openreview-web/blob/master/pages/assignments/index.js#L168

xkopenreview commented 3 years ago

@melisabok do you know any existing invitation which has this hidden property?

melisabok commented 3 years ago

Yes, currently the submission invitation is hiding the author field: https://openreview.net/invitation?id=ICLR.cc/2021/Conference/-/Submission&mode=edit

 "authors": {
            "description": "Comma separated list of author names.",
            "order": 2,
            "values-regex": "[^;,\\n]+(,[^,\\n]+)*",
            "required": true,
            "hidden": true
        }

there is an special case in the UI to hide this specific field but I would like to hide any other fields that contain the property hidden: true

zbialecki commented 3 years ago

It doesn't make sense to me to enable this for all fields, it should just be for fields with type value, values or values-copied. Otherwise how would you be able to submit the note editor form?

melisabok commented 3 years ago

Yes, you are right, we should do it for value, values or values-copied but this validation should be done in the backend when the invitation is posted. The UI shouldn't worry about this, if the field definition says hidden:true then the widget representing the field should not be visible.

xkopenreview commented 3 years ago

the effect of

  1. setting hidden = true in invitation for a field and
  2. adding a field in view.hideNoteEditorFields()

is not exactly the same.

when a field is hidden via view.hideNoteEditorFields() its content is still collected during form submission. if a field is set to be hidden in invitation, the value of the field is always ignored no matter of its visibility.