diff --git a/frontend/apps/web/app/(mgmt)/[account]/connections/components/ConnectionsTable/columns.tsx b/frontend/apps/web/app/(mgmt)/[account]/connections/components/ConnectionsTable/columns.tsx index e1f4d288e0..3c253c60b7 100644 --- a/frontend/apps/web/app/(mgmt)/[account]/connections/components/ConnectionsTable/columns.tsx +++ b/frontend/apps/web/app/(mgmt)/[account]/connections/components/ConnectionsTable/columns.tsx @@ -6,7 +6,8 @@ import NextLink from 'next/link'; import { formatDateTime } from '@/util/util'; import { PlainMessage, Timestamp } from '@bufbuild/protobuf'; -import { Connection, ConnectionConfig } from '@neosync/sdk'; +import { Connection } from '@neosync/sdk'; +import { getCategory } from '../../util'; import { DataTableColumnHeader } from './data-table-column-header'; import { DataTableRowActions } from './data-table-row-actions'; @@ -126,27 +127,3 @@ export function getColumns( }, ]; } - -function getCategory(cc?: PlainMessage): string { - if (!cc) { - return '-'; - } - switch (cc.config.case) { - case 'pgConfig': - return 'Postgres'; - case 'mysqlConfig': - return 'MySQL'; - case 'awsS3Config': - return 'AWS S3'; - case 'openaiConfig': - return 'OpenAI'; - case 'localDirConfig': - return 'Local Dir'; - case 'mongoConfig': - return 'MongoDB'; - case 'gcpCloudstorageConfig': - return 'GCP Cloud Storage'; - default: - return '-'; - } -} diff --git a/frontend/apps/web/app/(mgmt)/[account]/connections/util.ts b/frontend/apps/web/app/(mgmt)/[account]/connections/util.ts index 5854c7b28d..1da4349196 100644 --- a/frontend/apps/web/app/(mgmt)/[account]/connections/util.ts +++ b/frontend/apps/web/app/(mgmt)/[account]/connections/util.ts @@ -10,6 +10,7 @@ import { PostgresFormValues, SshTunnelFormValues, } from '@/yup-validations/connections'; +import { PlainMessage } from '@bufbuild/protobuf'; import { AwsS3ConnectionConfig, AwsS3Credentials, @@ -70,6 +71,33 @@ export function getConnectionType( } } +// Used for the connections data table +export function getCategory(cc?: PlainMessage): string { + if (!cc) { + return '-'; + } + switch (cc.config.case) { + case 'pgConfig': + return 'Postgres'; + case 'mysqlConfig': + return 'MySQL'; + case 'awsS3Config': + return 'AWS S3'; + case 'openaiConfig': + return 'OpenAI'; + case 'localDirConfig': + return 'Local Dir'; + case 'mongoConfig': + return 'MongoDB'; + case 'gcpCloudstorageConfig': + return 'GCP Cloud Storage'; + case 'dynamodbConfig': + return 'DynamoDB'; + default: + return '-'; + } +} + export function buildConnectionConfigDynamoDB( values: DynamoDbFormValues ): ConnectionConfig {