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

DDFBRA-183 - Anonymous and logged in user can try ebook + audiobook #1779

Conversation

kasperbirch1
Copy link
Contributor

@kasperbirch1 kasperbirch1 commented Nov 20, 2024

Link to issue

https://reload.atlassian.net/browse/DDFBRA-183
https://reload.atlassian.net/browse/DDFBRA-184

Description

This pull request adds translations for Reader link as part of the updates introduced in dpl-react/pull/1555.

During the work on dpl-react/pull/1555, we discovered that rendering Reader within a modal, as originally planned, was not feasible. As a result, Reader has been refactored into a standalone application instead of a component within the material app.

In the material app, navigating to “/reader” now triggers a page transition, with either identifier or orderId passed along as parameters.

Test

https://varnish.pr-1779.dpl-cms.dplplat01.dpl.reload.dk/work/work-of:870970-basis:136089471?type=tegneserie+%28online%29

Additionally, this implementation facilitates testing of the updated functionality.

@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from da39c1e to cd45554 Compare November 20, 2024 12:36
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from 10b79f5 to 6a0834f Compare November 22, 2024 13:04
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from 8f4ebba to f1da091 Compare November 26, 2024 13:21
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from f1da091 to 0e6b2d6 Compare November 26, 2024 16:30
@kasperbirch1 kasperbirch1 changed the title DDFBRA-183 - Anonymous and logged in user can try ebook DDFBRA-183 - Anonymous and logged in user can try ebook + audiobook Nov 26, 2024
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from 0e6b2d6 to d6c7f10 Compare November 26, 2024 16:34
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from 7c4f93e to 314697e Compare November 27, 2024 13:29
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from 314697e to 5c811e1 Compare December 3, 2024 10:52
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from 5c811e1 to 273fe23 Compare December 3, 2024 15:15
Copy link
Contributor

@kasperg kasperg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice start, but I think this needs some more consideration.

@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from 23a70d9 to c57ef2d Compare December 6, 2024 10:42
@kasperbirch1 kasperbirch1 requested a review from kasperg December 6, 2024 10:48
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from c57ef2d to 6ea1d6c Compare December 6, 2024 11:02
@kasperbirch1 kasperbirch1 added the jira-testable ready for DDF test, and moved in Jira label Dec 6, 2024
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from 6ea1d6c to 8644ba4 Compare December 12, 2024 10:11
@kasperbirch1 kasperbirch1 changed the base branch from develop to reader-player-feature December 12, 2024 10:13
The `/reader` route now passes either the `identifier` or `orderId` parameters to the `Reader` React app.

This was implemented to ensure the proper loading of external scripts that require a full page reload.
These translations are related to the implementation of the `Player` feature in PR:

danskernesdigitalebibliotek/dpl-react#1562
This caused issues when passing the URL parameter from Drupal into the `Reader` app.

Additionally, I have set the default value of `orderid` to an empty string, similar to how `identifier` is handled.
The `reader-modal-description-text` is no longer utilized.
- Removed unnecessary comments
- Removed redundant div wrapper.
- Removed the `{{ drupal_block('system_messages_block') }}`. as it not needed here
Remove the unnecessary inclusion of the `Reader` react app within a Block.

Instead, render the `Reader` app at the `/reader` route, with the identifier or order ID as optional parameters.

The app will be rendered using the `page--reader.html.twig` template, which does not include a header or footer.
Using `BadRequestHttpException` results in an HTTP 400 error response, which correctly signals a client error, making the API behavior more RESTful and easier to debug for clients.
@kasperbirch1 kasperbirch1 force-pushed the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch from 8644ba4 to 8b80f8f Compare December 12, 2024 10:16
@kasperbirch1 kasperbirch1 merged commit 04b75ef into reader-player-feature Dec 12, 2024
19 checks passed
@kasperbirch1 kasperbirch1 deleted the DDFBRA-183-anonymous-and-logged-in-user-can-try-ebook branch December 12, 2024 14:38
@kasperbirch1 kasperbirch1 mentioned this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-testable ready for DDF test, and moved in Jira
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants