-
Notifications
You must be signed in to change notification settings - Fork 370
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: [M3-8101] - Use network-transfer/prices
endpoint for transfer overage pricing
#10566
refactor: [M3-8101] - Use network-transfer/prices
endpoint for transfer overage pricing
#10566
Conversation
network-transfer/pricing
endpoint for transfer overage pricingnetwork-transfer/prices
endpoint for transfer overage pricing
data: objTypes, | ||
isError: isErrorObjTypes, | ||
isInitialLoading: isLoadingObjTypes, | ||
} = useObjectStorageTypesQuery(isOpen); | ||
|
||
const isInvalidPrice = !types || isErrorTypes; | ||
const { | ||
data: transferTypes, | ||
isError: isErrorTransferTypes, | ||
isInitialLoading: isLoadingTransferTypes, | ||
} = useNetworkTransferPricesQuery(isOpen); | ||
|
||
const isErrorTypes = isErrorTransferTypes || isErrorObjTypes; | ||
const isLoadingTypes = isLoadingTransferTypes || isLoadingObjTypes; | ||
const isInvalidPrice = | ||
!objTypes || !transferTypes || isErrorTypes || isErrorTransferTypes; |
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.
These additions are made twice (once here, once in the next file) since we currently have two create bucket drawer components.
(showGDPRCheckbox && !hasSignedAgreement) || | ||
isErrorTypes, | ||
label: 'Create Bucket', | ||
loading: isLoading, | ||
loading: | ||
isLoading || Boolean(formik.values.region && isLoadingTypes), | ||
tooltipText: | ||
!isLoadingTypes && isInvalidPrice | ||
? PRICES_RELOAD_ERROR_NOTICE_TEXT | ||
: '', |
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.
I didn't add the loading and error state for the Create button in the initial PR for the first type of overage pricing in the OMC drawer - I forgot we had two drawers - so it has been added here now.
(OveragePricing is shared between the original and OMC drawer, so we were fine there.)
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.
Now being returned from API.
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.
Now being returned from API.
Coverage Report: ❌ |
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!
Description 📝
This PR is a follow up to #10468 and uses the newly added
network-transfer/prices
endpoint to fetch network transfer overage pricing from the API, finishing off the transition for OBJ to dynamic pricing data.Loading and error states are addressed, especially in the OMC Create Bucket drawer, which I missed in the first PR - see Reproduction steps in the Testing section.
Changes 🔄
network-transfer/prices
endpoint.Target release date 🗓️
6/24
Preview 📷
How to test 🧪
Prerequisites
Reproduction steps
(How to reproduce the issue, if applicable)
Verification steps
(How to verify changes)
As an Author I have considered 🤔
Check all that apply