@galaxy-io/filament-ui 0.14.0 → 0.16.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 (66) hide show
  1. package/README.md +8 -1
  2. package/dist/api/queries/connections.d.ts +4 -1
  3. package/dist/api/queries/connections.js +9 -3
  4. package/dist/api/queries/runs.d.ts +1 -1
  5. package/dist/components/connections/ConnectorCommandIcon.d.ts +13 -0
  6. package/dist/components/connections/ConnectorCommandIcon.js +40 -0
  7. package/dist/components/connections/ConnectorLogoTile.js +4 -16
  8. package/dist/components/connections/constants.d.ts +2 -0
  9. package/dist/components/connections/constants.js +6 -1
  10. package/dist/components/connections/hooks/useConnectorLogoURL.d.ts +5 -0
  11. package/dist/components/connections/hooks/useConnectorLogoURL.js +24 -0
  12. package/dist/module/FilamentLayout.d.ts +2 -0
  13. package/dist/module/FilamentLayout.js +49 -39
  14. package/dist/module/GalaxyProductsProvider.d.ts +8 -0
  15. package/dist/module/GalaxyProductsProvider.js +11 -0
  16. package/dist/module/commands.js +14 -10
  17. package/dist/module/constants.d.ts +2 -1
  18. package/dist/module/constants.js +3 -2
  19. package/dist/module/hooks.d.ts +7 -2
  20. package/dist/module/hooks.js +4 -5
  21. package/dist/module/nav.js +1 -1
  22. package/dist/module/paths.d.ts +5 -0
  23. package/dist/module/paths.js +18 -1
  24. package/dist/module/routes.d.ts +5 -0
  25. package/dist/module/schemas.d.ts +6 -0
  26. package/dist/module/schemas.js +7 -2
  27. package/dist/module/types.d.ts +5 -0
  28. package/dist/module/types.js +6 -1
  29. package/dist/module/utils.d.ts +14 -0
  30. package/dist/module/utils.js +8 -0
  31. package/dist/pages/connections/ConnectionsPage.js +3 -3
  32. package/dist/pages/connections/components/create/configure/CreateConnectionConfigure.js +8 -14
  33. package/dist/pages/connections/components/create/select/CreateConnectionSelector.js +1 -1
  34. package/dist/pages/connections/components/create/select/CreateConnectionSelectorCard.js +1 -1
  35. package/dist/pages/connections/components/create/utils.d.ts +3 -0
  36. package/dist/pages/connections/components/create/utils.js +20 -1
  37. package/dist/pages/connections/components/drawer/ConnectionDrawerActions.js +13 -3
  38. package/dist/pages/connections/components/drawer/ConnectionDrawerWebhook.js +1 -1
  39. package/dist/pages/connections/components/form/ConnectionForm.js +2 -2
  40. package/dist/pages/connections/components/form/ConnectionFormPreviewAlert.js +1 -1
  41. package/dist/pages/connections/constants.d.ts +3 -1
  42. package/dist/pages/connections/constants.js +6 -6
  43. package/dist/pages/observability/ObservabilityPage.js +1 -1
  44. package/dist/pages/observability/components/setup/constants.js +1 -1
  45. package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasConnections.js +1 -1
  46. package/dist/pages/pipelines/components/create/CreatePipelineModal.d.ts +3 -0
  47. package/dist/pages/pipelines/components/create/CreatePipelineModal.js +27 -5
  48. package/dist/pages/pipelines/components/create/CreatePipelineModalProvider.d.ts +2 -1
  49. package/dist/pages/pipelines/components/create/CreatePipelineModalProvider.js +3 -3
  50. package/dist/pages/pipelines/components/create/hooks/useCreatePipelineModalCreateConnection.d.ts +2 -0
  51. package/dist/pages/pipelines/components/create/hooks/useCreatePipelineModalCreateConnection.js +19 -0
  52. package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalConnectionRow.js +2 -1
  53. package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalConnectionsPane.js +23 -11
  54. package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalConnectionsState.js +2 -6
  55. package/dist/pages/pipelines/components/create/types.d.ts +3 -0
  56. package/dist/pages/pipelines/components/create/utils.d.ts +8 -1
  57. package/dist/pages/pipelines/components/create/utils.js +29 -2
  58. package/dist/pages/pipelines/components/header/PipelinePageRunActions.js +1 -1
  59. package/dist/pages/pipelines/components/run/PipelineRunModal.d.ts +3 -0
  60. package/dist/pages/pipelines/components/run/PipelineRunModal.js +15 -9
  61. package/dist/pages/pipelines/components/run/types.d.ts +8 -0
  62. package/dist/pages/pipelines/components/run/utils.d.ts +6 -1
  63. package/dist/pages/pipelines/components/run/utils.js +12 -1
  64. package/dist/pages/pipelines/settings/PipelineSettingsPageDanger.js +1 -1
  65. package/dist/styles.css +1 -0
  66. package/package.json +1 -1
package/README.md CHANGED
@@ -40,7 +40,7 @@ pnpm check:host # type-check and build the fixture host against the package
40
40
 
41
41
  | Subpath | What |
42
42
  |---|---|
43
- | `./paths` | `FilamentPath` and `createFilamentHref` |
43
+ | `./paths` | `FilamentPath`, `createFilamentHref` and `createFilamentFlowSearch` |
44
44
  | `./routes` | one `*RouteOptions` per page, plus `filamentLayoutRouteOptions` and `filamentNotFoundRouteOptions` |
45
45
  | `./FilamentLayout` | the shell, its sidebar and the URL-driven drawer and modals |
46
46
  | `./commands` | `useFilamentCommandItems({ base, transport })` for a host command palette |
@@ -62,6 +62,13 @@ pnpm check:host # type-check and build the fixture host against the package
62
62
  6. **Own the query client.** Filament works with TanStack's defaults. Skip retries for `NotFound`, `PermissionDenied`, `Unauthenticated`, `InvalidArgument` and `Unimplemented`, or a missing pipeline retries for about 7s before its not-found page. A `staleTime` of 30s is recommended.
63
63
  7. **Proxy** `/ingestion.v1.IngestionService`, `/metrics.v1.MetricsService` and `/auth.v1.AuthService` to the Filament API at the transport's `baseUrl`. When another product also serves `metrics.v1.MetricsService`, put one product behind a prefix.
64
64
  8. **Give the layout a box.** `FilamentLayout` fills its parent, so the parent needs a definite height (a flex child with `min-height: 0`).
65
+ 9. **Tell Filament where the other Galaxy products live** with `productUrls` on `FilamentLayout`, keyed by `GalaxyProduct` from `./paths`. Each is the product's mount path on the same origin, such as `{ alchemy: "/functions" }`, or its full URL when it runs on its own domain. A product left out gets no links.
66
+
67
+ ### Links into other Galaxy products
68
+
69
+ Galaxy products hand people to each other with one shape. The callee owns its link format in a component-free `./links` export, such as `createAlchemyFunctionHref` and `parseAlchemyReturnSearch` from `@galaxy-io/alchemy-ui/links`. The link carries a seed, a `returnTo` and a `returnLabel` naming the screen that asked, and the result comes back on `returnTo` as search keys prefixed with the callee's name, such as `alchemyFunctionId`. A cancel comes back without them.
70
+
71
+ Library code reads a product's URL with `useGalaxyProductUrl(GalaxyProduct.ALCHEMY)` and hides the entry point when it is undefined. The standalone server writes its runtime config into `index.html` as the JSON script `filament-runtime-config`, with `products` set by the `GALAXY_<PRODUCT>_URL` variables, and the standalone app passes them to `FilamentLayout`. Every product reads the same variables, and a callee sends people back only to the origins of the products it was given, so a standalone pair sets both URLs on both servers. A new product adds itself to `GalaxyProduct`, to `products` in `ui/config.go` and to `galaxy.productUrls` in the chart.
65
72
 
66
73
  ### Releasing
67
74
 
@@ -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,8 @@
1
1
  import { FC, ReactNode } from 'react';
2
+ import { GalaxyProductUrls } from './types';
2
3
  export interface FilamentLayoutProps {
3
4
  sidebarFooter?: ReactNode;
5
+ productUrls?: GalaxyProductUrls;
4
6
  }
5
7
  declare const FilamentLayout: FC<FilamentLayoutProps>;
6
8
  export default FilamentLayout;
@@ -1,18 +1,21 @@
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";
7
8
  import CreatePipelineModal from "../pages/pipelines/components/create/CreatePipelineModal.js";
8
9
  import PipelineRunModal from "../pages/pipelines/components/run/PipelineRunModal.js";
10
+ import { GALAXY_DEFAULT_PRODUCT_URLS } from "./constants.js";
11
+ import { GalaxyProductsProvider } from "./GalaxyProductsProvider.js";
9
12
  import { useCallback } from "react";
10
13
  import { Outlet } from "@tanstack/react-router";
11
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
12
15
  //#region src/module/FilamentLayout.tsx
13
- var FilamentLayout = ({ sidebarFooter }) => {
16
+ var FilamentLayout = ({ sidebarFooter, productUrls = GALAXY_DEFAULT_PRODUCT_URLS }) => {
14
17
  const updateSearch = useFilamentSearchUpdate();
15
- const { connectionId, pipelineId, flow, connector, connectorKind, connectorSearch } = useFilamentLayoutSearch();
18
+ const { connectionId, pipelineId, flow, connector, connectorKind, connectorSearch, sourceId, sinkIds, resources, resyncResources } = useFilamentLayoutSearch();
16
19
  const handleCloseDrawer = useCallback(() => {
17
20
  updateSearch((prev) => {
18
21
  const { connectionId: _, connector: __, connectorKind: ___, flow: prevFlow, ...rest } = prev;
@@ -23,43 +26,50 @@ var FilamentLayout = ({ sidebarFooter }) => {
23
26
  }, { replace: true });
24
27
  }, [updateSearch]);
25
28
  const handleCloseFlow = useCallback(() => {
26
- updateSearch((prev) => {
27
- const { flow: _, connector: __, connectorKind: ___, connectorSearch: ____, pipelineId: _____, ...rest } = prev;
28
- return rest;
29
- }, { replace: true });
29
+ updateSearch((prev) => ({
30
+ ...prev,
31
+ ...createFilamentFlowCloseSearch(prev)
32
+ }), { replace: true });
30
33
  }, [updateSearch]);
31
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
32
- /* @__PURE__ */ jsx(MainLayout, {
33
- sidebarFooter,
34
- children: /* @__PURE__ */ jsx(Outlet, {})
35
- }),
36
- /* @__PURE__ */ jsx(ConnectionDrawer, {
37
- connectionId,
38
- isOpen: !!connectionId,
39
- onClose: handleCloseDrawer
40
- }),
41
- /* @__PURE__ */ jsx(CreateConnectionModal, {
42
- isOpen: flow === Flow.CREATE_CONNECTION,
43
- connector,
44
- connectorKind,
45
- connectorSearch,
46
- onClose: handleCloseFlow
47
- }),
48
- /* @__PURE__ */ jsx(EditConnectionModal, {
49
- isOpen: flow === Flow.EDIT_CONNECTION && !!connectionId,
50
- connectionId,
51
- onClose: handleCloseFlow
52
- }),
53
- /* @__PURE__ */ jsx(CreatePipelineModal, {
54
- isOpen: flow === Flow.CREATE_PIPELINE,
55
- onClose: handleCloseFlow
56
- }),
57
- /* @__PURE__ */ jsx(PipelineRunModal, {
58
- isOpen: flow === Flow.RUN_PIPELINE && !!pipelineId,
59
- pipelineId,
60
- onClose: handleCloseFlow
61
- })
62
- ] });
34
+ return /* @__PURE__ */ jsxs(GalaxyProductsProvider, {
35
+ productUrls,
36
+ children: [
37
+ /* @__PURE__ */ jsx(MainLayout, {
38
+ sidebarFooter,
39
+ children: /* @__PURE__ */ jsx(Outlet, {})
40
+ }),
41
+ /* @__PURE__ */ jsx(ConnectionDrawer, {
42
+ connectionId,
43
+ isOpen: !!connectionId,
44
+ onClose: handleCloseDrawer
45
+ }),
46
+ /* @__PURE__ */ jsx(CreateConnectionModal, {
47
+ isOpen: flow === Flow.CREATE_CONNECTION,
48
+ connector,
49
+ connectorKind,
50
+ connectorSearch,
51
+ onClose: handleCloseFlow
52
+ }),
53
+ /* @__PURE__ */ jsx(EditConnectionModal, {
54
+ isOpen: flow === Flow.EDIT_CONNECTION && !!connectionId,
55
+ connectionId,
56
+ onClose: handleCloseFlow
57
+ }),
58
+ /* @__PURE__ */ jsx(CreatePipelineModal, {
59
+ isOpen: flow === Flow.CREATE_PIPELINE,
60
+ sourceId,
61
+ sinkIds,
62
+ onClose: handleCloseFlow
63
+ }),
64
+ /* @__PURE__ */ jsx(PipelineRunModal, {
65
+ isOpen: flow === Flow.RUN_PIPELINE && !!pipelineId,
66
+ pipelineId,
67
+ resources,
68
+ resyncResources,
69
+ onClose: handleCloseFlow
70
+ })
71
+ ]
72
+ });
63
73
  };
64
74
  //#endregion
65
75
  export { FilamentLayout as default };
@@ -0,0 +1,8 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { GalaxyProduct, GalaxyProductUrls } from './types';
3
+ interface GalaxyProductsProviderProps {
4
+ productUrls: GalaxyProductUrls;
5
+ }
6
+ export declare const GalaxyProductsProvider: FC<PropsWithChildren<GalaxyProductsProviderProps>>;
7
+ export declare const useGalaxyProductUrl: (product: GalaxyProduct) => string | undefined;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { GALAXY_DEFAULT_PRODUCT_URLS } from "./constants.js";
2
+ import { createContext } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/module/GalaxyProductsProvider.tsx
5
+ var GalaxyProductUrlsContext = createContext(GALAXY_DEFAULT_PRODUCT_URLS);
6
+ var GalaxyProductsProvider = ({ productUrls, children }) => /* @__PURE__ */ jsx(GalaxyProductUrlsContext.Provider, {
7
+ value: productUrls,
8
+ children
9
+ });
10
+ //#endregion
11
+ export { GalaxyProductsProvider };
@@ -1,19 +1,20 @@
1
- import { FilamentPath } from "./paths.js";
2
- import { ConnectorKind } from "../gen/ingestion/v1/common_pb.js";
3
1
  import { FilamentNavItem, Flow } from "./types.js";
2
+ import { FilamentPath, createFilamentFlowSearch } from "./paths.js";
3
+ import { ConnectorKind } from "../gen/ingestion/v1/common_pb.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";
12
11
  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";
12
+ import ConnectorCommandIcon from "../components/connections/ConnectorCommandIcon.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,8 +1,9 @@
1
1
  import { ConnectorKind } from '../gen/ingestion/v1/common_pb';
2
- import { FilamentNavItem } from './types';
2
+ import { FilamentNavItem, GalaxyProductUrls } from './types';
3
3
  export declare const FILAMENT_COMMAND_GROUP_GO_TO = "Go to";
4
4
  export declare const FILAMENT_COMMAND_GROUP_CREATE = "Create";
5
5
  export declare const FILAMENT_COMMAND_GROUP_PIPELINES = "Pipelines";
6
6
  export declare const FILAMENT_COMMAND_GROUP_CONNECTIONS = "Connections";
7
7
  export declare const FILAMENT_CONNECTOR_KIND_TO_NAV_ITEM_MAP: Record<ConnectorKind, FilamentNavItem>;
8
8
  export declare const FILAMENT_CONNECTOR_KIND_TO_CREATE_COMMAND_ID_MAP: Record<ConnectorKind, string>;
9
+ export declare const GALAXY_DEFAULT_PRODUCT_URLS: GalaxyProductUrls;
@@ -1,5 +1,5 @@
1
- import { ConnectorKind } from "../gen/ingestion/v1/common_pb.js";
2
1
  import { FilamentNavItem } from "./types.js";
2
+ import { ConnectorKind } from "../gen/ingestion/v1/common_pb.js";
3
3
  //#region src/module/constants.ts
4
4
  var FILAMENT_COMMAND_GROUP_GO_TO = "Go to";
5
5
  var FILAMENT_COMMAND_GROUP_CREATE = "Create";
@@ -15,5 +15,6 @@ var FILAMENT_CONNECTOR_KIND_TO_CREATE_COMMAND_ID_MAP = {
15
15
  [ConnectorKind.SOURCE]: "new-source",
16
16
  [ConnectorKind.SINK]: "new-sink"
17
17
  };
18
+ var GALAXY_DEFAULT_PRODUCT_URLS = {};
18
19
  //#endregion
19
- export { 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 };
20
+ export { 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, GALAXY_DEFAULT_PRODUCT_URLS };
@@ -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,5 +1,5 @@
1
- import { FilamentPath } from "./paths.js";
2
1
  import { FilamentNavItem } from "./types.js";
2
+ import { FilamentPath } from "./paths.js";
3
3
  import { ChartLineIcon, DatabaseIcon, FlowArrowIcon, TrayArrowDownIcon } from "@phosphor-icons/react";
4
4
  //#region src/module/nav.ts
5
5
  var FILAMENT_NAV_ITEMS = [
@@ -1,3 +1,7 @@
1
+ import { FilamentFlowSeed, FilamentLayoutSearch } from './schemas';
2
+ import { Flow, GalaxyProduct } from './types';
3
+ export type { GalaxyProductUrls } from './types';
4
+ export { GalaxyProduct };
1
5
  export declare enum FilamentPath {
2
6
  OBSERVABILITY = "./observability",
3
7
  PIPELINES = "./pipelines",
@@ -11,3 +15,4 @@ export declare enum FilamentPath {
11
15
  SETTINGS_SERVICE_ACCOUNTS = "./settings/service-accounts"
12
16
  }
13
17
  export declare const createFilamentHref: (path: FilamentPath, params?: Record<string, string>) => string;
18
+ export declare const createFilamentFlowSearch: (flow?: Flow, seed?: FilamentFlowSeed) => Omit<FilamentLayoutSearch, "connectionId">;
@@ -1,3 +1,4 @@
1
+ import { GalaxyProduct } from "./types.js";
1
2
  //#region src/module/paths.ts
2
3
  var FilamentPath = /* @__PURE__ */ function(FilamentPath) {
3
4
  FilamentPath["OBSERVABILITY"] = "./observability";
@@ -13,5 +14,21 @@ var FilamentPath = /* @__PURE__ */ function(FilamentPath) {
13
14
  return FilamentPath;
14
15
  }({});
15
16
  var createFilamentHref = (path, params = {}) => path.replace(/\$(\w+)/g, (_, key) => encodeURIComponent(params[key] ?? ""));
17
+ var FILAMENT_FLOW_SEARCH_RESET = {
18
+ connector: void 0,
19
+ connectorKind: void 0,
20
+ connectorSearch: void 0,
21
+ pipelineId: void 0,
22
+ sourceId: void 0,
23
+ sinkIds: void 0,
24
+ resources: void 0,
25
+ resyncResources: void 0,
26
+ returnFlow: void 0
27
+ };
28
+ var createFilamentFlowSearch = (flow, seed = {}) => ({
29
+ ...FILAMENT_FLOW_SEARCH_RESET,
30
+ ...seed,
31
+ flow
32
+ });
16
33
  //#endregion
17
- export { FilamentPath, createFilamentHref };
34
+ export { FilamentPath, GalaxyProduct, 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>>;
@@ -1,3 +1,4 @@
1
+ import { Flow } from "./types.js";
1
2
  import { ConnectorKind } from "../gen/ingestion/v1/common_pb.js";
2
3
  import { SortBy, SortOrder } from "../gen/ingestion/v1/sorting_pb.js";
3
4
  import { RunStatus } from "../gen/ingestion/v1/runs_pb.js";
@@ -5,7 +6,6 @@ import { ObservabilityRefreshInterval, ObservabilityRunsView, ObservabilityThrou
5
6
  import { MetricDimension } from "../gen/metrics/v1/metrics_pb.js";
6
7
  import { PipelineCanvasView } from "../pages/pipelines/canvas/types.js";
7
8
  import { SettingsTeamView } from "../pages/settings/types.js";
8
- import { Flow } from "./types.js";
9
9
  import z from "zod";
10
10
  //#region src/module/schemas.ts
11
11
  var listSearchParamsSchema = z.object({
@@ -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),