-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use IdentifiersInput Vue component for work identifier UI #10032
base: master
Are you sure you want to change the base?
Use IdentifiersInput Vue component for work identifier UI #10032
Conversation
Cleaning up and resolving merge conflicts
05db8f5
to
807342f
Compare
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10032 +/- ##
==========================================
+ Coverage 17.12% 17.44% +0.31%
==========================================
Files 89 89
Lines 4752 4792 +40
Branches 831 848 +17
==========================================
+ Hits 814 836 +22
- Misses 3428 3436 +8
- Partials 510 520 +10 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @schu96 !! Great work stitching together the data from all the different places. Librarians have been asking for this feature for quite a while 😊
One question on if we can DRY the python method, one small fix which I'll apply through github; otherwise looks great!
get_work_config().identifiers, names, self.identifiers | ||
) | ||
|
||
def _process_identifiers(self, config_, names, values): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method the same for editions? If so I think we might want to create a helper method at the bottom of this file that both classes call, to avoid duplicating the code, if possible!
<div id="hiddenWorkIdentifiers"></div> | ||
<div id="identifiers-display-works"> | ||
$ admin = str(ctx.user.is_admin() or ctx.user.is_super_librarian()) | ||
$:render_component('IdentifiersInput', attrs=dict(assigned_ids_string=work.get_identifiers().values(), output_selector='#hiddenWorkIdentifiers', id_config_string=work_config, input_prefix='work--identifiers', admin=admin)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this should also add a list of identifiers, like editions; I noticed it saved a single string value:
https://openlibrary.org/works/OL1063588W/Les_Mis%C3%A9rables?_compare=Compare&b=28&a=27&m=diff
Partially addresses #3430
Feature
Technical
DRY implementation of work identifiers but currently unable to save the changes made by users into Solr.
The work identifiers currently displayed in this component are based off of this list: https://openlibrary.org/config/work
Testing
Navigate to a work/book and click on the edit button
Switch from the edition edit tab to the
Work Details
edit tabScroll to Work Identifiers section and add/remove work identifiers.
After adding new work identifiers, save the changes and return to the editing page -> Work Details tab to check that the newly added work identifiers are still present.
Stakeholders
@cdrini