Skip to content

fix(CE): connector listing error #690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions ui/src/components/SteppedForm/SteppedForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,25 +166,22 @@ const SteppedForm = ({ steps }: SteppedFormType): JSX.Element => {
{stepInfo.name}
</Text>
</Box>
<Box>
<ExitModal />
</Box>
{stepInfo.exitWithoutWarning ? (
<Button
variant='shell'
onClick={() => navigate('*')}
paddingX={6}
height='32px'
letterSpacing='-0.12px'
>
Exit
</Button>
) : (
<Box>
<ExitModal />
</Box>
)}
</Box>
{stepInfo.exitWithoutWarning ? (
<Button
variant='shell'
onClick={() => navigate('*')}
paddingX={6}
height='32px'
letterSpacing='-0.12px'
>
Exit
</Button>
) : (
<Box>
<ExitModal />
</Box>
)}
</ContentContainer>
</Box>
</Box>
Expand Down
6 changes: 2 additions & 4 deletions ui/src/services/connectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ type ConnectorDefinationApiResponse = {
};
};

export const getConnectorsDefintions = async (
connectorType: string,
): Promise<ConnectorsDefinationApiResponse> =>
multiwovenFetch<null, ConnectorsDefinationApiResponse>({
export const getConnectorsDefintions = async (connectorType: string): Promise<Connector[]> =>
multiwovenFetch<null, Connector[]>({
method: 'get',
url: buildUrlWithParams('/connector_definitions', {
type: connectorType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getConnectorsDefintions, ConnectorsDefinationApiResponse } from '@/services/connectors';
import { getConnectorsDefintions } from '@/services/connectors';
import { getDestinationCategories } from '@/views/Connectors/helpers';
import { useContext, useState } from 'react';
import { Box, Grid, Text, Wrap } from '@chakra-ui/react';
Expand All @@ -13,7 +13,7 @@ const SelectDestinations = (): JSX.Element => {
const { stepInfo, handleMoveForward } = useContext(SteppedFormContext);
const [selectedCategory, setSelectedCategory] = useState<string>(ALL_DESTINATIONS_CATEGORY);

const { data } = useQueryWrapper<ConnectorsDefinationApiResponse, Error>(
const { data } = useQueryWrapper<Connector[], Error>(
['datasources', 'destination'],
() => getConnectorsDefintions('destination'),
{
Expand All @@ -23,7 +23,7 @@ const SelectDestinations = (): JSX.Element => {
},
);

const connectors = data?.data ?? [];
const connectors = data ?? [];
const destinationCategories = getDestinationCategories(connectors);

const onDestinationSelect = (destination: Connector) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { useContext } from 'react';
import { Box } from '@chakra-ui/react';
import { SteppedFormContext } from '@/components/SteppedForm/SteppedForm';
import { getConnectorsDefintions, ConnectorsDefinationApiResponse } from '@/services/connectors';
import { DatasourceType } from '@/views/Connectors/types';
import { getConnectorsDefintions } from '@/services/connectors';
import { Connector, DatasourceType } from '@/views/Connectors/types';
import ContentContainer from '@/components/ContentContainer';
import useQueryWrapper from '@/hooks/useQueryWrapper';
import EntityItem from '@/components/EntityItem';

const SelectDataSourcesForm = (): JSX.Element => {
const { stepInfo, handleMoveForward } = useContext(SteppedFormContext);

const { data } = useQueryWrapper<ConnectorsDefinationApiResponse, Error>(
const { data } = useQueryWrapper<Connector[], Error>(
['datasources', 'source'],
() => getConnectorsDefintions('source'),
{
Expand All @@ -20,7 +20,7 @@ const SelectDataSourcesForm = (): JSX.Element => {
},
);

const datasources = data?.data ?? [];
const datasources = data ?? [];

const handleOnClick = (datasource: DatasourceType) => {
if (stepInfo?.formKey) {
Expand Down