-
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
Refactor button reservable from another library #797
Merged
kasperbirch1
merged 8 commits into
release/2024-4-0
from
move-material-button-reservable-from-another-library
Jan 11, 2024
Merged
Refactor button reservable from another library #797
kasperbirch1
merged 8 commits into
release/2024-4-0
from
move-material-button-reservable-from-another-library
Jan 11, 2024
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
If the material only can be reserved on another library, we don't want to show other buttons like `MaterialButtonFindOnShelf`
…notherLibrary` hook Added validation with FBS to verify manifestation's reservable status (must be false) for Overbygningsmaterial/OpenOrder reservations. in addition, I have removed out the tests that were for `getReservablePidsFromAnotherLibrary` as they must be rewritten for the new hook
kasperbirch1
changed the title
Move material button reservable from another library
Refactor button reservable from another library
Dec 20, 2023
spaceo
requested changes
Dec 20, 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.
Looks good. But I think it is a bad idea to delete tests without adding new
Following the update from DBC, we now have a material that meets all requirements to activate the `MaterialButtonReservableFromAnotherLibrary` (openOrder) button.
Simplified return value to directly return the array, eliminating the need for an intermediate object.
kasperbirch1
force-pushed
the
move-material-button-reservable-from-another-library
branch
from
December 21, 2023 15:41
86f17a4
to
862f61f
Compare
Due to the `UseReservableManifestations` hook validating whether a manifestation is reservable, we cannot use the `reservableManifestations` variable it returns in the new `useReservableFromAnotherLibrary` hook. Therefore, I have used the `selectedManifestations` variable within `useReservableFromAnotherLibrary`. Additionally, I have implemented minor changes within `saveReservation`. Specifically, I removed the guard check for an early return. Now, it directly checks for the required criteria to determine whether to use `mutateAddReservations` or `mutateOpenOrder`.
Replace fixture with a material requiring reservation via openOrder (overbygningsmateriale).
This line was confusing... the status will be set in the `translateOpenOrderStatus` function, and the translations for them should be descriptive of the current status of the order.
spaceo
approved these changes
Jan 2, 2024
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 👍
@spaceo already gave this a 👍 😄 |
kasperbirch1
deleted the
move-material-button-reservable-from-another-library
branch
January 11, 2024 07:31
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 pull request refactors the order buttons by moving the logic for displaying the
MaterialButtonReservableFromAnotherLibrary
component and refactoring thegetReservablePidsFromAnotherLibrary
function into auseReservableFromAnotherLibrary
hook. That also checks if the material is not reservable and should be ordered via openOrder.Screenshot of the result