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

Clean up and rename computed variables #10307

Conversation

schu96
Copy link
Contributor

@schu96 schu96 commented Jan 9, 2025

Closes #10301

Refactor

Technical

Remove computed isEdition variable and use saveIdentifiersAsList 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 then docker-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

image
Work dropdown

image
Author dropdown

image

Stakeholders

@cdrini

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 17.27%. Comparing base (606faaf) to head (2e231fa).
Report is 520 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@cdrini cdrini left a 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 😊

@cdrini cdrini self-assigned this Jan 10, 2025
@cdrini cdrini added the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Jan 10, 2025
@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Jan 11, 2025
@schu96 schu96 changed the title Clean up computed variables and move popular identifier logic Clean up and rename computed variables Jan 13, 2025
@schu96 schu96 requested a review from cdrini January 15, 2025 20:58
Copy link
Collaborator

@cdrini cdrini left a 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!

@cdrini cdrini added the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Feb 18, 2025
@schu96 schu96 force-pushed the 10301/refactor/remove-isEdition-references branch from 38de33a to f11f351 Compare February 25, 2025 17:09
@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Feb 25, 2025
Copy link
Collaborator

@cdrini cdrini left a 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!

@cdrini cdrini merged commit f09080a into internetarchive:master Mar 10, 2025
5 checks passed
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.

Refactor IdentifiersInput Vue component to not need isEdition checks
3 participants