Skip to content
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

change: [M3-7485] - Revert Disable Public IP for Linodes Landing #9933

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@linode/manager": Upcoming Features
---

Disable Public IP Address for VPC-only Linodes ([#9899](https://github.com/linode/manager/pull/9899))
Disable Public IP Address for VPC-only Linodes in the Linode's details page and add warning banner to Linode landing ([#9899](https://github.com/linode/manager/pull/9899))
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
transitionText,
} from 'src/features/Linodes/transitions';
import { notificationContext as _notificationContext } from 'src/features/NotificationCenter/NotificationContext';
import { useVPCConfigInterface } from 'src/hooks/useVPCConfigInterface';
import { useTypeQuery } from 'src/queries/types';
import { useRecentEventForLinode } from 'src/store/selectors/recentEventForLinode';
import { capitalizeAllWords } from 'src/utilities/capitalize';
Expand Down Expand Up @@ -56,8 +55,6 @@ export const LinodeRow = (props: Props) => {

const recentEvent = useRecentEventForLinode(id);

const { isVPCOnlyLinode } = useVPCConfigInterface(id);

const isBareMetalInstance = linodeType?.class === 'metal';

const loading = linodeInTransition(status, recentEvent);
Expand Down Expand Up @@ -144,11 +141,7 @@ export const LinodeRow = (props: Props) => {
{linodeType ? formatStorageUnits(linodeType.label) : type}
</TableCell>
<StyledIpTableCell data-qa-ips>
<IPAddress
disabled={isVPCOnlyLinode}
ips={ipv4}
isHovered={isHovered}
/>
<IPAddress ips={ipv4} isHovered={isHovered} />
</StyledIpTableCell>
<Hidden lgDown>
<TableCell data-qa-region>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Link, RouteComponentProps, withRouter } from 'react-router-dom';
import { compose } from 'recompose';

import { CircleProgress } from 'src/components/CircleProgress';
import { DismissibleBanner } from 'src/components/DismissibleBanner/DismissibleBanner';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import { ErrorState } from 'src/components/ErrorState/ErrorState';
import { LandingHeader } from 'src/components/LandingHeader';
Expand All @@ -12,14 +13,22 @@ import OrderBy from 'src/components/OrderBy';
import { PreferenceToggle } from 'src/components/PreferenceToggle/PreferenceToggle';
import { ProductInformationBanner } from 'src/components/ProductInformationBanner/ProductInformationBanner';
import { TransferDisplay } from 'src/components/TransferDisplay/TransferDisplay';
import { Typography } from 'src/components/Typography';
import {
WithAccountProps,
withAccount,
} from 'src/containers/account.container';
import {
WithProfileProps,
withProfile,
} from 'src/containers/profile.container';
import withFeatureFlagConsumer from 'src/containers/withFeatureFlagConsumer.container';
import withFlags, {
FeatureFlagConsumerProps,
} from 'src/containers/withFeatureFlagConsumer.container';
import { BackupsCTA } from 'src/features/Backups/BackupsCTA';
import { MigrateLinode } from 'src/features/Linodes/MigrateLinode/MigrateLinode';
import { DialogType } from 'src/features/Linodes/types';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import {
sendGroupByTagEnabledEvent,
sendLinodesViewEvent,
Expand Down Expand Up @@ -92,11 +101,14 @@ export interface LinodesLandingProps {
type CombinedProps = LinodesLandingProps &
StateProps &
RouteProps &
WithProfileProps;
WithProfileProps &
WithAccountProps &
FeatureFlagConsumerProps;

class ListLinodes extends React.Component<CombinedProps, State> {
render() {
const {
flags,
linodesData,
linodesInTransition,
linodesRequestError,
Expand All @@ -117,6 +129,12 @@ class ListLinodes extends React.Component<CombinedProps, State> {
.someLinodesHaveScheduledMaintenance,
};

const VPCEnabled = isFeatureEnabled(
'VPCs',
Boolean(flags.vpc),
this.props.account.data?.capabilities ?? []
);

if (linodesRequestError) {
let errorText: JSX.Element | string =
linodesRequestError?.[0]?.reason ?? 'Error loading Linodes';
Expand Down Expand Up @@ -157,6 +175,19 @@ class ListLinodes extends React.Component<CombinedProps, State> {

return (
<React.Fragment>
{VPCEnabled && (
<DismissibleBanner
preferenceKey="vpc-linode-ip-config"
variant="warning"
>
<Typography>
A Public IP address is provisionally reserved for each Linode, but
isn&rsquo;t automatically assigned for Linodes in a VPC. To see
whether a Public IPv4 address has been assigned, see the Linode
details page.
</Typography>
</DismissibleBanner>
)}
<LinodeResize
linodeId={this.state.selectedLinodeID}
onClose={this.closeDialogs}
Expand Down Expand Up @@ -450,7 +481,8 @@ const connected = connect(mapStateToProps, undefined);
export const enhanced = compose<CombinedProps, LinodesLandingProps>(
withRouter,
connected,
withFeatureFlagConsumer,
withAccount,
withFlags,
withProfile
);

Expand Down