refactor: remove duplicate Connection type definition (#935)

Ref: HDX-1905
This commit is contained in:
Dan Hable 2025-06-20 15:09:12 -05:00 committed by GitHub
parent d1f4184536
commit 86fa929566
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 11 deletions

View file

@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---
Removed duplicate type definition.

View file

@ -1,6 +1,7 @@
import { useCallback, useEffect, useState } from 'react';
import { useForm } from 'react-hook-form';
import { testLocalConnection } from '@hyperdx/common-utils/dist/clickhouse';
import { Connection } from '@hyperdx/common-utils/dist/types';
import { Box, Button, Flex, Group, Stack, Text, Tooltip } from '@mantine/core';
import { notifications } from '@mantine/notifications';
@ -11,7 +12,6 @@ import {
} from '@/components/InputControlled';
import { IS_LOCAL_MODE } from '@/config';
import {
Connection,
useCreateConnection,
useDeleteConnection,
useUpdateConnection,

View file

@ -1,7 +1,7 @@
import React from 'react';
import { Connection } from '@hyperdx/common-utils/dist/types';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { Connection } from '../../connection';
import { ConnectionForm } from '../ConnectionForm';
import '@testing-library/jest-dom';

View file

@ -1,5 +1,6 @@
import store from 'store2';
import { testLocalConnection } from '@hyperdx/common-utils/dist/clickhouse';
import { Connection } from '@hyperdx/common-utils/dist/types';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { hdxServer } from '@/api';
@ -8,14 +9,6 @@ import { parseJSON } from '@/utils';
export const LOCAL_STORE_CONNECTIONS_KEY = 'connections';
export type Connection = {
id: string;
name: string;
host: string;
username: string;
password: string;
};
function setLocalConnections(newConnections: Connection[]) {
// sessing sessionStorage doesn't send a storage event to the open tab, only
// another tab. Let's send one anyways for any listeners in other components
@ -69,7 +62,7 @@ export function useCreateConnection() {
const isValid = await testLocalConnection({
host: connection.host,
username: connection.username,
password: connection.password,
password: connection.password ?? '',
});
if (!isValid) {