@galaxy-io/filament-ui 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/api/queries/connections.d.ts +4 -1
  2. package/dist/api/queries/connections.js +9 -3
  3. package/dist/api/queries/runs.d.ts +1 -1
  4. package/dist/components/connections/ConnectorCommandIcon.d.ts +13 -0
  5. package/dist/components/connections/ConnectorCommandIcon.js +40 -0
  6. package/dist/components/connections/ConnectorLogoTile.js +4 -16
  7. package/dist/components/connections/constants.d.ts +2 -0
  8. package/dist/components/connections/constants.js +6 -1
  9. package/dist/components/connections/hooks/useConnectorLogoURL.d.ts +5 -0
  10. package/dist/components/connections/hooks/useConnectorLogoURL.js +24 -0
  11. package/dist/module/FilamentLayout.js +10 -5
  12. package/dist/module/commands.js +13 -9
  13. package/dist/module/hooks.d.ts +7 -2
  14. package/dist/module/hooks.js +4 -5
  15. package/dist/module/paths.d.ts +3 -0
  16. package/dist/module/paths.js +17 -1
  17. package/dist/module/routes.d.ts +5 -0
  18. package/dist/module/schemas.d.ts +6 -0
  19. package/dist/module/schemas.js +6 -1
  20. package/dist/module/utils.d.ts +14 -0
  21. package/dist/module/utils.js +8 -0
  22. package/dist/pages/connections/ConnectionsPage.js +2 -2
  23. package/dist/pages/connections/components/create/configure/CreateConnectionConfigure.js +8 -14
  24. package/dist/pages/connections/components/create/select/CreateConnectionSelector.js +1 -1
  25. package/dist/pages/connections/components/create/select/CreateConnectionSelectorCard.js +1 -1
  26. package/dist/pages/connections/components/create/utils.d.ts +3 -0
  27. package/dist/pages/connections/components/create/utils.js +20 -1
  28. package/dist/pages/connections/components/drawer/ConnectionDrawerWebhook.js +1 -1
  29. package/dist/pages/connections/components/form/ConnectionForm.js +2 -2
  30. package/dist/pages/connections/components/form/ConnectionFormPreviewAlert.js +1 -1
  31. package/dist/pages/connections/constants.d.ts +0 -1
  32. package/dist/pages/connections/constants.js +1 -6
  33. package/dist/pages/observability/ObservabilityPage.js +11 -15
  34. package/dist/pages/observability/components/band/ObservabilityBand.js +19 -15
  35. package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasConnections.js +1 -1
  36. package/dist/pages/pipelines/components/create/CreatePipelineModal.d.ts +3 -0
  37. package/dist/pages/pipelines/components/create/CreatePipelineModal.js +27 -5
  38. package/dist/pages/pipelines/components/create/CreatePipelineModalProvider.d.ts +2 -1
  39. package/dist/pages/pipelines/components/create/CreatePipelineModalProvider.js +3 -3
  40. package/dist/pages/pipelines/components/create/hooks/useCreatePipelineModalCreateConnection.d.ts +2 -0
  41. package/dist/pages/pipelines/components/create/hooks/useCreatePipelineModalCreateConnection.js +19 -0
  42. package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalConnectionRow.js +2 -1
  43. package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalConnectionsPane.js +23 -11
  44. package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalConnectionsState.js +2 -6
  45. package/dist/pages/pipelines/components/create/types.d.ts +3 -0
  46. package/dist/pages/pipelines/components/create/utils.d.ts +8 -1
  47. package/dist/pages/pipelines/components/create/utils.js +29 -2
  48. package/dist/pages/pipelines/components/run/PipelineRunModal.d.ts +3 -0
  49. package/dist/pages/pipelines/components/run/PipelineRunModal.js +15 -9
  50. package/dist/pages/pipelines/components/run/types.d.ts +8 -0
  51. package/dist/pages/pipelines/components/run/utils.d.ts +6 -1
  52. package/dist/pages/pipelines/components/run/utils.js +12 -1
  53. package/dist/pages/pipelines/settings/PipelineSettingsPageDanger.js +1 -1
  54. package/dist/styles.css +1 -0
  55. package/package.json +1 -1
@@ -38,7 +38,10 @@ export declare const useSuspenseListConnectionsInfiniteQuery: ({ input, }?: {
38
38
  input?: InfiniteQueryInput<typeof IngestionService.method.listConnections.input>;
39
39
  }) => import('@tanstack/react-query').UseSuspenseInfiniteQueryResult<import('@tanstack/react-query').InfiniteData<ListConnectionsResponse, unknown>, import('@connectrpc/connect').ConnectError>;
40
40
  export declare const createGetConnectionInput: (id: Connection["id"]) => GetConnectionRequest;
41
- export declare const useGetConnectionQueries: (ids: Connection["id"][]) => Connection[];
41
+ export declare const useGetConnectionQueries: (ids: Connection["id"][], options?: Pick<UseQueryOptions<typeof IngestionService.method.getConnection.output>, "retry">) => {
42
+ connections: Connection[];
43
+ isLoading: boolean;
44
+ };
42
45
  export declare const useGetConnectionQuery: ({ input, options, }: {
43
46
  input: GetConnectionRequest;
44
47
  options?: UseQueryOptions<typeof IngestionService.method.getConnection.output, GetConnectionResponse>;
@@ -53,11 +53,17 @@ var createGetConnectionQueryKey = (input, transport) => {
53
53
  });
54
54
  };
55
55
  var createGetConnectionInput = (id) => create(GetConnectionRequestSchema, { id });
56
- var selectConnections = (results) => results.flatMap((result) => result.data?.connection ?? []);
57
- var useGetConnectionQueries = (ids) => {
56
+ var selectConnections = (results) => ({
57
+ connections: results.flatMap((result) => result.data?.connection ?? []),
58
+ isLoading: results.some((result) => result.isLoading)
59
+ });
60
+ var useGetConnectionQueries = (ids, options = {}) => {
58
61
  const transport = useTransport();
59
62
  return useQueries({
60
- queries: ids.map((id) => createQueryOptions(IngestionService.method.getConnection, createGetConnectionInput(id), { transport })),
63
+ queries: ids.map((id) => ({
64
+ ...createQueryOptions(IngestionService.method.getConnection, createGetConnectionInput(id), { transport }),
65
+ ...options
66
+ })),
61
67
  combine: selectConnections
62
68
  });
63
69
  };
@@ -5,7 +5,7 @@ import { GetRunRequest, GetRunResponse, ListRunsRequest, ListRunsResponse, RunEv
5
5
  import { IngestionService } from '../../gen/ingestion/v1/service_pb';
6
6
  import { InfiniteQueryInput, UseInfiniteQueryOptions } from '../utils';
7
7
  export declare const createListRunsQueryKey: (input?: ListRunsRequest, transport?: Transport) => import('@connectrpc/connect-query').ConnectQueryKey<Omit<import('@bufbuild/protobuf').DescMessage, "field" | "typeName"> & {
8
- field: Record<"pagination" | "runs", import('@bufbuild/protobuf').DescField>;
8
+ field: Record<"runs" | "pagination", import('@bufbuild/protobuf').DescField>;
9
9
  typeName: "ingestion.v1.ListRunsResponse";
10
10
  } & {
11
11
  readonly $codegenv2: {
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ import { Transport } from '@connectrpc/connect';
3
+ import { Icon as PhosphorIcon } from '@phosphor-icons/react';
4
+ import { ConnectorKind } from '../../gen/ingestion/v1/common_pb';
5
+ import { ConnectorSpec } from '../../gen/ingestion/v1/connectors_pb';
6
+ interface ConnectorCommandIconProps {
7
+ connector: ConnectorSpec["name"];
8
+ kind: ConnectorKind;
9
+ fallbackIcon: PhosphorIcon;
10
+ transport?: Transport;
11
+ }
12
+ declare const ConnectorCommandIcon: FC<ConnectorCommandIconProps>;
13
+ export default ConnectorCommandIcon;
@@ -0,0 +1,40 @@
1
+ import { GetConnectorRequestSchema } from "../../gen/ingestion/v1/connectors_pb.js";
2
+ import { useConnectorLogoURL } from "./hooks/useConnectorLogoURL.js";
3
+ import { useGetConnectorQuery } from "../../api/queries/connectors.js";
4
+ /* empty css */
5
+ import { create } from "@bufbuild/protobuf";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import Icon, { IconVariant } from "@galaxy-io/dls/icons/Icon";
8
+ import { styled } from "@linaria/react";
9
+ //#region src/components/connections/ConnectorCommandIcon.tsx
10
+ var ConnectorCommandLogo = /*#__PURE__*/ styled("img")({
11
+ name: "ConnectorCommandLogo",
12
+ class: "filament-ConnectorCommandIcon-ConnectorCommandLogo-c8phpdh",
13
+ propsAsIs: false
14
+ });
15
+ var ConnectorCommandIcon = ({ connector, kind, fallbackIcon, transport }) => {
16
+ const { data } = useGetConnectorQuery({
17
+ input: create(GetConnectorRequestSchema, {
18
+ connector,
19
+ kind
20
+ }),
21
+ options: {
22
+ enabled: !!connector,
23
+ transport
24
+ }
25
+ });
26
+ const { logoURL, handleLogoError } = useConnectorLogoURL(data?.connector?.darkLogoUrl, data?.connector?.lightLogoUrl);
27
+ if (!logoURL) return /* @__PURE__ */ jsx(Icon, {
28
+ component: fallbackIcon,
29
+ size: 14,
30
+ variant: IconVariant.SECONDARY,
31
+ "aria-hidden": true
32
+ });
33
+ return /* @__PURE__ */ jsx(ConnectorCommandLogo, {
34
+ src: logoURL,
35
+ alt: "",
36
+ onError: handleLogoError
37
+ });
38
+ };
39
+ //#endregion
40
+ export { ConnectorCommandIcon as default };
@@ -1,15 +1,13 @@
1
1
  import { ConnectorTileSize } from "./types.js";
2
2
  import { CONNECTOR_TILE_SIZE_TO_LOGO_HEIGHT_MAP, CONNECTOR_TILE_SIZE_TO_TEXT_SIZE_MAP } from "./constants.js";
3
3
  import ConnectorTileFrame from "./ConnectorTileFrame.js";
4
+ import { useConnectorLogoURL } from "./hooks/useConnectorLogoURL.js";
4
5
  /* empty css */
5
- import { useState } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
- import { match } from "ts-pattern";
8
7
  import Text, { TextVariant } from "@galaxy-io/dls/text/Text";
9
8
  import Icon, { IconVariant } from "@galaxy-io/dls/icons/Icon";
10
9
  import { styled } from "@linaria/react";
11
- import { FontFamily, GalaxyTheme } from "@galaxy-io/dls/theme/enums";
12
- import { useGalaxyTheme } from "@galaxy-io/dls/theme/useGalaxyTheme";
10
+ import { FontFamily } from "@galaxy-io/dls/theme/enums";
13
11
  //#region src/components/connections/ConnectorLogoTile.tsx
14
12
  var _exp2 = () => ({ $height }) => $height;
15
13
  var ConnectorLogo = /*#__PURE__*/ styled("img")({
@@ -23,18 +21,8 @@ var ConnectorLogoTileButton = /*#__PURE__*/ styled("button")({
23
21
  class: "filament-ConnectorLogoTile-ConnectorLogoTileButton-cb1a4l8",
24
22
  propsAsIs: false
25
23
  });
26
- var DEFAULT_STATE = {};
27
24
  var ConnectorLogoTile = ({ name, darkLogoUrl, lightLogoUrl, icon, size = ConnectorTileSize.MEDIUM, onClick, isDeleted = false, isLoading = false }) => {
28
- const { activeTheme } = useGalaxyTheme();
29
- const logoURL = match(activeTheme).with(GalaxyTheme.DARK, () => darkLogoUrl).with(GalaxyTheme.LIGHT, () => lightLogoUrl).exhaustive();
30
- const [state, setState] = useState(DEFAULT_STATE);
31
- const showLogo = !!logoURL && state.failedLogoURL !== logoURL;
32
- const handleLogoError = () => {
33
- setState((prev) => ({
34
- ...prev,
35
- failedLogoURL: logoURL
36
- }));
37
- };
25
+ const { logoURL, handleLogoError } = useConnectorLogoURL(darkLogoUrl, lightLogoUrl);
38
26
  const renderFallback = () => {
39
27
  if (isLoading) return null;
40
28
  if (icon) return /* @__PURE__ */ jsx(Icon, {
@@ -53,7 +41,7 @@ var ConnectorLogoTile = ({ name, darkLogoUrl, lightLogoUrl, icon, size = Connect
53
41
  $size: size,
54
42
  $isClickable: !!onClick,
55
43
  $isDeleted: isDeleted,
56
- children: showLogo ? /* @__PURE__ */ jsx(ConnectorLogo, {
44
+ children: logoURL ? /* @__PURE__ */ jsx(ConnectorLogo, {
57
45
  src: logoURL,
58
46
  alt: `${name} logo`,
59
47
  $height: CONNECTOR_TILE_SIZE_TO_LOGO_HEIGHT_MAP[size],
@@ -7,6 +7,7 @@ import { ConnectorTileSize } from './types';
7
7
  import { FilamentPath } from '../../module/paths';
8
8
  export declare const CONNECTOR_KIND_TO_LABEL_MAP: Record<ConnectorKind, string>;
9
9
  export declare const CONNECTOR_KIND_TO_PLURAL_LABEL_MAP: Record<ConnectorKind, string>;
10
+ export declare const CONNECTOR_KIND_TO_CREATE_TITLE_MAP: Record<ConnectorKind, string>;
10
11
  export declare const CONNECTOR_KIND_TO_NOUN_MAP: Record<ConnectorKind, string>;
11
12
  export declare const CONNECTOR_KIND_TO_PLURAL_NOUN_MAP: Record<ConnectorKind, string>;
12
13
  export declare const CONNECTOR_KIND_TO_CHIP_COLOR_MAP: Record<ConnectorKind, {
@@ -17,5 +18,6 @@ export declare const CONNECTOR_KIND_TO_CHIP_COLOR_MAP: Record<ConnectorKind, {
17
18
  export declare const CONNECTOR_KIND_TO_PATH_MAP: Record<ConnectorKind, FilamentPath>;
18
19
  export declare const CONNECTOR_TILE_SIZE_TO_SIZE_MAP: Record<ConnectorTileSize, number>;
19
20
  export declare const CONNECTOR_TILE_SIZE_TO_SKELETON_SIZE_MAP: Record<ConnectorTileSize, SkeletonSize>;
21
+ export declare const CONNECTOR_COMMAND_ICON_SIZE = 14;
20
22
  export declare const CONNECTOR_TILE_SIZE_TO_LOGO_HEIGHT_MAP: Record<ConnectorTileSize, number>;
21
23
  export declare const CONNECTOR_TILE_SIZE_TO_TEXT_SIZE_MAP: Record<ConnectorTileSize, TextSize>;
@@ -16,6 +16,11 @@ var CONNECTOR_KIND_TO_PLURAL_LABEL_MAP = {
16
16
  [ConnectorKind.SOURCE]: "Sources",
17
17
  [ConnectorKind.SINK]: "Sinks"
18
18
  };
19
+ var CONNECTOR_KIND_TO_CREATE_TITLE_MAP = {
20
+ [ConnectorKind.UNSPECIFIED]: "New connection",
21
+ [ConnectorKind.SOURCE]: "New source",
22
+ [ConnectorKind.SINK]: "New sink"
23
+ };
19
24
  var CONNECTOR_KIND_TO_NOUN_MAP = {
20
25
  [ConnectorKind.UNSPECIFIED]: EMPTY_VALUE,
21
26
  [ConnectorKind.SOURCE]: "source",
@@ -57,4 +62,4 @@ var CONNECTOR_TILE_SIZE_TO_TEXT_SIZE_MAP = {
57
62
  [ConnectorTileSize.LARGE]: TextSize.BODY_LG
58
63
  };
59
64
  //#endregion
60
- export { CONNECTOR_KIND_TO_CHIP_COLOR_MAP, CONNECTOR_KIND_TO_LABEL_MAP, CONNECTOR_KIND_TO_NOUN_MAP, CONNECTOR_KIND_TO_PATH_MAP, CONNECTOR_KIND_TO_PLURAL_LABEL_MAP, CONNECTOR_KIND_TO_PLURAL_NOUN_MAP, CONNECTOR_TILE_SIZE_TO_LOGO_HEIGHT_MAP, CONNECTOR_TILE_SIZE_TO_SIZE_MAP, CONNECTOR_TILE_SIZE_TO_SKELETON_SIZE_MAP, CONNECTOR_TILE_SIZE_TO_TEXT_SIZE_MAP };
65
+ export { CONNECTOR_KIND_TO_CHIP_COLOR_MAP, CONNECTOR_KIND_TO_CREATE_TITLE_MAP, CONNECTOR_KIND_TO_LABEL_MAP, CONNECTOR_KIND_TO_NOUN_MAP, CONNECTOR_KIND_TO_PATH_MAP, CONNECTOR_KIND_TO_PLURAL_LABEL_MAP, CONNECTOR_KIND_TO_PLURAL_NOUN_MAP, CONNECTOR_TILE_SIZE_TO_LOGO_HEIGHT_MAP, CONNECTOR_TILE_SIZE_TO_SIZE_MAP, CONNECTOR_TILE_SIZE_TO_SKELETON_SIZE_MAP, CONNECTOR_TILE_SIZE_TO_TEXT_SIZE_MAP };
@@ -0,0 +1,5 @@
1
+ import { ConnectorSpec } from '../../../gen/ingestion/v1/connectors_pb';
2
+ export declare const useConnectorLogoURL: (darkLogoUrl?: ConnectorSpec["darkLogoUrl"], lightLogoUrl?: ConnectorSpec["lightLogoUrl"]) => {
3
+ logoURL: string | undefined;
4
+ handleLogoError: () => void;
5
+ };
@@ -0,0 +1,24 @@
1
+ import { useState } from "react";
2
+ import { match } from "ts-pattern";
3
+ import { GalaxyTheme } from "@galaxy-io/dls/theme/enums";
4
+ import { useGalaxyTheme } from "@galaxy-io/dls/theme/useGalaxyTheme";
5
+ //#region src/components/connections/hooks/useConnectorLogoURL.ts
6
+ var DEFAULT_STATE = {};
7
+ var useConnectorLogoURL = (darkLogoUrl, lightLogoUrl) => {
8
+ const { activeTheme } = useGalaxyTheme();
9
+ const [state, setState] = useState(DEFAULT_STATE);
10
+ const themeLogoURL = match(activeTheme).with(GalaxyTheme.DARK, () => darkLogoUrl).with(GalaxyTheme.LIGHT, () => lightLogoUrl).exhaustive();
11
+ const logoURL = themeLogoURL && themeLogoURL !== state.failedLogoURL ? themeLogoURL : void 0;
12
+ const handleLogoError = () => {
13
+ setState((prev) => ({
14
+ ...prev,
15
+ failedLogoURL: themeLogoURL
16
+ }));
17
+ };
18
+ return {
19
+ logoURL,
20
+ handleLogoError
21
+ };
22
+ };
23
+ //#endregion
24
+ export { useConnectorLogoURL };
@@ -1,6 +1,7 @@
1
1
  import { Flow } from "./types.js";
2
2
  import { useFilamentLayoutSearch, useFilamentSearchUpdate } from "./hooks.js";
3
3
  import MainLayout from "../layouts/main/MainLayout.js";
4
+ import { createFilamentFlowCloseSearch } from "./utils.js";
4
5
  import CreateConnectionModal from "../pages/connections/components/create/CreateConnectionModal.js";
5
6
  import ConnectionDrawer from "../pages/connections/components/drawer/ConnectionDrawer.js";
6
7
  import EditConnectionModal from "../pages/connections/components/edit/EditConnectionModal.js";
@@ -12,7 +13,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
13
  //#region src/module/FilamentLayout.tsx
13
14
  var FilamentLayout = ({ sidebarFooter }) => {
14
15
  const updateSearch = useFilamentSearchUpdate();
15
- const { connectionId, pipelineId, flow, connector, connectorKind, connectorSearch } = useFilamentLayoutSearch();
16
+ const { connectionId, pipelineId, flow, connector, connectorKind, connectorSearch, sourceId, sinkIds, resources, resyncResources } = useFilamentLayoutSearch();
16
17
  const handleCloseDrawer = useCallback(() => {
17
18
  updateSearch((prev) => {
18
19
  const { connectionId: _, connector: __, connectorKind: ___, flow: prevFlow, ...rest } = prev;
@@ -23,10 +24,10 @@ var FilamentLayout = ({ sidebarFooter }) => {
23
24
  }, { replace: true });
24
25
  }, [updateSearch]);
25
26
  const handleCloseFlow = useCallback(() => {
26
- updateSearch((prev) => {
27
- const { flow: _, connector: __, connectorKind: ___, connectorSearch: ____, pipelineId: _____, ...rest } = prev;
28
- return rest;
29
- }, { replace: true });
27
+ updateSearch((prev) => ({
28
+ ...prev,
29
+ ...createFilamentFlowCloseSearch(prev)
30
+ }), { replace: true });
30
31
  }, [updateSearch]);
31
32
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
32
33
  /* @__PURE__ */ jsx(MainLayout, {
@@ -52,11 +53,15 @@ var FilamentLayout = ({ sidebarFooter }) => {
52
53
  }),
53
54
  /* @__PURE__ */ jsx(CreatePipelineModal, {
54
55
  isOpen: flow === Flow.CREATE_PIPELINE,
56
+ sourceId,
57
+ sinkIds,
55
58
  onClose: handleCloseFlow
56
59
  }),
57
60
  /* @__PURE__ */ jsx(PipelineRunModal, {
58
61
  isOpen: flow === Flow.RUN_PIPELINE && !!pipelineId,
59
62
  pipelineId,
63
+ resources,
64
+ resyncResources,
60
65
  onClose: handleCloseFlow
61
66
  })
62
67
  ] });
@@ -1,19 +1,20 @@
1
- import { FilamentPath } from "./paths.js";
1
+ import { FilamentPath, createFilamentFlowSearch } from "./paths.js";
2
2
  import { ConnectorKind } from "../gen/ingestion/v1/common_pb.js";
3
3
  import { FilamentNavItem, Flow } from "./types.js";
4
4
  import { useFilamentFlowOpen, useFilamentMountedBase, useFilamentSearchUpdate } from "./hooks.js";
5
5
  import { FILAMENT_NAV_ITEMS, FILAMENT_NAV_ITEM_TO_COMMAND_ID_MAP, FILAMENT_NAV_ITEM_TO_ICON_MAP, FILAMENT_NAV_ITEM_TO_KEYWORDS_MAP, FILAMENT_NAV_ITEM_TO_LABEL_MAP, FILAMENT_NAV_ITEM_TO_PATH_MAP } from "./nav.js";
6
- import { CONNECTOR_KIND_TO_PATH_MAP } from "../components/connections/constants.js";
6
+ import { CONNECTOR_KIND_TO_CREATE_TITLE_MAP, CONNECTOR_KIND_TO_PATH_MAP } from "../components/connections/constants.js";
7
7
  import { useListConnectionsQuery } from "../api/queries/connections.js";
8
- import { CONNECTOR_KIND_TO_CREATE_TITLE_MAP } from "../pages/connections/constants.js";
9
8
  import { PIPELINE_CREATE_TITLE } from "../components/pipelines/constants.js";
10
9
  import { formatPipelineName } from "../components/pipelines/utils.js";
11
10
  import { useListPipelinesQuery } from "../api/queries/pipelines.js";
11
+ import ConnectorCommandIcon from "../components/connections/ConnectorCommandIcon.js";
12
12
  import { FILAMENT_COMMAND_GROUP_CONNECTIONS, FILAMENT_COMMAND_GROUP_CREATE, FILAMENT_COMMAND_GROUP_GO_TO, FILAMENT_COMMAND_GROUP_PIPELINES, FILAMENT_CONNECTOR_KIND_TO_CREATE_COMMAND_ID_MAP, FILAMENT_CONNECTOR_KIND_TO_NAV_ITEM_MAP } from "./constants.js";
13
13
  import { PlusIcon } from "@phosphor-icons/react";
14
14
  import { useMemo } from "react";
15
15
  import { useNavigate } from "@tanstack/react-router";
16
- //#region src/module/commands.ts
16
+ import { jsx } from "react/jsx-runtime";
17
+ //#region src/module/commands.tsx
17
18
  var ROOT_PATH = "/";
18
19
  var CREATE_CONNECTOR_KINDS = [ConnectorKind.SOURCE, ConnectorKind.SINK];
19
20
  var useFilamentCommandItems = ({ base, transport } = {}) => {
@@ -42,10 +43,7 @@ var useFilamentCommandItems = ({ base, transport } = {}) => {
42
43
  openFlow(flow, { connectorKind });
43
44
  return;
44
45
  }
45
- navigateFromBase(to, { search: {
46
- flow,
47
- connectorKind
48
- } });
46
+ navigateFromBase(to, { search: createFilamentFlowSearch(flow, { connectorKind }) });
49
47
  };
50
48
  const openConnection = (connectionId, kind) => {
51
49
  if (mountedBase) {
@@ -92,13 +90,19 @@ var useFilamentCommandItems = ({ base, transport } = {}) => {
92
90
  id: `connection-${connection.id}`,
93
91
  label: connection.name,
94
92
  description: connection.connector,
95
- icon: FILAMENT_NAV_ITEM_TO_ICON_MAP[FILAMENT_CONNECTOR_KIND_TO_NAV_ITEM_MAP[connection.kind]],
93
+ leading: /* @__PURE__ */ jsx(ConnectorCommandIcon, {
94
+ connector: connection.connector,
95
+ kind: connection.kind,
96
+ fallbackIcon: FILAMENT_NAV_ITEM_TO_ICON_MAP[FILAMENT_CONNECTOR_KIND_TO_NAV_ITEM_MAP[connection.kind]],
97
+ transport
98
+ }),
96
99
  group: FILAMENT_COMMAND_GROUP_CONNECTIONS,
97
100
  onSelect: () => openConnection(connection.id, connection.kind)
98
101
  }))
99
102
  ];
100
103
  }, [
101
104
  base,
105
+ transport,
102
106
  mountedBase,
103
107
  navigate,
104
108
  openFlow,
@@ -1,6 +1,6 @@
1
1
  import { UseNavigateResult } from '@tanstack/react-router';
2
2
  import { FilamentPath } from './paths';
3
- import { FilamentLayoutSearch } from './schemas';
3
+ import { FilamentFlowSeed } from './schemas';
4
4
  import { Flow } from './types';
5
5
  declare const ROOT_PATH = "/";
6
6
  interface FilamentSearchUpdateOptions {
@@ -14,7 +14,7 @@ export declare const useFilamentMountedBase: () => string | undefined;
14
14
  export declare const useFilamentBase: (fallback?: string) => typeof ROOT_PATH;
15
15
  export declare const useFilamentNavigate: (fallback?: string) => UseNavigateResult<typeof ROOT_PATH>;
16
16
  export declare const useFilamentSearchUpdate: <TSearch extends object>() => (update: (prev: TSearch) => TSearch, { replace }?: FilamentSearchUpdateOptions) => Promise<void>;
17
- export declare const useFilamentFlowOpen: () => (flow: Flow, { connectorKind, pipelineId, }?: Pick<FilamentLayoutSearch, "connectorKind" | "pipelineId">) => undefined;
17
+ export declare const useFilamentFlowOpen: () => (flow: Flow, seed?: FilamentFlowSeed) => undefined;
18
18
  export declare const useFilamentMatchRoute: () => (to: FilamentPath, { params, fuzzy }?: FilamentMatchRouteOptions) => boolean;
19
19
  export declare const useFilamentLayoutSearch: () => {
20
20
  flow?: Flow | undefined;
@@ -23,6 +23,11 @@ export declare const useFilamentLayoutSearch: () => {
23
23
  connectorKind?: import('../gen/ingestion/v1/common_pb').ConnectorKind | undefined;
24
24
  connector?: string | undefined;
25
25
  connectorSearch?: string | undefined;
26
+ sourceId?: string | undefined;
27
+ sinkIds?: string[] | undefined;
28
+ resources?: string[] | undefined;
29
+ resyncResources?: string[] | undefined;
30
+ returnFlow?: Flow.CREATE_PIPELINE | undefined;
26
31
  };
27
32
  export declare const useTeamSearch: () => {
28
33
  view?: import('../pages/settings/types').SettingsTeamView | undefined;
@@ -1,3 +1,4 @@
1
+ import { createFilamentFlowSearch } from "./paths.js";
1
2
  import { OBSERVABILITY_RUNS_DEFAULT_STATUSES } from "../pages/observability/components/runs/constants.js";
2
3
  import { OBSERVABILITY_BAND_PIVOT_KEY_TO_DEFAULT_MAP, OBSERVABILITY_BAND_VIEW_KEY_TO_DEFAULT_MAP, OBSERVABILITY_DEFAULT_REFRESH_INTERVAL, OBSERVABILITY_DEFAULT_RUNS_VIEW, OBSERVABILITY_DEFAULT_TIMEFRAME } from "../pages/observability/constants.js";
3
4
  import { connectionsSearchSchema, filamentLayoutSearchSchema, listSearchParamsSchema, observabilitySearchSchema, pipelineCanvasSearchSchema, pipelineHistorySearchSchema, pipelineParamsSchema, pipelineSearchSchema, pipelinesSearchSchema } from "./schemas.js";
@@ -21,12 +22,10 @@ var useFilamentSearchUpdate = () => {
21
22
  };
22
23
  var useFilamentFlowOpen = () => {
23
24
  const updateSearch = useFilamentSearchUpdate();
24
- return useCallback((flow, { connectorKind, pipelineId } = {}) => void updateSearch((prev) => ({
25
+ return useCallback((flow, seed) => void updateSearch((prev) => ({
25
26
  ...prev,
26
- connectionId: void 0,
27
- flow,
28
- connectorKind,
29
- pipelineId
27
+ ...createFilamentFlowSearch(flow, seed),
28
+ connectionId: void 0
30
29
  })), [updateSearch]);
31
30
  };
32
31
  var useFilamentMatchRoute = () => {
@@ -1,3 +1,5 @@
1
+ import { FilamentFlowSeed, FilamentLayoutSearch } from './schemas';
2
+ import { Flow } from './types';
1
3
  export declare enum FilamentPath {
2
4
  OBSERVABILITY = "./observability",
3
5
  PIPELINES = "./pipelines",
@@ -11,3 +13,4 @@ export declare enum FilamentPath {
11
13
  SETTINGS_SERVICE_ACCOUNTS = "./settings/service-accounts"
12
14
  }
13
15
  export declare const createFilamentHref: (path: FilamentPath, params?: Record<string, string>) => string;
16
+ export declare const createFilamentFlowSearch: (flow?: Flow, seed?: FilamentFlowSeed) => Omit<FilamentLayoutSearch, "connectionId">;
@@ -13,5 +13,21 @@ var FilamentPath = /* @__PURE__ */ function(FilamentPath) {
13
13
  return FilamentPath;
14
14
  }({});
15
15
  var createFilamentHref = (path, params = {}) => path.replace(/\$(\w+)/g, (_, key) => encodeURIComponent(params[key] ?? ""));
16
+ var FILAMENT_FLOW_SEARCH_RESET = {
17
+ connector: void 0,
18
+ connectorKind: void 0,
19
+ connectorSearch: void 0,
20
+ pipelineId: void 0,
21
+ sourceId: void 0,
22
+ sinkIds: void 0,
23
+ resources: void 0,
24
+ resyncResources: void 0,
25
+ returnFlow: void 0
26
+ };
27
+ var createFilamentFlowSearch = (flow, seed = {}) => ({
28
+ ...FILAMENT_FLOW_SEARCH_RESET,
29
+ ...seed,
30
+ flow
31
+ });
16
32
  //#endregion
17
- export { FilamentPath, createFilamentHref };
33
+ export { FilamentPath, createFilamentFlowSearch, createFilamentHref };
@@ -12,6 +12,11 @@ export declare const filamentLayoutRouteOptions: FilamentRouteComponents & {
12
12
  connectorKind: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodEnum<typeof import('../gen/ingestion/v1/common_pb').ConnectorKind>>>;
13
13
  connector: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodString>>;
14
14
  connectorSearch: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodString>>;
15
+ sourceId: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodString>>;
16
+ sinkIds: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString>>>;
17
+ resources: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString>>>;
18
+ resyncResources: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString>>>;
19
+ returnFlow: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodLiteral<import('./types').Flow.CREATE_PIPELINE>>>;
15
20
  }, import('zod/v4/core').$strip>;
16
21
  staticData: {
17
22
  filament: boolean;
@@ -20,8 +20,14 @@ export declare const filamentLayoutSearchSchema: z.ZodObject<{
20
20
  connectorKind: z.ZodCatch<z.ZodOptional<z.ZodEnum<typeof ConnectorKind>>>;
21
21
  connector: z.ZodCatch<z.ZodOptional<z.ZodString>>;
22
22
  connectorSearch: z.ZodCatch<z.ZodOptional<z.ZodString>>;
23
+ sourceId: z.ZodCatch<z.ZodOptional<z.ZodString>>;
24
+ sinkIds: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
25
+ resources: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
26
+ resyncResources: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
27
+ returnFlow: z.ZodCatch<z.ZodOptional<z.ZodLiteral<Flow.CREATE_PIPELINE>>>;
23
28
  }, z.core.$strip>;
24
29
  export type FilamentLayoutSearch = z.infer<typeof filamentLayoutSearchSchema>;
30
+ export type FilamentFlowSeed = Omit<FilamentLayoutSearch, "flow" | "connectionId">;
25
31
  export declare const teamSearchSchema: z.ZodObject<{
26
32
  view: z.ZodCatch<z.ZodOptional<z.ZodEnum<typeof SettingsTeamView>>>;
27
33
  inviteToken: z.ZodCatch<z.ZodOptional<z.ZodString>>;
@@ -19,7 +19,12 @@ var filamentLayoutSearchSchema = z.object({
19
19
  pipelineId: z.string().optional().catch(void 0),
20
20
  connectorKind: z.enum(ConnectorKind).optional().catch(void 0),
21
21
  connector: z.string().optional().catch(void 0),
22
- connectorSearch: z.string().optional().catch(void 0)
22
+ connectorSearch: z.string().optional().catch(void 0),
23
+ sourceId: z.string().optional().catch(void 0),
24
+ sinkIds: z.array(z.string()).optional().catch(void 0),
25
+ resources: z.array(z.string()).optional().catch(void 0),
26
+ resyncResources: z.array(z.string()).optional().catch(void 0),
27
+ returnFlow: z.literal(Flow.CREATE_PIPELINE).optional().catch(void 0)
23
28
  });
24
29
  z.object({
25
30
  view: z.enum(SettingsTeamView).optional().catch(void 0),
@@ -0,0 +1,14 @@
1
+ import { FilamentLayoutSearch } from './schemas';
2
+ export declare const createFilamentFlowCloseSearch: ({ returnFlow, sourceId, sinkIds, }: FilamentLayoutSearch) => Omit<{
3
+ flow?: import('./types').Flow | undefined;
4
+ connectionId?: string | undefined;
5
+ pipelineId?: string | undefined;
6
+ connectorKind?: import('../gen/ingestion/v1/common_pb').ConnectorKind | undefined;
7
+ connector?: string | undefined;
8
+ connectorSearch?: string | undefined;
9
+ sourceId?: string | undefined;
10
+ sinkIds?: string[] | undefined;
11
+ resources?: string[] | undefined;
12
+ resyncResources?: string[] | undefined;
13
+ returnFlow?: import('./types').Flow.CREATE_PIPELINE | undefined;
14
+ }, "connectionId">;
@@ -0,0 +1,8 @@
1
+ import { createFilamentFlowSearch } from "./paths.js";
2
+ //#region src/module/utils.ts
3
+ var createFilamentFlowCloseSearch = ({ returnFlow, sourceId, sinkIds }) => returnFlow ? createFilamentFlowSearch(returnFlow, {
4
+ sourceId,
5
+ sinkIds
6
+ }) : createFilamentFlowSearch();
7
+ //#endregion
8
+ export { createFilamentFlowCloseSearch };
@@ -1,9 +1,9 @@
1
1
  import { ConnectorKind } from "../../gen/ingestion/v1/common_pb.js";
2
2
  import { Flow } from "../../module/types.js";
3
3
  import { useConnectionsSearch, useFilamentFlowOpen, useFilamentSearchUpdate } from "../../module/hooks.js";
4
- import { CONNECTOR_KIND_TO_PLURAL_LABEL_MAP, CONNECTOR_KIND_TO_PLURAL_NOUN_MAP } from "../../components/connections/constants.js";
4
+ import { CONNECTOR_KIND_TO_CREATE_TITLE_MAP, CONNECTOR_KIND_TO_PLURAL_LABEL_MAP, CONNECTOR_KIND_TO_PLURAL_NOUN_MAP } from "../../components/connections/constants.js";
5
5
  import { createListConnectionsInput, useSuspenseListConnectionsInfiniteQuery } from "../../api/queries/connections.js";
6
- import { CONNECTOR_KIND_TO_CREATE_TITLE_MAP, CONNECTOR_KIND_TO_DOCS_PATH_MAP, CONNECTOR_KIND_TO_EMPTY_MESSAGE_MAP } from "./constants.js";
6
+ import { CONNECTOR_KIND_TO_DOCS_PATH_MAP, CONNECTOR_KIND_TO_EMPTY_MESSAGE_MAP } from "./constants.js";
7
7
  import DocsLink from "../../components/DocsLink.js";
8
8
  import { useConnectionPipelines } from "./hooks/useConnectionPipelines.js";
9
9
  import ListSearch from "../../components/ListSearch.js";
@@ -1,6 +1,7 @@
1
1
  import { useFilamentSearchUpdate } from "../../../../../module/hooks.js";
2
2
  import { CreateConnectionRequestSchema } from "../../../../../gen/ingestion/v1/connections_pb.js";
3
3
  import { isWebhookConnector } from "../../../../../components/webhooks/utils.js";
4
+ import { createConnectionCreatedSearch } from "../utils.js";
4
5
  import { ConnectionFormPhase } from "../../form/types.js";
5
6
  import ConnectionFormProvider, { useConnectionFormActions, useConnectionFormState } from "../../form/ConnectionFormProvider.js";
6
7
  import { getErrorMessage } from "../../../../../utils/errors.js";
@@ -22,15 +23,8 @@ var CreateConnectionConfigureContent = ({ isOpen, connector, connectorKind: kind
22
23
  const [reveal, setReveal] = useState();
23
24
  const { mutate: createConnection } = useCreateConnectionMutation();
24
25
  const { mintKey } = useConnectionWebhookKeyMint();
25
- const openConnection = useCallback((connectionId) => {
26
- updateSearch((prev) => ({
27
- ...prev,
28
- flow: void 0,
29
- connector: void 0,
30
- connectorKind: void 0,
31
- connectorSearch: void 0,
32
- connectionId
33
- }));
26
+ const completeCreate = useCallback((connection) => {
27
+ updateSearch((prev) => createConnectionCreatedSearch(prev, connection));
34
28
  }, [updateSearch]);
35
29
  const mintSigningKey = useCallback((connection) => {
36
30
  mintKey(connection, void 0, {
@@ -41,13 +35,13 @@ var CreateConnectionConfigureContent = ({ isOpen, connector, connectorKind: kind
41
35
  header: "Connection created without a signing key",
42
36
  description: getErrorMessage(error, "Failed to generate a signing key")
43
37
  });
44
- openConnection(connection.id);
38
+ completeCreate(connection);
45
39
  }
46
40
  });
47
41
  }, [
48
42
  mintKey,
49
43
  toast,
50
- openConnection
44
+ completeCreate
51
45
  ]);
52
46
  const handleCreateConnection = useCallback((config) => {
53
47
  const name = state.name.trim();
@@ -70,7 +64,7 @@ var CreateConnectionConfigureContent = ({ isOpen, connector, connectorKind: kind
70
64
  mintSigningKey(connection);
71
65
  return;
72
66
  }
73
- openConnection(connection.id);
67
+ completeCreate(connection);
74
68
  },
75
69
  onError: (error) => {
76
70
  setPhase(ConnectionFormPhase.ERROR);
@@ -89,7 +83,7 @@ var CreateConnectionConfigureContent = ({ isOpen, connector, connectorKind: kind
89
83
  toast,
90
84
  setPhase,
91
85
  mintSigningKey,
92
- openConnection
86
+ completeCreate
93
87
  ]);
94
88
  const handleConnectorVersionChange = useCallback((version) => {
95
89
  updateSearch((prev) => ({
@@ -100,7 +94,7 @@ var CreateConnectionConfigureContent = ({ isOpen, connector, connectorKind: kind
100
94
  if (reveal) return /* @__PURE__ */ jsx(ConnectionFormSigningKeyModal, {
101
95
  isOpen,
102
96
  reveal,
103
- onDone: () => openConnection(reveal.connection.id)
97
+ onDone: () => completeCreate(reveal.connection)
104
98
  });
105
99
  return /* @__PURE__ */ jsx(ConnectionForm, {
106
100
  isOpen,
@@ -1,6 +1,6 @@
1
1
  import { useFilamentSearchUpdate } from "../../../../../module/hooks.js";
2
2
  import { CreateConnectionSelectorShelf } from "../types.js";
3
- import { CONNECTOR_KIND_TO_CREATE_TITLE_MAP } from "../../../constants.js";
3
+ import { CONNECTOR_KIND_TO_CREATE_TITLE_MAP } from "../../../../../components/connections/constants.js";
4
4
  import CreateConnectionSelectorBody from "./CreateConnectionSelectorBody.js";
5
5
  import CreateConnectionSelectorSidebar from "./CreateConnectionSelectorSidebar.js";
6
6
  import { useCreateConnectionSelectorCatalog } from "./hooks/useCreateConnectionSelectorCatalog.js";
@@ -1,5 +1,5 @@
1
- import { ConnectorTileSize } from "../../../../../components/connections/types.js";
2
1
  import { formatConnectorName } from "../../../../../components/connections/utils.js";
2
+ import { ConnectorTileSize } from "../../../../../components/connections/types.js";
3
3
  import ConnectorTile from "../../../../../components/connections/ConnectorTile.js";
4
4
  import ConnectionKindChip from "../../../../../components/connections/ConnectionKindChip.js";
5
5
  import ConnectorPreviewChip from "../../../../../components/connections/ConnectorPreviewChip.js";
@@ -1,4 +1,7 @@
1
+ import { Connection } from '../../../../gen/ingestion/v1/connections_pb';
1
2
  import { ConnectorSpec } from '../../../../gen/ingestion/v1/connectors_pb';
2
3
  import { CreateConnectionSelectorShelf } from './types';
4
+ import { FilamentLayoutSearch } from '../../../../module/schemas';
3
5
  export declare const getConnectorVersions: (family: ConnectorSpec, catalog: ConnectorSpec[]) => ConnectorSpec[];
4
6
  export declare const isConnectorOnShelf: (connector: ConnectorSpec, shelf: CreateConnectionSelectorShelf) => boolean;
7
+ export declare const createConnectionCreatedSearch: (prev: FilamentLayoutSearch, connection: Connection) => FilamentLayoutSearch;
@@ -1,9 +1,28 @@
1
+ import { createFilamentFlowSearch } from "../../../../module/paths.js";
2
+ import { ConnectorKind } from "../../../../gen/ingestion/v1/common_pb.js";
1
3
  import { getConnectorVersionPrefix } from "../../../../components/connections/utils.js";
2
4
  import { CreateConnectionSelectorShelf } from "./types.js";
5
+ import { createFilamentFlowCloseSearch } from "../../../../module/utils.js";
6
+ import { match } from "ts-pattern";
3
7
  //#region src/pages/connections/components/create/utils.ts
4
8
  var getConnectorVersions = (family, catalog) => family.aliasTarget ? catalog.filter((candidate) => candidate.kind === family.kind && !candidate.aliasTarget && candidate.name.startsWith(getConnectorVersionPrefix(family))) : [];
5
9
  var isConnectorOnShelf = (connector, shelf) => {
6
10
  return shelf === CreateConnectionSelectorShelf.ALL || connector.isPreview;
7
11
  };
12
+ var addConnectionToFlowSeed = (search, connection) => match(connection.kind).with(ConnectorKind.SOURCE, () => ({
13
+ ...search,
14
+ sourceId: connection.id
15
+ })).with(ConnectorKind.SINK, () => ({
16
+ ...search,
17
+ sinkIds: [...search.sinkIds ?? [], connection.id]
18
+ })).otherwise(() => search);
19
+ var createConnectionCreatedSearch = (prev, connection) => prev.returnFlow ? {
20
+ ...prev,
21
+ ...createFilamentFlowCloseSearch(addConnectionToFlowSeed(prev, connection))
22
+ } : {
23
+ ...prev,
24
+ ...createFilamentFlowSearch(),
25
+ connectionId: connection.id
26
+ };
8
27
  //#endregion
9
- export { getConnectorVersions, isConnectorOnShelf };
28
+ export { createConnectionCreatedSearch, getConnectorVersions, isConnectorOnShelf };
@@ -62,7 +62,7 @@ var ConnectionDrawerWebhook = ({ connection }) => {
62
62
  children: [NEEDS_PIPELINE_STATUSES.has(status) && /* @__PURE__ */ jsx(Button, {
63
63
  label: "Create pipeline",
64
64
  size: ButtonSize.SMALL,
65
- onClick: () => openFlow(Flow.CREATE_PIPELINE)
65
+ onClick: () => openFlow(Flow.CREATE_PIPELINE, { sourceId: connection.id })
66
66
  }), /* @__PURE__ */ jsx(DocsLink, {
67
67
  label: "Setup guide",
68
68
  path: WEBHOOK_DOCS_PATH,