Skip to content

Commit

Permalink
Do not need to format.
Browse files Browse the repository at this point in the history
Better checking of existence
  • Loading branch information
travjenkins committed Dec 3, 2024
1 parent fbd6fa3 commit 97786c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
7 changes: 2 additions & 5 deletions src/components/tables/DataPlanes/Rows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useIntl } from 'react-intl';
import {
formatDataPlaneName,
formatDataPlaneOption,
formatSshSubnets,
} from 'utils/dataPlane-utils';

interface RowsProps {
Expand Down Expand Up @@ -44,10 +43,8 @@ function Row({ row }: RowProps) {
</TableCell>

<TableCell>
{row.ssh_subnets ? (
<SingleLineCode
value={row.ssh_subnets.map(formatSshSubnets).join(', ')}
/>
{row.ssh_subnets && row.ssh_subnets.length > 0 ? (
<SingleLineCode value={row.ssh_subnets.join(', ')} />
) : (
intl.formatMessage({
id: 'admin.dataPlanes.table.columns.ips.missing',
Expand Down
3 changes: 1 addition & 2 deletions src/forms/renderers/Informational/SshEndpoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import AlertBox from 'components/shared/AlertBox';
import { useMemo } from 'react';
import { useIntl } from 'react-intl';
import { useDetailsFormStore } from 'stores/DetailsForm/Store';
import { formatSshSubnets } from 'utils/dataPlane-utils';

function SshEndpointInfo() {
const intl = useIntl();
Expand All @@ -16,7 +15,7 @@ function SshEndpointInfo() {
const ipList = useMemo(() => {
// Check if private data plane has IPs and use 'em
if (sshSubnets && sshSubnets.length > 0) {
return sshSubnets.map(formatSshSubnets).join(', ');
return sshSubnets.join(', ');
}

return intl.formatMessage({
Expand Down
4 changes: 0 additions & 4 deletions src/utils/dataPlane-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,3 @@ export const isHttp = (ep: Endpoint): boolean => {
export const formatHttpUrl = (fullHostName: string): string => {
return `https://${fullHostName}/`;
};

export const formatSshSubnets = (subnet: string) => {
return subnet.replaceAll('/32', '').replaceAll('/64', '');
};

0 comments on commit 97786c9

Please sign in to comment.