-
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
Introduce OpenOrder Logic and Components for 'Overbygningmaterialer' #469
Merged
kasperbirch1
merged 16 commits into
danskernesdigitalebibliotek:develop
from
reload:DDFSOEG-529-udvid-bestillingsknapper-med-bestil-pa-andet-bibliotek-s-knap
Oct 9, 2023
Merged
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
DDFSOEG-529-udvid-bestillingsknapper-med-bestil-pa-andet-bibliotek-s-knap
branch
from
September 18, 2023 09:01
03db65c
to
c9764b3
Compare
kasperbirch1
force-pushed
the
DDFSOEG-529-udvid-bestillingsknapper-med-bestil-pa-andet-bibliotek-s-knap
branch
from
September 26, 2023 13:30
a4c3d2b
to
7c23601
Compare
kasperbirch1
force-pushed
the
DDFSOEG-529-udvid-bestillingsknapper-med-bestil-pa-andet-bibliotek-s-knap
branch
2 times, most recently
from
September 27, 2023 12:42
05c5f02
to
e19a754
Compare
kasperbirch1
force-pushed
the
DDFSOEG-529-udvid-bestillingsknapper-med-bestil-pa-andet-bibliotek-s-knap
branch
from
September 27, 2023 12:47
e19a754
to
0feb17f
Compare
kasperbirch1
changed the title
Add
Introduce OpenOrder Logic and Components for 'Overbygningmaterialer'
Sep 27, 2023
MaterialButtonReservableOnAnotherLibrary
button
spaceo
requested changes
Oct 2, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. I have some comments though
src/components/material/material-buttons/physical/MaterialButtonReservableOnAnotherLibrary.tsx
Outdated
Show resolved
Hide resolved
src/components/material/material-buttons/physical/MaterialButtonReservableOnAnotherLibrary.tsx
Outdated
Show resolved
Hide resolved
src/components/material/material-buttons/physical/MaterialButtonReservableOnAnotherLibrary.tsx
Outdated
Show resolved
Hide resolved
This is needed to determine if the manifestation can be reserved at another library (overbygningsmaterialer).
This is used to handle overbygningsmaterialer (openOrder)
- Implemented a new function `getReservableOnAnotherLibrary` to verify if a material is categorized as "overbygningsmateriale". This function returns both a boolean and a list of PIDs. - Utilized `getReservableOnAnotherLibrary` function to determine the visibility of the `MaterialButtonReservableOnAnotherLibrary` button. - Introduced a new component, `OpenOrderResponse`, as the `ReservationSuccess` does not have the same response structure. - Added `translateOpenOrderStatus` to interpret and display the response status.
After adding catalogueCodes, the mocked data/fixtures were no longer up-to-date.
To unify modal response handling
…PidsFromAnotherLibrary` Previously, we returned both 'isReservable' and a list of 'pids'. Now, we only return the list of pids and check its length to determine, for example, if the button should change its name.
Replacing the switch-case statement with a mapping object
kasperbirch1
force-pushed
the
DDFSOEG-529-udvid-bestillingsknapper-med-bestil-pa-andet-bibliotek-s-knap
branch
from
October 6, 2023 10:11
2579cd0
to
11bd97a
Compare
Prevent the use of magic number for open order interest days.
spaceo
approved these changes
Oct 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
kasperg
deleted the
DDFSOEG-529-udvid-bestillingsknapper-med-bestil-pa-andet-bibliotek-s-knap
branch
October 9, 2023 11:27
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/DDFSOEG-528
Description
This PR introduces the logic and components for ordering a book from 'overbygningmaterialer' (openOrder).
To determine that the material is available as an 'overbygningmateriale', I have made a function called
getReservableOnAnotherLibrary
. This function returns a boolean and a list of PIDS that start with 'OVE' in otherCatalogues.I have created a new graphql mutation called
openOrder
that is called instead of the normal reservation inside theReservationModalBody
.Because the response is so different from the normal reservation, I have made a separate component called
OpenOrderResponse
that handles the messages that are returned.I have added a unit test for the
getReservableOnAnotherLibrary
and a cypress e2e test that shows different messages depending on the response.Screenshot of the result
Checklist
Additional comments or questions