-
Notifications
You must be signed in to change notification settings - Fork 407
upcoming: [M3-9590] - Update Linode Networking UI for Linode Interfaces #12049
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
Merged
bnussman-akamai
merged 18 commits into
linode:develop
from
bnussman-akamai:M3-9590-ui-tweaks-for-linode-ips-using-linode-interfaces
Apr 21, 2025
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a01c2ee
initial changes
bnussman 6180543
polish things
bnussman 3cb6b2f
add testing
bnussman 84e62e8
Merge branch 'develop' into M3-9590-ui-tweaks-for-linode-ips-using-liβ¦
bnussman eadbbe1
remove interface suffixes
bnussman aa94a25
Merge branch 'develop' into M3-9590-ui-tweaks-for-linode-ips-using-liβ¦
bnussman ca2ebdc
add some extra invalidations to fix table not updating when modifyingβ¦
bnussman 93b6724
improve form focus, forgot to commit on last PR
bnussman fb4ba51
add some extra invalidations to fix table not updating when modifyingβ¦
bnussman ca05f88
add custom no options text for VPC select
bnussman 423a3ef
invalidate linode interfaces when a range is deleted using range deleβ¦
bnussman 70b460e
invalidate linode interfaces when a range is deleted using range deleβ¦
bnussman 84efb8f
fix up more cache invalidations
bnussman 100cdce
show support links for ip limits
bnussman 4e39a25
feedback @bill-akamai
bnussman e53d363
Merge branch 'develop' into M3-9590-ui-tweaks-for-linode-ips-using-liβ¦
bnussman b75d3df
more invalidations @coliu-akamai
bnussman 977a9ad
add similar VPC messaging in the Add Interface drawer
bnussman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
40 changes: 40 additions & 0 deletions
40
...c/features/Linodes/LinodesDetail/LinodeNetworking/LinodeInterfaces/LinodeInterfaceIPs.tsx
This file contains hidden or 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,40 @@ | ||
| import { Stack, Typography } from '@linode/ui'; | ||
| import React from 'react'; | ||
|
|
||
| import { MaskableText } from 'src/components/MaskableText/MaskableText'; | ||
| import { ShowMore } from 'src/components/ShowMore/ShowMore'; | ||
|
|
||
| import { getLinodeInterfaceIPs } from './LinodeInterfaceIPs.utils'; | ||
|
|
||
| import type { LinodeInterface } from '@linode/api-v4'; | ||
|
|
||
| interface Props { | ||
| linodeInterface: LinodeInterface; | ||
| } | ||
|
|
||
| export const LinodeInterfaceIPs = ({ linodeInterface }: Props) => { | ||
| const [primary, ...ips] = getLinodeInterfaceIPs(linodeInterface); | ||
|
|
||
| if (!primary && ips.length === 0) { | ||
| return <Typography>None</Typography>; | ||
| } | ||
|
|
||
| return ( | ||
| <Stack direction="row" spacing={1.5}> | ||
| <MaskableText isToggleable text={primary} /> | ||
| {ips.length > 0 && ( | ||
| <ShowMore | ||
| ariaItemType="IP Address" | ||
| items={ips} | ||
| render={(ips) => ( | ||
| <Stack> | ||
| {ips.map((ip) => ( | ||
| <MaskableText isToggleable key={ip} text={ip} /> | ||
| ))} | ||
| </Stack> | ||
| )} | ||
| /> | ||
| )} | ||
| </Stack> | ||
| ); | ||
| }; |
96 changes: 96 additions & 0 deletions
96
.../Linodes/LinodesDetail/LinodeNetworking/LinodeInterfaces/LinodeInterfaceIPs.utils.test.ts
This file contains hidden or 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,96 @@ | ||
| import { | ||
| linodeInterfaceFactoryPublic, | ||
| linodeInterfaceFactoryVlan, | ||
| linodeInterfaceFactoryVPC, | ||
| } from '@linode/utilities'; | ||
|
|
||
| import { getLinodeInterfaceIPs } from './LinodeInterfaceIPs.utils'; | ||
|
|
||
| describe('getLinodeInterfaceIPs', () => { | ||
| it('should return VPC IPs with the primary IP first', () => { | ||
| const linodeInterface = linodeInterfaceFactoryVPC.build({ | ||
| vpc: { | ||
| ipv4: { | ||
| addresses: [ | ||
| { address: '10.0.0.1' }, | ||
| { | ||
| address: '10.0.0.2', | ||
| primary: true, | ||
| nat_1_1_address: '255.255.255.255', | ||
| }, | ||
| { address: '10.0.0.3' }, | ||
| ], | ||
| ranges: [{ range: '10.0.0.5/32' }], | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| const ips = getLinodeInterfaceIPs(linodeInterface); | ||
|
|
||
| expect(ips).toStrictEqual([ | ||
| '10.0.0.2', | ||
| '255.255.255.255', | ||
| '10.0.0.1', | ||
| '10.0.0.3', | ||
| '10.0.0.5/32', | ||
| ]); | ||
| }); | ||
|
|
||
| it('should return Public Interface IPs with the primary IP first', () => { | ||
| const linodeInterface = linodeInterfaceFactoryPublic.build({ | ||
| public: { | ||
| ipv4: { | ||
| addresses: [ | ||
| { address: '10.0.0.1' }, | ||
| { | ||
| address: '10.0.0.2', | ||
| primary: true, | ||
| }, | ||
| { address: '10.0.0.3' }, | ||
| ], | ||
| }, | ||
| ipv6: { | ||
| ranges: [{ range: '192.168.1.0/24' }], | ||
| shared: [], | ||
| slaac: [{ address: '2600:3c11::f03c:93ff:fe3a:130f', prefix: '64' }], | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| const ips = getLinodeInterfaceIPs(linodeInterface); | ||
|
|
||
| expect(ips).toStrictEqual([ | ||
| '10.0.0.2', | ||
| '10.0.0.1', | ||
| '10.0.0.3', | ||
| '192.168.1.0/24', | ||
| '2600:3c11::f03c:93ff:fe3a:130f', | ||
| ]); | ||
| }); | ||
|
|
||
| it('should return an empty array for VLAN without a IPAM Address', () => { | ||
| const linodeInterface = linodeInterfaceFactoryVlan.build({ | ||
| vlan: { | ||
| ipam_address: '', | ||
| vlan_label: 'vlan-1', | ||
| }, | ||
| }); | ||
|
|
||
| const ips = getLinodeInterfaceIPs(linodeInterface); | ||
|
|
||
| expect(ips).toStrictEqual([]); | ||
| }); | ||
|
|
||
| it('should return an empty with the IPAM Addresss for VLAN with an IPAM Address', () => { | ||
| const linodeInterface = linodeInterfaceFactoryVlan.build({ | ||
| vlan: { | ||
| ipam_address: '192.168.21.34', | ||
| vlan_label: 'vlan-1', | ||
| }, | ||
| }); | ||
|
|
||
| const ips = getLinodeInterfaceIPs(linodeInterface); | ||
|
|
||
| expect(ips).toStrictEqual(['192.168.21.34']); | ||
| }); | ||
| }); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
From what I could tell, this component is essentially visually broken right now, so I just reversed back to using a plain "Chip".
I checked the Akamai design system and didn't see anything resembling this component so I don't really know what we want it to look like. In my opinion, a plain chip is a safe bet for now, but open to feedback here.