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

Feature add ids to works #8346

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidscotson
Copy link
Collaborator

@davidscotson davidscotson commented Oct 1, 2023

fixes #3430 and #1797

Mostly re-using code from Edition ids and tweaking it for Works.

On top of that adds the auto detection of some ids (e.g. pasting in a wikidata or amazon id will auto-select that entry for you), similar to functionality on current Author id entry.

Also, adds the ability to paste in entire urls, which will then detect the right type of id and extract the specific id.

Note:

Displays the ids on the work/edition page though #3430 currently suggests this is optional, but I think the display is fairly inoffensive and would do for now.

Closes #3430
and
Closes #1797

Partially addresses #866 for this specific area.

feature

Technical

Requires server side set up to work, similar to the edition identifiers, it gets the list of ids to use from config stored on server, see instructions below.

Testing

You need to configure config/works with identifiers via:

/config/work.yml?m=edit

Before you can save any IDs.

Once you do you can add and remove IDs from works.

Screenshot

Screenshot 2023-10-01 at 17 00 53 Screenshot 2023-10-01 at 17 01 34

Stakeholders

@codecov-commenter
Copy link

codecov-commenter commented Oct 1, 2023

Codecov Report

Merging #8346 (d9b4059) into master (0857026) will decrease coverage by 0.09%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #8346      +/-   ##
==========================================
- Coverage   16.66%   16.58%   -0.09%     
==========================================
  Files          83       83              
  Lines        4422     4444      +22     
  Branches      757      763       +6     
==========================================
  Hits          737      737              
- Misses       3202     3218      +16     
- Partials      483      489       +6     
Files Coverage Δ
openlibrary/plugins/openlibrary/js/index.js 0.00% <0.00%> (ø)
openlibrary/plugins/openlibrary/js/edit.js 33.98% <0.00%> (-3.46%) ⬇️

@mekarpeles mekarpeles marked this pull request as draft October 2, 2023 19:42
@mekarpeles mekarpeles changed the title Draft: feature add ids to works Feature add ids to works Oct 2, 2023
@davidscotson davidscotson force-pushed the feature/1797_ids_for_works branch 4 times, most recently from 68dc489 to d9b4059 Compare October 9, 2023 10:37
fixes internetarchive#3430 and internetarchive#1797

Adds the option to add external ids (wikidata, VIAF) to works, based
on the code for editions, with minor tweaks.

Will autodetect the id type when possible, similar to functionality
in the author id entry.

Will accept urls for ids and automatically extract the id from them
based on regex sourced from wikidata.
@davidscotson
Copy link
Collaborator Author

I think the CI is currently failing due to an error from 3rd party server:

FetchError: invalid json response body at https://bundlesize-cache.vercel.app/?repo=internetarchive/openlibrary reason: Unexpected token 'A', "A server e"... is not valid JSON

@davidscotson
Copy link
Collaborator Author

I've pushed a follow up commit, where some of the improvements over editions are backported to editions. I was going to do that as a seperate commit (and still can) but:

  1. it lets me force the tests to rerun
  2. I think it might bring the code coverage back up

Will see how it goes.

@davidscotson davidscotson force-pushed the feature/1797_ids_for_works branch 2 times, most recently from 92f9c0a to ce23536 Compare November 14, 2023 16:37
@cdrini
Copy link
Collaborator

cdrini commented Nov 24, 2023

@davidscotson That error appears to be resolved on other PRs ; if you rebase off latest master that should hopefully fix it 👍

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.

Add UI for adding work IDs Option to add Wikidata IDs to works
3 participants