Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7e09fcc
Initial switching over to use GQL for connectors on the card list page
travjenkins Mar 31, 2026
e6b270f
Switching over to storing the connector stuff in context
travjenkins Mar 31, 2026
f2de20c
Formatting to GQL format of UUIDs
travjenkins Mar 31, 2026
d10afa2
Starting to clean up when we allowed connector to be changed
travjenkins Apr 1, 2026
6b957cf
We do not need to enable setting this as we force the option to be se…
travjenkins Apr 1, 2026
c86d33a
formatting stuff
travjenkins Apr 1, 2026
e63dc70
Wiring back up the check for unsupported connectors
travjenkins Apr 1, 2026
c820b09
Merge remote-tracking branch 'origin/main' into travjenkins/gql/conne…
travjenkins Apr 6, 2026
4550725
Cleaning up old code/approach
travjenkins Apr 6, 2026
92c4708
fetching binding stuff from new context
travjenkins Apr 6, 2026
e4003be
cleaning up the valid connector check - the backend checks this and the
travjenkins Apr 6, 2026
58a9118
cleaning up some typing
travjenkins Apr 6, 2026
7a152b2
Cleaning up stuff we should not need anymore
travjenkins Apr 6, 2026
8b8f4dc
Removing the old details hydrator for details as only test page used it
travjenkins Apr 7, 2026
3621d53
Cleaning up a lot of code just for the test json forms page
travjenkins Apr 7, 2026
a93da55
Adding a bit more error handling
travjenkins Apr 7, 2026
b00508f
Updating query so we fetch the image tag if available
travjenkins Apr 7, 2026
326faa2
I think we are good to remove this - gonna test it out
travjenkins Apr 7, 2026
b21977f
We can remove this as it was only around for test/jsonforms page and …
travjenkins Apr 7, 2026
3aabcde
jsonforms test page will help connector team with quicker testing and it
travjenkins Apr 8, 2026
abc5ea2
Cleaning up some old code to move towards using the new context
travjenkins Apr 9, 2026
f03eca2
Some final cleanup of hanging code
travjenkins Apr 9, 2026
1244c83
Merge remote-tracking branch 'origin/main' into travjenkins/gql/conne…
travjenkins Apr 10, 2026
679d56b
Post merge codegen run
travjenkins Apr 10, 2026
2bc46b3
Cleaning up some old stuff
travjenkins Apr 10, 2026
c2d3084
More cleanup
travjenkins Apr 10, 2026
1314862
Hook no longer needed
travjenkins Apr 10, 2026
44a1427
No clue why I thought we could remove this
travjenkins Apr 10, 2026
90bbaa6
Adding support check wrapper around json test forms
travjenkins Apr 10, 2026
ee2a6c5
Hook not needed anymore
travjenkins Apr 10, 2026
13f2697
This is not needed for the test pages
travjenkins Apr 10, 2026
23997df
some formatting issues and ignoring storybook
travjenkins Apr 10, 2026
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
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
'__mocks__',
'playwright-tests/',
'src/gql-types/',
'storybook-static/',
],
plugins: ['formatjs', 'unused-imports', 'no-relative-import-paths'],
parserOptions: {
Expand Down
102 changes: 0 additions & 102 deletions src/api/connectors.ts

This file was deleted.

59 changes: 59 additions & 0 deletions src/api/gql/connectors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import type { ConnectorsGridQuery } from 'src/gql-types/graphql';

import { graphql } from 'src/gql-types';

export type ConnectorGridNode =
ConnectorsGridQuery['connectors']['edges'][number]['node'];

// TODO (GQL:Connector) - fine for now but this ignores pagination and just
// fetches 500 all at once
export const CONNECTORS_QUERY = graphql(`
query ConnectorsGrid($filter: ConnectorsFilter, $after: String) {
connectors(first: 500, after: $after, filter: $filter) {
edges {
cursor
node {
id
imageName
logoUrl
title
recommended
shortDescription
connectorTag(orDefault: true) {
id
connectorId
imageTag
documentationUrl
protocol
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`);

export const CONNECTOR_BY_ID_QUERY = graphql(`
query SingleConnector($id: Id!, $imageTag: String) {
connector(id: $id) {
id
imageName
logoUrl
title
connectorTag(imageTag: $imageTag, orDefault: true) {
id
connectorId
imageTag
defaultCaptureInterval
disableBackfill
documentationUrl
endpointSpecSchema
resourceSpecSchema
protocol
}
}
}
`);
19 changes: 0 additions & 19 deletions src/api/hydration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { ConnectorTagResourceData } from 'src/api/types';
import type {
LiveSpecsExt_MaterializeOrTransform,
LiveSpecsExtQuery,
Expand All @@ -13,24 +12,6 @@ import {
TABLES,
} from 'src/services/supabase';

// TODO (optimization): Consider removing the tight coupling between this file and the stores.
// These APIs are truly general purpose. Perhaps break them out by supabase table.
export const getSchema_Resource = async (connectorTagId: string | null) => {
const resourceSchema = await supabaseRetry(
() =>
supabaseClient
.from(TABLES.CONNECTOR_TAGS)
.select(
`default_capture_interval,disable_backfill,resource_spec_schema`
)
.eq('id', connectorTagId)
.single(),
'getSchema_Resource'
).then(handleSuccess<ConnectorTagResourceData>, handleFailure);

return resourceSchema;
};

const liveSpecColumns = `id,spec_type,spec,writes_to,reads_from,last_pub_id,updated_at`;

export const getLiveSpecsByLiveSpecId = async (
Expand Down
3 changes: 2 additions & 1 deletion src/api/liveSpecsExt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ export interface LiveSpecsExtQuery_ByLiveSpecId {
last_pub_id: string;
spec: any;
connector_id: string;
connector_image_tag: string;
}

const getLiveSpecsByLiveSpecId = async (liveSpecId: string) => {
Expand All @@ -430,7 +431,7 @@ const getLiveSpecsByLiveSpecId = async (liveSpecId: string) => {
supabaseClient
.from(TABLES.LIVE_SPECS_EXT)
.select(
'built_spec,catalog_name,id,spec_type,last_pub_id,spec,connector_id'
'built_spec,catalog_name,id,spec_type,last_pub_id,spec,connector_id,connector_image_tag'
)
.eq('id', liveSpecId),
'getLiveSpecsByLiveSpecId'
Expand Down
49 changes: 1 addition & 48 deletions src/api/types.ts
Original file line number Diff line number Diff line change
@@ -1,53 +1,6 @@
import type { CONNECTOR_NAME } from 'src/api/shared';
import type { Entity, EntityWithCreateWorkflow, Schema } from 'src/types';
import type { Entity } from 'src/types';
import type { AlertSubscription } from 'src/types/gql';

export interface BaseConnectorTag {
id: string;
connector_id: string;
image_tag: string;
}

export interface ConnectorTag extends BaseConnectorTag {
documentation_url: string;
endpoint_spec_schema: Schema;
image_name: string;
protocol: EntityWithCreateWorkflow;
title: string;
}

// This interface is only used to type the data returned by getSchema_Resource.
export interface ConnectorTagResourceData {
connector_id: string;
default_capture_interval: string | null;
disable_backfill: boolean;
resource_spec_schema: Schema;
}

export interface ConnectorWithTag {
connector_tags: ConnectorTag[];
id: string;
detail: string;
image_name: string;
image: string;
recommended: boolean;
title: string;
}

export interface ConnectorWithTagQuery extends ConnectorWithTag {
// FILTERING TYPES HACK
['connector_tags.protocol']: undefined;
['connector_tags.image_tag']: undefined;
[CONNECTOR_NAME]: undefined;
}

export interface ConnectorsQuery_DetailsForm {
id: string;
image_name: string;
image: string;
connector_tags: BaseConnectorTag[];
}

export interface DraftSpecData {
spec: any;
catalog_name?: string;
Expand Down
21 changes: 1 addition & 20 deletions src/components/capture/Create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import {
useEditorStore_id,
useEditorStore_persistedDraftId,
useEditorStore_queryResponse_mutate,
useEditorStore_setId,
} from 'src/components/editor/Store/hooks';
import EntityCreate from 'src/components/shared/Entity/Create';
import EntityToolbar from 'src/components/shared/Entity/Header';
import { MutateDraftSpecProvider } from 'src/components/shared/Entity/MutateDraftSpecContext';
import useValidConnectorsExist from 'src/hooks/connectors/useHasConnectors';
import useDraftSpecs from 'src/hooks/useDraftSpecs';
import usePageTitle from 'src/hooks/usePageTitle';
import { CustomEvents } from 'src/services/types';
Expand All @@ -28,19 +26,13 @@ function CaptureCreate() {
'https://docs.estuary.dev/guides/create-dataflow/#create-a-capture',
});

const hasConnectors = useValidConnectorsExist(entityType);

// Details Form Store
const imageTag = useDetailsFormStore(
(state) => state.details.data.connectorImage
);
const entityNameChanged = useDetailsFormStore(
(state) => state.entityNameChanged
);

// Draft Editor Store
const draftId = useEditorStore_id();
const setDraftId = useEditorStore_setId();
const persistedDraftId = useEditorStore_persistedDraftId();

// Endpoint Config Store
Expand All @@ -62,12 +54,6 @@ function CaptureCreate() {
}
}, [mutateDraftSpecs, mutate_advancedEditor]);

// Reset the catalog if the connector changes
useEffect(() => {
setDraftId(null);
setInitiateDiscovery(true);
}, [setDraftId, setInitiateDiscovery, imageTag]);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we prevented users from changing the connector awhile ago I think this is totally safe to remove.

// If the name changed we need to make sure we run discovery again
useEffect(() => {
if (entityNameChanged) {
Expand All @@ -91,13 +77,11 @@ function CaptureCreate() {
logEvent: CustomEvents.CAPTURE_CREATE,
}}
secondaryButtonProps={{
disabled: !hasConnectors,
logEvent: CustomEvents.CAPTURE_TEST,
}}
GenerateButton={
<CaptureGenerateButton
entityType={entityType}
disabled={!hasConnectors}
createWorkflowMetadata={{
initiateDiscovery,
setInitiateDiscovery,
Expand All @@ -107,10 +91,7 @@ function CaptureCreate() {
/>
}
RediscoverButton={
<RediscoverButton
entityType={entityType}
disabled={!hasConnectors}
/>
<RediscoverButton entityType={entityType} />
}
/>
</MutateDraftSpecProvider>
Expand Down
11 changes: 1 addition & 10 deletions src/components/capture/Edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import EntityEdit from 'src/components/shared/Entity/Edit';
import DraftInitializer from 'src/components/shared/Entity/Edit/DraftInitializer';
import EntityToolbar from 'src/components/shared/Entity/Header';
import { MutateDraftSpecProvider } from 'src/components/shared/Entity/MutateDraftSpecContext';
import useValidConnectorsExist from 'src/hooks/connectors/useHasConnectors';
import useGlobalSearchParams, {
GlobalSearchParams,
} from 'src/hooks/searchParams/useGlobalSearchParams';
Expand All @@ -30,9 +29,6 @@ function CaptureEdit() {

const lastPubId = useGlobalSearchParams(GlobalSearchParams.LAST_PUB_ID);

// Supabase
const hasConnectors = useValidConnectorsExist(entityType);

// Draft Editor Store
const draftId = useEditorStore_id();
const persistedDraftId = useEditorStore_persistedDraftId();
Expand Down Expand Up @@ -68,22 +64,17 @@ function CaptureEdit() {
logEvent: CustomEvents.CAPTURE_EDIT,
}}
secondaryButtonProps={{
disabled: !hasConnectors,
logEvent: CustomEvents.CAPTURE_TEST,
}}
GenerateButton={
<CaptureGenerateButton
entityType={entityType}
disabled={!hasConnectors}
/>
}
/>
}
RediscoverButton={
<RediscoverButton
entityType={entityType}
disabled={!hasConnectors}
/>
<RediscoverButton entityType={entityType} />
}
/>
</MutateDraftSpecProvider>
Expand Down
Loading
Loading