Skip to content

Commit

Permalink
ip sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-akamai committed Jan 10, 2025
1 parent 20ff4ba commit 438c8e0
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
CircleProgress,
Divider,
Notice,
Select,
TextField,
Typography,
} from '@linode/ui';
Expand All @@ -13,7 +14,6 @@ import * as React from 'react';

import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel';
import { Dialog } from 'src/components/Dialog/Dialog';
import Select from 'src/components/EnhancedSelect/Select';
import { Link } from 'src/components/Link';
import { API_MAX_PAGE_SIZE } from 'src/constants';
import { useFlags } from 'src/hooks/useFlags';
Expand All @@ -32,7 +32,7 @@ import { getAPIErrorOrDefault, getErrorMap } from 'src/utilities/errorUtils';
import type { Linode } from '@linode/api-v4/lib/linodes';
import type { IPRangeInformation } from '@linode/api-v4/lib/networking';
import type { APIError } from '@linode/api-v4/lib/types';
import type { Item } from 'src/components/EnhancedSelect/Select';
import type { AutocompleteOption } from '@linode/ui';

interface Props {
linodeId: number;
Expand Down Expand Up @@ -165,7 +165,7 @@ const IPSharingPanel = (props: Props) => {
}
}, [ips, ranges]);

const onIPSelect = (ipIdx: number, e: Item<string>) => {
const onIPSelect = (ipIdx: number, e: AutocompleteOption<string>) => {
setIpsToShare((currentIps) => {
return ipIdx >= currentIps.length
? [...currentIps, e.value]
Expand Down Expand Up @@ -470,7 +470,7 @@ export const IPRow: React.FC<RowProps> = React.memo((props) => {
interface SharingRowProps extends RowProps {
getRemainingChoices: (ip: string | undefined) => string[];
handleDelete?: (idx: number) => void;
handleSelect: (idx: number, selected: Item<string>) => void;
handleSelect: (idx: number, selected: AutocompleteOption<string>) => void;
idx: number;
labels: Record<string, string>;
readOnly: boolean;
Expand Down Expand Up @@ -506,19 +506,18 @@ export const IPSharingRow: React.FC<SharingRowProps> = React.memo((props) => {
</Grid>
<Grid sm={10} xs={12}>
<StyledSelect
onChange={(_, selected: AutocompleteOption<string>) =>
handleSelect(idx, selected)
}
textFieldProps={{
dataAttrs: {
'data-qa-share-ip': true,
},
}}
disabled={readOnly}
hideLabel
inputId={`ip-select-${idx}`}
isClearable={false}
label="Select an IP"
onChange={(selected: Item<string>) => handleSelect(idx, selected)}
options={ipList}
overflowPortal
placeholder="Select an IP"
value={selectedIP}
/>
Expand Down

0 comments on commit 438c8e0

Please sign in to comment.