-
Notifications
You must be signed in to change notification settings - Fork 8
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
Reader player feature v2 #1665
Open
kasperbirch1
wants to merge
15
commits into
develop
Choose a base branch
from
reader-player-feature-v2
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Reader player feature v2 #1665
Conversation
This file contains 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
kasperbirch1
force-pushed
the
reader-player-feature-v2
branch
from
January 27, 2025 10:13
c53aa90
to
237178a
Compare
`useReaderPlayer`: - Refactored `useReaderPlayer` to include `useOnlineAvailabilityData` for checking material availability. - Introduced `showMaterialButton`, `showLoanButton`, and `showReserveButton` logic in `useReaderPlayer` to centralize UI behavior. - Optimize the code by removing unnecessary returns `MaterialButtonsOnlineInternal`: - Updated `MaterialButtonsOnlineInternal` to use new `showMaterialButton`, `showLoanButton`, and `showReserveButton` flags. - Integrated `usePostV1UserLoansIdentifier` and `usePostV1UserReservationsIdentifier` to enable loan and reservation actions. Next step is to ensure that the user is forced to log in when clicking on the loan button (opens modal) and dynamically adds the email and phoneNumber for reservations. Also, find out what to do when the phoneNumber is not available in the user profile data.
…OnlineInternal` - Remove unused texts
Updated the label to match the text on the main button, making it clearer that this is an e-material. Tested on mobile screens, and no display issues were found.
… modal - Implemented `OnlineInternalModal` and `OnlineInternalModalBody` to handle confirmation processes for E-loan or reservation. - Modified `MaterialButtonsOnlineInternal` to redirect unauthenticated users to the login page before rendering the modal. Additionally, added `openModal` to determine whether the buttons should open the modal or initiate a loan/reservation. - Fixed logic for determining which buttons should be displayed in `useReaderPlayer`. - Added simple success and error handling with `ModalMessage` inside `OnlineInternalModalBody`. - Refactored variable names and streamlined logic for better maintainability and clarity.
Remove "ok" button and display the `MaterialButtonsOnlineInternal` in the `ModalMessage` so users can open reader or player
If the user already has a reserved e-material, it will display a `LinkButton` that links to the user's reservation page. I had forgotten about `useLoans`, which we should definitely use here to simplify the code. I also added `useReservations` to determine the `isAlreadyReservedButtonVisible` variable.
kasperbirch1
force-pushed
the
reader-player-feature-v2
branch
3 times, most recently
from
January 28, 2025 09:00
25cade5
to
f40db66
Compare
Added a link to the material instead of a link to Erolen. Fix cypress (`useGetWorkUrlFromPublizonIdentifier`) Because I now use `useGetWorkUrlFromPublizonIdentifier` instead of `useComplexSearchWithPaginationWorkAccessQuery` inside `src/apps/reservation-list/modal/reservation-details/reservation-details.tsx`.
`MaterialButtonOnlineExternal` is no longer applied to Publizon eBooks but still supports eReolen Global (OverDrive) links.
…and improve readability
This feature is now fully integrated and should no longer be hidden.
The use of `useLoans` and `useReservations` caused unexpected behavior, where the FBS API was called, leading to Cypress test failures. I was unable to get `enabled: !isUserAnonymous` to work properly with the FBS API. However, I believe it is also preferable to call Publizon directly from `useReaderPlayer`, as FBS materials are not relevant in this context. Before this change, I temporarily fixed the Cypress test by adding fixtures for: `cy.intercept("GET", "**/external/agencyid/patrons/patronid/loans/v2", {`inside src/components/reservation/reservation.test.ts.
kasperbirch1
force-pushed
the
reader-player-feature-v2
branch
from
January 28, 2025 10:18
149851c
to
ad4428a
Compare
Instead of linking to the reservation list, it now directly opens the `DeleteReservationModal`. Known Issues: - After deleting an e-material, `&modal=undefined9788740092912` is not removed. - A bug causes `undefined` to be prefixed, affecting both this modal and the one in the reservation list.
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.
Link to issue
https://reload.atlassian.net/browse/DDFBRA-185
https://reload.atlassian.net/browse/DDFBRA-186
https://reload.atlassian.net/browse/DDFBRA-188
https://reload.atlassian.net/browse/DDFBRA-189
danskernesdigitalebibliotek/dpl-cms#2016
Description
This pull request fully integrates loan reservations and teasers for Publizon e-materials.
Changes & Features
With these changes, you can:
Button Behavior Updates
eroelen.dk
now correctly links to the respective e-material.Additionally, it enables all features that were previously hidden by the
featureFlag.isActive("readerPlayer")
check.Note: There are still links to “eReolen Global,” such as
/work/work-of:300756-katalog:107708154?type=e-bog
, which the reader/player cannot handle because it only supports "Publizon" materials and not "Overdrive" materials.Test
https://varnish.pr-2016.dpl-cms.dplplat01.dpl.reload.dk/work/work-of:870970-basis:138374319?type=lydbog+%28online%29
Almost always loaned material
https://varnish.pr-2016.dpl-cms.dplplat01.dpl.reload.dk/work/work-of:870970-basis:137757451?type=e-bog
reader-player-02.mp4