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: Persist Book IDs Across Add Book Dialogs for Regular Users #10195

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SharkyBytes
Copy link
Contributor

Closes #10148 - "Added Book IDs on new books aren't set"

Fix: This PR ensures that the "Internet Archive ID" field in the "Add Book" dialog is correctly persisted across different stages for regular users.

Technical

->Fixed the issue where the "Internet Archive ID" field would not retain its value for regular users after switching steps in the "Add Book" form.
->Ensured that the value entered in the "Internet Archive ID" field is preserved when moving between steps in both admin and user portals.

Testing

Tested locally by logging in as both an admin and a regular user.

Screenshot

image
image

Stakeholders

I have worked on this issue with @scottbarnes as lead

@scottbarnes
Copy link
Collaborator

scottbarnes commented Dec 25, 2024

Thanks for this, @SharkyBytes. This is a good start. I am not sure of the reason why adding Internet Archive identifiers was limited to admins, but appears intentional, so I will try to find out the rationale. Then, if it makes sense to change, we can work on that part.

Additionally, there is an issue with selections being cleared when the validation format is incorrect. I believe that is what is causing the behavior that was originally reported in #10148. That behavior may need some reconsideration.

It may just be that these lines need to go:

else {
document.getElementById('id_name').value = '';
}

The wiki has a section on Building CSS and JS that would help here.

I also left some comments in #10148 that may be worth a look.

@SharkyBytes
Copy link
Contributor Author

Hi @scottbarnes ,

I’ve raised the issue as #10203 regarding the behavior where the ID selections in the Add-Book form are cleared upon entering an ID number (this occurs even for valid IDs). I’ve mentioned you in the issue for reference, and I believe this is directly related to the concern from #10148.

I will raise a PR for this as soon as possible. Could you please take this as a lead? Thanks for your help on this!

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 17.44%. Comparing base (3025f5d) to head (ec086d4).
Report is 62 commits behind head on master.

Files with missing lines Patch % Lines
openlibrary/plugins/openlibrary/js/add-book.js 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10195      +/-   ##
==========================================
- Coverage   17.44%   17.44%   -0.01%     
==========================================
  Files          89       89              
  Lines        4792     4793       +1     
  Branches      848      849       +1     
==========================================
  Hits          836      836              
  Misses       3436     3436              
- Partials      520      521       +1     

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

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.

Added Book IDs on new books aren't set
3 participants