Allow corrections to fields and additions to empty fields#353
Allow corrections to fields and additions to empty fields#353tijmenbaarda wants to merge 23 commits into
Conversation
There was a problem hiding this comment.
Good work! I'm mostly happy with this.
The one thing I find a bit counter-intuitive, when trying out the changes locally, is the way in which the pencil and addition buttons are placed. The addition button is only present on unset fields, while I would argue that it belongs on all fields, since a record might for example have multiple contributors. The pencil icon is only present on original text and not on corrections. The corrections can still be edited by clicking on them, but this is a difference with original text that I don't think users will naturally understand. They might get the impression that a correction is set in stone once made.
If this is tricky to address, you have my blessing to postpone it to a new issue so that Jeroen can get started annotating.
Edit: definitely postpone addressing the above point. See my recent comment in #293 on what I think should be done about this.
Other than that, I have some code comments. Do with them what you want. The only thing I insist you address is the hanging "if".
| } else if (_.isArray(value)) { | ||
| // Field is repeated: concatenate all values | ||
| return _.map(value, (value) => getMainDisplayOfFieldValue(value, this, annotations)).join(' ; '); | ||
| } else { | ||
| return getMainDisplayOfFieldValue(value, this, annotations); | ||
| } |
There was a problem hiding this comment.
You don't really need the elses here because every branch returns immediately. I won't insist that you need to remove them, though.
|
@tijmenbaarda I have done the following so I could already deploy this feature to production:
Once you finalize this branch, you can normalize the situation again with the following steps:
|
Co-authored-by: Julian Gonggrijp <j.gonggrijp@uu.nl>
Co-authored-by: Julian Gonggrijp <j.gonggrijp@uu.nl>
Co-authored-by: Julian Gonggrijp <j.gonggrijp@uu.nl>
This PR allows making corrections to existing fields and additions to empty fields, instead of comments on fields. The corrections and additions are also shown in the table and are used for filtering and sorting.
I also made some alterations to make it possible to save annotations by pressing return and dismiss the annotation editor as well as the modal with the escape key.