Skip to content

Commit

Permalink
feat: [M3-5561] - Add Private IP checkbox when cloning a Linode
Browse files Browse the repository at this point in the history
  • Loading branch information
cpathipa committed Apr 20, 2023
1 parent f3f7716 commit 0e2bc37
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions packages/manager/src/features/linodes/LinodesCreate/AddonsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ interface Props {
}

type CombinedProps = Props;
const AddonsPanel: React.FC<CombinedProps> = (props) => {
const AddonsPanel = (props: CombinedProps) => {
const {
accountBackups,
changeBackups,
Expand All @@ -75,14 +75,15 @@ const AddonsPanel: React.FC<CombinedProps> = (props) => {
labelError,
ipamAddress,
ipamError,
privateIP,
handleVLANChange,
selectedRegionID,
selectedImageID,
selectedTypeID,
createType,
} = props;

const hidePrivateIP = createType === 'fromLinode';
// const hidePrivateIP = createType === 'fromLinode';

const classes = useStyles();
const { data: account } = useAccount();
Expand Down Expand Up @@ -186,28 +187,24 @@ const AddonsPanel: React.FC<CombinedProps> = (props) => {
</Typography>
</Grid>
</Grid>
{
/** /v4/linodes/instances/clone does *not* support the private IP flag */
hidePrivateIP ? null : (
<Grid container>
<Grid xs={12}>
<Divider />
<FormControlLabel
className={classes.label}
control={
<CheckBox
checked={props.privateIP}
onChange={() => changePrivateIP()}
data-qa-check-private-ip
disabled={disabled}
/>
}
label="Private IP"

<Grid container>
<Grid xs={12}>
<Divider />
<FormControlLabel
className={classes.label}
control={
<CheckBox
checked={privateIP}
onChange={() => changePrivateIP()}
data-qa-check-private-ip
disabled={disabled}
/>
</Grid>
</Grid>
)
}
}
label="Private IP"
/>
</Grid>
</Grid>
</Paper>
</>
);
Expand Down

0 comments on commit 0e2bc37

Please sign in to comment.