-
Notifications
You must be signed in to change notification settings - Fork 98
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
feat(pci-gateway): Gateway 3AZ beta #14706
base: develop
Are you sure you want to change the base?
Conversation
packages/manager/apps/pci-gateway/src/pages/add/LocationStep.tsx
Outdated
Show resolved
Hide resolved
3ceef31
1e8cb01
if (cloudCatalog) { | ||
return gatewayRefPlans.map((plan) => { | ||
const addonHourly = cloudCatalog.addons.find( | ||
($addon) => $addon.planCode === plan.code, |
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.
Why adding $ on params ?
ref: TAPC-2413 Signed-off-by: tsiorifamonjena <[email protected]>
ref: TAPC-2413 Signed-off-by: tsiorifamonjena <[email protected]>
ref: TAPC-2413 Signed-off-by: tsiorifamonjena <[email protected]>
ref: TAPC-2485 Signed-off-by: tsiorifamonjena <[email protected]>
ref-2413 Signed-off-by: tsiorifamonjena <[email protected]>
ref: TAPC-2306 Signed-off-by: tsiorifamonjena <[email protected]>
ref: TAPC-2306 Signed-off-by: tsiorifamonjena <[email protected]>
ref: TAPC-2306 Signed-off-by: tsiorifamonjena <[email protected]>
ref: TAPC-2306 Signed-off-by: tsiorifamonjena <[email protected]>
ref: TAPC-2306 Signed-off-by: tsiorifamonjena <[email protected]>
ref: TAPC-2306 Signed-off-by: tsiorifamonjena <[email protected]>
Signed-off-by: CDS Translator Agent <[email protected]>
6832d2c
to
a935985
Compare
Quality Gate passedIssues Measures |
@@ -98,21 +99,25 @@ export const LocationStep = () => { | |||
} | |||
}, [searchParams, state.regions]); | |||
|
|||
const has3AZ = useMemo(() => isRegionWith3AZ(state.regions), [state.regions]); | |||
|
|||
const pciCommonProperties = usePCICommonContextFactory({ has3AZ }); |
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.
Naming should be agnostic from the library :)
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.
Since it is the pci common context, how would you name it ?
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.
Could be directly const meta = usePCICommonContextFactory({ has3AZ });
or something like that ;)
const { data: cloudCatalog } = useCloudCatalog(); | ||
const { data: availableGatewayPlans } = useAvailableGatewayPlans(projectId); | ||
|
||
const { data: inactiveRegions } = useInactiveRegions(projectId); | ||
const getBandWidthLabel = (bandwidth: number) => |
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.
Should be memoized
availableGatewayPlans?.plans.reduce( | ||
(result: TAvailablePlansGrouped, currentValue: TPlan) => { | ||
const code = currentValue.code.replace(/\.3AZ$/, ''); | ||
const newResult = { ...result }; |
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.
Why not directly returning accumulator?
const getPrice = (addon: TAddon): number | undefined => | ||
addon?.pricings.find((price) => price.capacities.includes('consumption')) | ||
?.price; | ||
|
||
export const useData = (projectId: string) => { |
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.
As a general improvement, will be great to move some memoized functions out of the hook (SRP)
develop
Description
Related