Skip to content

Commit 8f58cc4

Browse files
committed
Use isDualStackEnabled check instead of only flags.vpcIpv6 in several files
1 parent 5106424 commit 8f58cc4

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

packages/manager/src/features/Linodes/LinodeEntityDetailBody.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Link } from 'src/components/Link';
1212
import { useKubernetesBetaEndpoint } from 'src/features/Kubernetes/kubeUtils';
1313
import { AccessTable } from 'src/features/Linodes/AccessTable';
1414
import { ipTableId } from 'src/features/Linodes/LinodesDetail/LinodeNetworking/utils';
15-
import { useFlags } from 'src/hooks/useFlags';
15+
import { useVPCDualStack } from 'src/hooks/useVPCDualStack';
1616
import { useKubernetesClusterQuery } from 'src/queries/kubernetes';
1717

1818
import { HighPerformanceVolumeIcon } from './HighPerformanceVolumeIcon';
@@ -102,8 +102,6 @@ export const LinodeEntityDetailBody = React.memo((props: BodyProps) => {
102102
vpcLinodeIsAssignedTo,
103103
} = props;
104104

105-
const flags = useFlags();
106-
107105
const { data: profile } = useProfile();
108106

109107
const { data: maskSensitiveDataPreference } = usePreferences(
@@ -116,6 +114,8 @@ export const LinodeEntityDetailBody = React.memo((props: BodyProps) => {
116114
const { isDiskEncryptionFeatureEnabled } =
117115
useIsDiskEncryptionFeatureEnabled();
118116

117+
const { isDualStackEnabled } = useVPCDualStack();
118+
119119
const isLinodeInterface = interfaceGeneration === 'linode';
120120
const vpcIPv4 = getVPCIPv4(interfaceWithVPC);
121121
const vpcIPv6 = getVPCIPv6(interfaceWithVPC);
@@ -379,8 +379,8 @@ export const LinodeEntityDetailBody = React.memo((props: BodyProps) => {
379379
</StyledIPItem>
380380
</StyledIPBox>
381381
)}
382-
{flags.vpcIpv6 &&
383-
vpcIPv6 && ( // @TODO VPC IPv6: remove flag check once VPC IPv6 is fully rolled out
382+
{isDualStackEnabled &&
383+
vpcIPv6 && ( // @TODO VPC IPv6: remove Dual Stack check once VPC IPv6 is fully rolled out
384384
<StyledIPBox>
385385
<StyledIPLabel data-testid="vpc-ipv6-label">
386386
VPC IPv6

packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { StatusIcon } from 'src/components/StatusIcon/StatusIcon';
1111
import { TableCell } from 'src/components/TableCell';
1212
import { TableRow } from 'src/components/TableRow';
1313
import { getLinodeIconStatus } from 'src/features/Linodes/LinodesLanding/utils';
14-
import { useFlags } from 'src/hooks/useFlags';
14+
import { useVPCDualStack } from 'src/hooks/useVPCDualStack';
1515
import { determineNoneSingleOrMultipleWithChip } from 'src/utilities/noneSingleOrMultipleWithChip';
1616

1717
import { useInterfaceDataForLinode } from '../../../hooks/useInterfaceDataForLinode';
@@ -70,7 +70,7 @@ export const SubnetLinodeRow = (props: Props) => {
7070
subnetInterfaces,
7171
} = props;
7272

73-
const flags = useFlags();
73+
const { isDualStackEnabled } = useVPCDualStack();
7474

7575
const subnetInterfaceData =
7676
subnetInterfaces.find((interfaceData) => interfaceData.active) ??
@@ -231,7 +231,7 @@ export const SubnetLinodeRow = (props: Props) => {
231231
})}
232232
</TableCell>
233233
</Hidden>
234-
{flags.vpcIpv6 && (
234+
{isDualStackEnabled && (
235235
<>
236236
<Hidden smDown>
237237
<TableCell data-testid="vpc-ipv6-cell" noWrap>
@@ -403,7 +403,7 @@ const getIPRangesCellContents = (
403403
};
404404

405405
export const SubnetLinodeTableRowHead = (
406-
vpcIPv6FeatureFlag: boolean = false
406+
isDualStackEnabled: boolean = false
407407
) => (
408408
<TableRow>
409409
<TableCell sx={{ width: '24%' }}>Linode</TableCell>
@@ -414,7 +414,7 @@ export const SubnetLinodeTableRowHead = (
414414
<Hidden smDown>
415415
<TableCell>VPC IPv4 Ranges</TableCell>
416416
</Hidden>
417-
{vpcIPv6FeatureFlag && (
417+
{isDualStackEnabled && (
418418
<>
419419
<Hidden smDown>
420420
<TableCell>VPC IPv6</TableCell>

packages/manager/src/features/VPCs/VPCDetail/VPCSubnetsTable.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import { TableSortCell } from 'src/components/TableSortCell';
2828
import { PowerActionsDialog } from 'src/features/Linodes/PowerActionsDialogOrDrawer';
2929
import { useIsNodebalancerVPCEnabled } from 'src/features/NodeBalancers/utils';
3030
import { SubnetActionMenu } from 'src/features/VPCs/VPCDetail/SubnetActionMenu';
31-
import { useFlags } from 'src/hooks/useFlags';
3231
import { useOrderV2 } from 'src/hooks/useOrderV2';
3332
import { usePaginationV2 } from 'src/hooks/usePaginationV2';
33+
import { useVPCDualStack } from 'src/hooks/useVPCDualStack';
3434

3535
import { SUBNET_ACTION_PATH } from '../constants';
3636
import { VPC_DETAILS_ROUTE } from '../constants';
@@ -63,8 +63,6 @@ export const VPCSubnetsTable = (props: Props) => {
6363
const theme = useTheme();
6464
const { enqueueSnackbar } = useSnackbar();
6565

66-
const flags = useFlags();
67-
6866
const navigate = useNavigate();
6967
const params = useParams({ strict: false });
7068
const location = useLocation();
@@ -90,6 +88,7 @@ export const VPCSubnetsTable = (props: Props) => {
9088
const { query } = search;
9189

9290
const { isNodebalancerVPCEnabled } = useIsNodebalancerVPCEnabled();
91+
const { isDualStackEnabled } = useVPCDualStack();
9392

9493
const pagination = usePaginationV2({
9594
currentRoute: VPC_DETAILS_ROUTE,
@@ -295,9 +294,9 @@ export const VPCSubnetsTable = (props: Props) => {
295294
</TableSortCell>
296295
</Hidden>
297296
<TableCell sx={{ width: '18%' }}>
298-
Subnet {flags.vpcIpv6 ? 'IPv4' : 'IP'} Range
297+
Subnet {isDualStackEnabled ? 'IPv4' : 'IP'} Range
299298
</TableCell>
300-
{flags.vpcIpv6 && <TableCell>Subnet IPv6 Range</TableCell>}
299+
{isDualStackEnabled && <TableCell>Subnet IPv6 Range</TableCell>}
301300
<Hidden smDown>
302301
<TableCell
303302
sx={{ width: '10%' }}
@@ -315,7 +314,7 @@ export const VPCSubnetsTable = (props: Props) => {
315314
<TableCell>{subnet.id}</TableCell>
316315
</Hidden>
317316
<TableCell>{subnet.ipv4}</TableCell>
318-
{flags.vpcIpv6 && (
317+
{isDualStackEnabled && (
319318
<TableCell>{subnet.ipv6?.[0]?.range ?? '—'}</TableCell>
320319
)}
321320
<Hidden smDown>
@@ -346,7 +345,7 @@ export const VPCSubnetsTable = (props: Props) => {
346345
color: theme.tokens.color.Neutrals.White,
347346
}}
348347
>
349-
{SubnetLinodeTableRowHead(flags.vpcIpv6)}
348+
{SubnetLinodeTableRowHead(isDualStackEnabled)}
350349
</TableHead>
351350
<TableBody>
352351
{subnet.linodes.length > 0 ? (
@@ -364,7 +363,7 @@ export const VPCSubnetsTable = (props: Props) => {
364363
))
365364
) : (
366365
<TableRowEmpty
367-
colSpan={flags.vpcIpv6 ? 8 : 6}
366+
colSpan={isDualStackEnabled ? 8 : 6}
368367
message="No Linodes"
369368
/>
370369
)}

0 commit comments

Comments
 (0)