Fix Magic Select binding for Editions DataTable#9888
Merged
mekarpeles merged 2 commits intointernetarchive:masterfrom Apr 15, 2025
Merged
Fix Magic Select binding for Editions DataTable#9888mekarpeles merged 2 commits intointernetarchive:masterfrom
mekarpeles merged 2 commits intointernetarchive:masterfrom
Conversation
Member
|
@schu96 this looks like good to me, just needs a rebase please! |
f816e52 to
d6e9d58
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9888 +/- ##
==========================================
- Coverage 17.50% 17.43% -0.07%
==========================================
Files 87 87
Lines 4793 4811 +18
Branches 852 859 +7
==========================================
Hits 839 839
- Misses 3432 3444 +12
- Partials 522 528 +6 ☔ View full report in Codecov by Sentry. |
Merged
Amara777
pushed a commit
to Amara777/openlibrary
that referenced
this pull request
Apr 23, 2025
* Change initialization order of ILE and editions datatable for magic select * Fix edge case for magic select interaction with edition table
jimchamp
reviewed
Jan 16, 2026
Comment on lines
+326
to
+335
| // Import ile then the datatable to apply clickable classes to all listed editions | ||
| if (document.getElementsByClassName('editions-table--progressively-enhanced').length) { | ||
| import(/* webpackChunkName: "editions-table" */ './editions-table') | ||
| .then(module => module.initEditionsTable()) | ||
| } | ||
| } | ||
| // conditionally load functionality based on what's in the page | ||
| if (document.getElementsByClassName('editions-table--progressively-enhanced').length) { | ||
| import(/* webpackChunkName: "editions-table" */ './editions-table') | ||
| .then(module => module.initEditionsTable()); |
Collaborator
There was a problem hiding this comment.
Why is the table being initialized twice?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #9853 Task 5
Fix
Technical
Initializes the ILE/SelectionManager classes before the Editions DataTable to allow the ILE to bind the click events and add class names to the relevant DOM elements.
Prevents the Editions DataTable from re-initialization with .isDataTable method.
Utilizes the
drawCallbackoption for DataTables to remove visual inconsistencies when a user selects editions from multiple pages, clicks on clear selection, and re-navigates to a page that had a previously selected edition by checking the sessionStorage object.Testing
Sign in with the admin account and navigate to a work that has >3 editions (the more the better).
Verify that the magic select editions beyond the first page of the Editions Table.
Press the
Clear Selectionbutton within the magic select toolbar on the bottom of the page.Navigate back to the pages where the editions were previously selected. The magic select classes and styling should not be present anymore.
Screenshot
2024-09-18.12-05-56.mp4
Stakeholders
@cdrini