mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
refactor: remove duplicate Connection type definition (#935)
Ref: HDX-1905
This commit is contained in:
parent
d1f4184536
commit
86fa929566
4 changed files with 9 additions and 11 deletions
5
.changeset/tender-mails-punch.md
Normal file
5
.changeset/tender-mails-punch.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@hyperdx/app": patch
|
||||
---
|
||||
|
||||
Removed duplicate type definition.
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue