Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with author name display in merge view #9913

Closed
wants to merge 2 commits into from

Conversation

d-dovale
Copy link

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:

    • Created a new 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:

    • Created an augmentedRecords asynchronous computed property. It clones the records, fetches the author names using the get_author_names function, and augments the author objects in the records with the retrieved names to avoid modifying the original records.
    • Updated the template to render augmentedRecords instead of records to ensure the author names are displayed alongside the OL...A identifiers.
    • Updated the merge method to use the augmentedRecords to merge the works.
  • Updated AuthorRoleTable.vue:

    • Enhanced the rendering logic to display both the author name and the OLID. If the author’s name is available, it will show the name along with the OLID in a link. If no name is available, it defaults to displaying just the OLID.

Testing


To verify these changes:

  1. Serve the application using npm run serve --component=MergeUI.
  2. Navigate to the merge view (e.g., http://localhost:8080/static/components/?records=OL1233242W,OL12312W).
  3. Ensure that the merge view now displays the author names next to the OLIDs.
  4. Verify that the merging functionality works as expected and does not introduce any errors.

Screenshot


Screenshot_1

Stakeholders

@cdrini

Updated the Merge UI to display the author name instead of the OLID. This improves user experience by making it easier to verify author information without having to navigate away from the merge view.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 17.05%. Comparing base (ce16a79) to head (9e47b46).
Report is 452 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9913      +/-   ##
==========================================
+ Coverage   16.06%   17.05%   +0.99%     
==========================================
  Files          90       89       -1     
  Lines        4769     4725      -44     
  Branches      832      829       -3     
==========================================
+ Hits          766      806      +40     
+ Misses       3480     3409      -71     
+ Partials      523      510      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cdrini
Copy link
Collaborator

cdrini commented Oct 2, 2024

Thanks @d-dovale ! Unfortunately this issue was assigned to another contributor who has opened a PR tackling it, so closing in favour of that one. Note we generally wait ~2 weeks before considering an issue potentially abandoned. For future reference, please comment on an already signed issue before tackling. But please feel free to tackle another good first issue!

@cdrini cdrini closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When merging works, display author names
3 participants