Fixed issue with author name display in merge view #9913
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #9811
This PR addresses an issue where the merge view for works in OpenLibrary only displays the OL...A identifiers of authors. It now updates the view to display both the author names (and the OL in the tooltips)...Displaying the author’s name instead of the OL identifier makes it easier to distinguish between works by different authors or detect duplicate authors.
Technical
Updated
utils.js
:get_author_names(works)
function. This function extracts the unique author keys from the works, makes a call to fetch the authors' details via the/search/authors.json
endpoint, and returns an object mapping author keys to their corresponding name and other metadata.Updated
MergeTable.vue
:augmentedRecords
asynchronous computed property. It clones the records, fetches the author names using theget_author_names
function, and augments the author objects in the records with the retrieved names to avoid modifying the original records.augmentedRecords
instead ofrecords
to ensure the author names are displayed alongside the OL...A identifiers.merge
method to use theaugmentedRecords
to merge the works.Updated
AuthorRoleTable.vue
:Testing
To verify these changes:
npm run serve --component=MergeUI
.Screenshot
Stakeholders
@cdrini