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

Release 2025.10.0 #1728

Merged
merged 76 commits into from
Mar 4, 2025
Merged

Release 2025.10.0 #1728

merged 76 commits into from
Mar 4, 2025

Conversation

kasperg
Copy link
Contributor

@kasperg kasperg commented Mar 4, 2025

No description provided.

`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.
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.
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.
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.
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.
There was an issue where the modal ID was not removed from the URL or cleared from the Redux state. This happened because the check for rendering `DeleteReservationModal` in `material` was based on the presence of actual reservations. However, when a reservation was deleted, this check returned false, causing the modal to close prematurely.

As a result, the modal closed before reaching its final state with the "OK" button, which is responsible for closing the modal and removing it from Redux and the URL. Consequently, this process was never executed.

To resolve this, I introduced a `reservationToDelete` state, similar to the approach used in `src/apps/reservation-list/list/reservation-list.tsx`. This ensures that the modal remains open until the user clicks "OK," properly triggering the cleanup process.

While I am not entirely satisfied with this solution due to the prop drilling involved, it resolves the issue for now.
…neInternal`

This refactor removes unnecessary prop drilling mentioned in the previous commit.
- Change "Go to material" to "View material"
- Remove unnecessary extra "Modal" in variable names
Added a custom hook called `useOnlineInternalHandleLoanReservation` to improve the readability of `MaterialButtonsOnlineInternal`.
Introduced `loanResponse` state to access `expirationDate` from the loan response.
- Removed comment as it is now possible to make a reservation without a phone number.
Introduce a new state to avoid using `setReservationStatus` for both loans and reservations.
…s `first()`

Test with `/work/work-of:300756-katalog:107708154?type=lydbog+%28online%29`
There is some mismatch in `useOnlineAvailabilityData` `loanStatus`s for online materials. The Publizon documentation, and generated types are not aligned. I suspect that our availability labels are not working perfectly. Therefore, I now use `useGetV1LoanstatusIdentifier` directly instead and added a `getLoanStatus` helper function to translate the loan statuses.

- Added invalidateQueries for `getGetV1LoanstatusIdentifierQueryKey` after reservations, loans, and deletions of reservations to ensure that `MaterialButtonsOnlineInternal` is updated.
- Added the missing "isAlreadyReserved" button for renderPlayerButton.

In OnlineInternalModalBody, I moved the reservationStatus === "idle" || loanStatus === "idle" state to the bottom to ensure the correct rendering.

There is still more feature work to do to combine `publizonProductStatuses` and `getLoanStatus`. But this works for now
kasperbirch1 and others added 29 commits February 28, 2025 15:23
… of `useReaderPlayer`

No need to initialize the entire hook just to retrieve the type.
…pa-tv-serier-skal-saeson-nummer-vises

DDFBRA-415 - Ensure tvSeries titles are shown with season
Bumps the storybook group with 2 updates: [@storybook/react-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-webpack5) and [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli).


Updates `@storybook/react-webpack5` from 8.5.8 to 8.6.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.6.3/code/frameworks/react-webpack5)

Updates `storybook` from 8.5.8 to 8.6.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v8.6.3/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.6.3/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/react-webpack5"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps the cypress group with 1 update: [@cypress/code-coverage](https://github.com/cypress-io/code-coverage).


Updates `@cypress/code-coverage` from 3.13.11 to 3.13.12
- [Release notes](https://github.com/cypress-io/code-coverage/releases)
- [Changelog](https://github.com/cypress-io/code-coverage/blob/master/.releaserc)
- [Commits](cypress-io/code-coverage@v3.13.11...v3.13.12)

---
updated-dependencies:
- dependency-name: "@cypress/code-coverage"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: cypress
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [caniuse-lite](https://github.com/browserslist/caniuse-lite) from 1.0.30001700 to 1.0.30001701.
- [Commits](browserslist/caniuse-lite@1.0.30001700...1.0.30001701)

---
updated-dependencies:
- dependency-name: caniuse-lite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [@chromatic-com/storybook](https://github.com/chromaui/addon-visual-tests) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/chromaui/addon-visual-tests/releases)
- [Changelog](https://github.com/chromaui/addon-visual-tests/blob/main/CHANGELOG.md)
- [Commits](chromaui/addon-visual-tests@v3.2.4...v3.2.5)

---
updated-dependencies:
- dependency-name: "@chromatic-com/storybook"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.40.0 to 3.41.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/commits/v3.41.0/packages/core-js)

---
updated-dependencies:
- dependency-name: core-js
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [sass](https://github.com/sass/dart-sass) from 1.85.0 to 1.85.1.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.85.0...1.85.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [@vitest/coverage-istanbul](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-istanbul) from 3.0.6 to 3.0.7.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v3.0.7/packages/coverage-istanbul)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-istanbul"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [happy-dom](https://github.com/capricorn86/happy-dom) from 17.1.4 to 17.1.8.
- [Release notes](https://github.com/capricorn86/happy-dom/releases)
- [Commits](capricorn86/happy-dom@v17.1.4...v17.1.8)

---
updated-dependencies:
- dependency-name: happy-dom
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…npm_and_yarn/storybook-45f6d32978

build(deps-dev): bump the storybook group with 2 updates
…npm_and_yarn/cypress-5696087807

build(deps-dev): bump @cypress/code-coverage from 3.13.11 to 3.13.12 in the cypress group
…npm_and_yarn/caniuse-lite-1.0.30001701

build(deps-dev): bump caniuse-lite from 1.0.30001700 to 1.0.30001701
…npm_and_yarn/chromatic-com/storybook-3.2.5

build(deps-dev): bump @chromatic-com/storybook from 3.2.4 to 3.2.5
…npm_and_yarn/core-js-3.41.0

build(deps-dev): bump core-js from 3.40.0 to 3.41.0
…npm_and_yarn/sass-1.85.1

build(deps-dev): bump sass from 1.85.0 to 1.85.1
…npm_and_yarn/vitest/coverage-istanbul-3.0.7

build(deps-dev): bump @vitest/coverage-istanbul from 3.0.6 to 3.0.7
…npm_and_yarn/happy-dom-17.1.8

build(deps-dev): bump happy-dom from 17.1.4 to 17.1.8
lts/iron is the latest released version of Node 20 which has long
term support.

This should ensure that we get the most recent version of the major
release we are currently using. Rolling updates within this should be
safe to do as long a we stay within the major version. We expect any
errors to be caught build time.

At this point we need Node 20.10 or newer for babel-loader 10.
Switch to Node 20 Iron LTS instead of specific version
Bumps [babel-loader](https://github.com/babel/babel-loader) from 9.2.1 to 10.0.0.
- [Release notes](https://github.com/babel/babel-loader/releases)
- [Changelog](https://github.com/babel/babel-loader/blob/main/CHANGELOG.md)
- [Commits](babel/babel-loader@v9.2.1...v10.0.0)

---
updated-dependencies:
- dependency-name: babel-loader
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
…npm_and_yarn/babel-loader-10.0.0

build(deps-dev): bump babel-loader from 9.2.1 to 10.0.0
…handle-ts-error

Handle TS error differently
We have decided on the Brahma team to disable the eslint rule, as it is very much an edge case to have a display name for higher order components when using React Developer Tools.
It would not be worth it to rewrite existing higher order components or having it required for any future ones.
…disable-display-name-lint

Disable `react/display-name` eslint rule
…em-2025.10.0

Use release 2025.10.0 of design system
@kasperg kasperg merged commit d5fce5f into main Mar 4, 2025
24 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.

3 participants