-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Clean up and rename computed variables #10307
Clean up and rename computed variables #10307
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10307 +/- ##
==========================================
- Coverage 17.31% 17.27% -0.04%
==========================================
Files 87 87
Lines 4835 4845 +10
Branches 856 860 +4
==========================================
Hits 837 837
- Misses 3471 3477 +6
- Partials 527 531 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Awesome, thanks for tackling @schu96 !! I think we can do a bit more to making this component less aware of the isEdition
logic; by making it less tightly coupled to this notion, we should be able to DRY up a few of these methods, since there are a number of shared patterns. A few spots of feedback for you! Let me know if you have any questions 😊
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.
Niiice this is cleaning up very nicely! A few last spots to tighten up the screws!
38de33a
to
f11f351
Compare
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.
Lgtm! Tested various pieces:
- Adding multiple IDs to works/edition
- Adding IDs to authors
- Removing IDs
Everything worked like a charm!
Closes #10301
Refactor
Technical
Remove computed
isEdition
variable and usesaveIdentifiersAsList
to ensure component still functions properly when saving Author identifiers vs Edition/Work identifiers.Removes props initially used to create an ordered dropdown list for identifiers, add a popular identifier list within the IdentifiersInput.vue for easier future maintenance.
Testing
Run
docker compose up -d
and thendocker-compose run --rm home npx vue-cli-service build --watch --no-clean --mode production --dest static/build/components/production --target wc --name ol-IdentifiersInput openlibrary/components/IdentifiersInput.vue
Sign in using the OpenLibrary dev account or as a patron
Navigate to an edition and click on the edit button. Click on the identifiers component and check that the identifiers dropdown list contains two sets of identifiers separated by a non-selectable option with three dashes.
Within the same edit page, select the Work Details tab. Click on the identifiers component and verify that the work identifiers dropdown list contains only one set of identifiers without the three dashes option.
Navigate to an author page and click on the edit button. The dropdown list should also have one set of identifiers without the three dashes option.
Screenshot
Editions dropdown
Work dropdown
Author dropdown
Stakeholders
@cdrini