-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upcoming: [M3-7296] - Create Load Balancer Summary page (#10018)
* Create EditLoadBalancerLabel * Added changeset: Create Load Balancer Summary page. * Create EditLoadBalancerRegions * rename EditLoadBalancerLabel * Create LoadBalancerSummary * Create LoadBalancerCreateFormWrapper * Code cleanup * Billing Summary sections * EditConfigurationDetails * EditRoutes * EditLoadBalancerConfigurations * Update LoadBalancerSummary.styles.ts * Disabel Review button incase of validation errors * Code cleanup * test coverage - EditRouteDrawer * Update EditRouteDrawer.test.tsx * test coverage - ConfigurationAccordionHeader * test coverage - RouteAccordionHeader * test coverage - ConfigurationAccordion * Update with comments * Update packages/manager/.changeset/pr-10018-upcoming-features-1703185915854.md Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> * Add Todo item to update links * Update LoadBalancerSummary.tsx * PR feedback. * Update packages/manager/src/features/LoadBalancers/LoadBalancerCreate/LoadBalancerSummary/LoadBalancerSummary.tsx Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> * Revert "PR feedback." This reverts commit 5cb1279. * PR - Feedback - Remove background color, and align regions title * Reduce spacing around summary section * PR -feedback - control opening accordion upon clicking edit button * PR - feedback @bnussman-akamai @hana-linode * Copy updates --------- Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
- Loading branch information
Showing
42 changed files
with
1,320 additions
and
109 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-10018-upcoming-features-1703185915854.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
Create Load Balancer Summary page ([#10018](https://github.com/linode/manager/pull/10018)) |
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
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
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
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
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
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
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
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
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
90 changes: 90 additions & 0 deletions
90
...s/manager/src/features/LoadBalancers/LoadBalancerCreate/LoadBalancerCreateFormWrapper.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { CreateLoadBalancerSchema } from '@linode/validation'; | ||
import { Formik } from 'formik'; | ||
import React from 'react'; | ||
import { Route, Switch } from 'react-router-dom'; | ||
|
||
import { useFlags } from 'src/hooks/useFlags'; | ||
|
||
import type { | ||
ConfigurationPayload, | ||
CreateLoadbalancerPayload, | ||
ServiceTargetPayload, | ||
} from '@linode/api-v4'; | ||
|
||
const LoadBalancerCreate = React.lazy(() => | ||
import('./LoadBalancerCreate').then((module) => ({ | ||
default: module.LoadBalancerCreate, | ||
})) | ||
); | ||
|
||
const LoadBalancerBasicCreate = React.lazy(() => | ||
import('./LoadBalancerBasicCreate').then((module) => ({ | ||
default: module.LoadBalancerBasicCreate, | ||
})) | ||
); | ||
|
||
const LoadBalancerSummary = React.lazy(() => | ||
import('./LoadBalancerSummary/LoadBalancerSummary').then((module) => ({ | ||
default: module.LoadBalancerSummary, | ||
})) | ||
); | ||
|
||
export interface LoadBalancerCreateFormData | ||
extends Omit<CreateLoadbalancerPayload, 'configurations'> { | ||
configurations: (ConfigurationPayload & { | ||
service_targets: ServiceTargetPayload[]; | ||
})[]; | ||
} | ||
|
||
export const initialValues: LoadBalancerCreateFormData = { | ||
configurations: [ | ||
{ | ||
certificates: [], | ||
label: '', | ||
port: 443, | ||
protocol: 'https', | ||
routes: [], | ||
service_targets: [], | ||
}, | ||
], | ||
label: '', | ||
regions: [], | ||
}; | ||
|
||
export const LoadBalancerCreateFormWrapper = () => { | ||
const flags = useFlags(); | ||
|
||
const handleSubmit = (values: LoadBalancerCreateFormData) => { | ||
// Handle form submission | ||
}; | ||
|
||
return ( | ||
<Formik | ||
initialValues={initialValues} | ||
onSubmit={handleSubmit} | ||
validationSchema={CreateLoadBalancerSchema} | ||
> | ||
{() => ( | ||
<Switch> | ||
<Route | ||
render={() => | ||
flags.aglbFullCreateFlow ? ( | ||
<LoadBalancerCreate /> | ||
) : ( | ||
<LoadBalancerBasicCreate /> | ||
) | ||
} | ||
exact | ||
path="/loadbalancers/create" | ||
/> | ||
{flags.aglbFullCreateFlow && ( | ||
<Route | ||
path="/loadbalancers/create/summary" | ||
render={() => <LoadBalancerSummary />} | ||
/> | ||
)} | ||
</Switch> | ||
)} | ||
</Formik> | ||
); | ||
}; |
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
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
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
Oops, something went wrong.