When merging works, display author names
Proposal
The view for merging works currently only displays the OL…A identifiers of works’ authors. I propose also displaying the name of each author.
Justification
It is hard to tell if the selected works are true duplicates. Because the OL…A identifiers are hard to visually parse, I cannot easily tell if there are works with the same title but a different author.
Also, if some of the works have different authors, the current merge view makes it impossible to tell if those authors are actually different or if it is a case of duplicate author records (i.e. same author name, but different OL…A identifier).
The proposed change would allow me to merge works quicker and without having to click through to author pages.
Breakdown
Requirements Checklist
- [ ] Update https://github.com/internetarchive/openlibrary/blob/9641c21c548b588a8230ea19c25cc32c6ffc38cd/openlibrary/components/MergeUI/utils.js to have a new method,
get_author_names(works: object[]) -> Promise<Record<str, object>>- [ ] This method takes all the author keys out of the work (use lodash's
uniqandflatMapmethods). They are located at.authors[].author.key(sample work) - [ ] makes a call to
/search/authors.jsonwith all the authors, egkey:(/authors/OL123A OR /authors/OL453A OR ...). Example: https://openlibrary.org/search/authors.json?q=key%3A(%2Fauthors%2FOL29079A%20OR%20/authors/OL53264A)&mode=everything&fields=key,name,birth_date,death_date - [ ] Returns an object that maps the author key to the document returned by the search response
- [ ] This method takes all the author keys out of the work (use lodash's
- [ ] In https://github.com/internetarchive/openlibrary/blob/32bb0bf5dcbb4d2a9d2d7dc86f01c66ad2c0c013/openlibrary/components/MergeUI/MergeTable.vue
- [ ] Create a new
asyncComputed,augmentedRecords, that makes a copy ofthis.records(use_.cloneDeep), fetches the author data with the above method, and adds thenamefield to the author object in the copies. (The copy is needed to avoid accidentally saving this data back into open library). - [ ] Update the template to use the
augmentedRecordswhen it's displaying the records.
- [ ] Create a new
That should largely do it!
For development/testing: Start the vue serve for live reloading
npm install --no-audit
npm run serve --component=MergeUI
And then go to eg http://localhost:8080/static/components/?records=OL1233242W,OL12312W
Instructions for Contributors
Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
It is hard to tell if the selected works are true duplicates. […] I cannot easily tell if there are works with the same title but a different author.
Just a note that works with the same title and same author might still not be true duplicates. :)
Other than that, I’m all for displaying more information when merging!
I've updated the issue with steps/instructions, so this should now be a good first issue if someone is interested in tackling it! Help wanted! :)
@cdrini I'm interested in taking this one if it's still available.
Hi @DanielleInkster it is! Assigning it to you, let us know if you have any questions!
@cdrini - My PR is up. I highlighted two sections I was unsure of in my PR request. I noticed there is another PR above. Has this been reassigned?
Wonderful! Responded/closed the other PR, and we should be able to review your PR within the week or so!
is this issue still open? If Yes, can u assign it to me?
@DipeshK47 It’s still open, but there’s an open PR for it by the currently assigned person.