@galaxy-io/filament-ui 0.1.1 → 0.3.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.
- package/dist/components/connections/ConnectorNameChips.d.ts +8 -0
- package/dist/components/connections/ConnectorNameChips.js +34 -0
- package/dist/module/hooks.d.ts +1 -1
- package/dist/module/routes.d.ts +1 -1
- package/dist/module/schemas.d.ts +1 -2
- package/dist/module/schemas.js +1 -2
- package/dist/pages/connections/components/drawer/ConnectionDrawer.js +4 -27
- package/dist/pages/pipelines/PipelineCanvasPage.js +2 -1
- package/dist/pages/pipelines/canvas/PipelineCanvasConnectionSelector.js +3 -1
- package/dist/pages/pipelines/canvas/PipelineCanvasControls.js +2 -5
- package/dist/pages/pipelines/canvas/PipelineCanvasFlow.js +20 -16
- package/dist/pages/pipelines/canvas/constants.d.ts +3 -1
- package/dist/pages/pipelines/canvas/constants.js +11 -1
- package/dist/pages/pipelines/canvas/graph/rules.d.ts +3 -2
- package/dist/pages/pipelines/canvas/graph/rules.js +9 -33
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasEdgeConfig.d.ts +5 -5
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasEdgeConfig.js +14 -13
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasEdgeResources.d.ts +6 -7
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasEdgeResources.js +18 -24
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasPanelResourceOptions.d.ts +6 -7
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasPanelResourceOptions.js +3 -3
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasSelection.d.ts +2 -3
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasSelection.js +6 -13
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasSelectionReveal.js +11 -12
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasSourceNodeResources.d.ts +2 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasSourceNodeResources.js +11 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasSourceResources.d.ts +1 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasSourceResources.js +1 -0
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodePlaceholder.js +3 -1
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeSource.js +2 -4
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanel.js +8 -35
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelColumn.d.ts +3 -0
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelColumn.js +63 -0
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelHeader.d.ts +5 -3
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelHeader.js +21 -14
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelLayout.d.ts +3 -0
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelLayout.js +28 -0
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelOpenButton.d.ts +3 -0
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelOpenButton.js +18 -0
- package/dist/pages/pipelines/canvas/panel/activity/PipelineCanvasPanelActivity.d.ts +5 -1
- package/dist/pages/pipelines/canvas/panel/activity/PipelineCanvasPanelActivity.js +19 -19
- package/dist/pages/pipelines/canvas/panel/activity/PipelineCanvasPanelActivityHeader.d.ts +7 -0
- package/dist/pages/pipelines/canvas/panel/activity/PipelineCanvasPanelActivityHeader.js +41 -0
- package/dist/pages/pipelines/canvas/panel/activity/PipelineCanvasPanelActivityLine.js +2 -2
- package/dist/pages/pipelines/canvas/panel/activity/constants.d.ts +5 -0
- package/dist/pages/pipelines/canvas/panel/activity/constants.js +8 -0
- package/dist/pages/pipelines/canvas/panel/activity/hooks/usePipelineCanvasPanelActivityRunIds.d.ts +1 -0
- package/dist/pages/pipelines/canvas/panel/activity/hooks/usePipelineCanvasPanelActivityRunIds.js +14 -0
- package/dist/pages/pipelines/canvas/panel/activity/hooks/usePipelineCanvasPanelActivityStickToBottom.d.ts +2 -0
- package/dist/pages/pipelines/canvas/panel/activity/hooks/usePipelineCanvasPanelActivityStickToBottom.js +57 -0
- package/dist/pages/pipelines/canvas/panel/activity/utils.d.ts +1 -0
- package/dist/pages/pipelines/canvas/panel/activity/utils.js +6 -1
- package/dist/pages/pipelines/canvas/panel/constants.d.ts +13 -5
- package/dist/pages/pipelines/canvas/panel/constants.js +7 -1
- package/dist/pages/pipelines/canvas/panel/overview/PipelineCanvasPanelOverview.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/node/PipelineCanvasPanelNodeDetail.js +8 -3
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceDetail.js +27 -28
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceEndpoint.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceSection.js +7 -21
- package/dist/pages/pipelines/canvas/panel/overview/resource/transform/PipelineCanvasPanelResourceTransformSection.js +2 -2
- package/dist/pages/pipelines/canvas/providers/canvas/PipelineCanvasProvider.d.ts +3 -2
- package/dist/pages/pipelines/canvas/providers/canvas/PipelineCanvasProvider.js +7 -4
- package/dist/pages/pipelines/canvas/providers/canvas/actions.d.ts +6 -2
- package/dist/pages/pipelines/canvas/providers/canvas/reducer.js +18 -11
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutes.js +4 -5
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesDraftRow.js +17 -17
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesList.js +2 -1
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesRowControls.js +16 -17
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesSourceIsland.js +2 -2
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesToolbar.js +3 -1
- package/dist/pages/pipelines/canvas/routes/constants.d.ts +1 -0
- package/dist/pages/pipelines/canvas/routes/hooks/usePipelineCanvasRoutes.js +4 -7
- package/dist/pages/pipelines/canvas/routes/hooks/usePipelineCanvasRoutesDraft.js +4 -16
- package/dist/pages/pipelines/canvas/routes/types.d.ts +0 -2
- package/dist/pages/pipelines/canvas/routes/utils.js +1 -1
- package/dist/pages/pipelines/canvas/utils.d.ts +4 -11
- package/dist/pages/pipelines/canvas/utils.js +14 -41
- package/dist/pages/pipelines/components/create/serialize.js +13 -31
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalDeliveryConnection.js +3 -3
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesReadModeCell.js +3 -3
- package/dist/pages/pipelines/components/header/PipelinePageEditActions.js +5 -21
- package/dist/pages/pipelines/components/header/PipelinePageRunActions.js +1 -7
- package/dist/pages/pipelines/components/resource/utils.d.ts +2 -2
- package/dist/pages/pipelines/components/resource/utils.js +3 -3
- package/dist/pages/pipelines/components/transform/PipelineTransformFields.js +4 -9
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsCall.js +1 -1
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsChain.js +1 -1
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsConditionGroup.js +1 -1
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsConditionRow.js +1 -1
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsNested.js +1 -1
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsProvider.d.ts +3 -4
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsProvider.js +15 -23
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsStepCard.js +21 -47
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsStepCompute.js +1 -1
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsStepDrop.js +1 -1
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsStepRename.js +1 -1
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsSteps.d.ts +3 -0
- package/dist/pages/pipelines/components/transform/{PipelineTransformFieldsResourceSteps.js → PipelineTransformFieldsSteps.js} +11 -29
- package/dist/pages/pipelines/components/transform/actions.d.ts +3 -12
- package/dist/pages/pipelines/components/transform/actions.js +0 -1
- package/dist/pages/pipelines/components/transform/grammar/parse.d.ts +1 -1
- package/dist/pages/pipelines/components/transform/grammar/parse.js +1 -1
- package/dist/pages/pipelines/components/transform/grammar/serialize.d.ts +1 -1
- package/dist/pages/pipelines/components/transform/grammar/serialize.js +3 -6
- package/dist/pages/pipelines/components/transform/hooks/usePipelineTransformFieldsIssues.d.ts +1 -2
- package/dist/pages/pipelines/components/transform/hooks/usePipelineTransformFieldsIssues.js +4 -6
- package/dist/pages/pipelines/components/transform/hooks/usePipelineTransformFieldsValidation.js +20 -19
- package/dist/pages/pipelines/components/transform/reducer.d.ts +1 -1
- package/dist/pages/pipelines/components/transform/reducer.js +18 -37
- package/dist/pages/pipelines/components/transform/types.d.ts +3 -4
- package/dist/pages/pipelines/components/transform/utils.d.ts +3 -3
- package/dist/pages/pipelines/components/transform/utils.js +7 -8
- package/dist/pages/pipelines/components/transform/validation.js +10 -13
- package/dist/styles.css +6 -6
- package/dist/utils/select.d.ts +1 -0
- package/dist/utils/select.js +2 -1
- package/package.json +3 -3
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelTabHeader.d.ts +0 -3
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelTabHeader.js +0 -35
- package/dist/pages/pipelines/canvas/panel/types.d.ts +0 -4
- package/dist/pages/pipelines/canvas/panel/types.js +0 -8
- package/dist/pages/pipelines/components/transform/PipelineTransformFieldsResourceSteps.d.ts +0 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Connection } from '../../gen/ingestion/v1/connections_pb';
|
|
3
|
+
interface ConnectorNameChipsProps {
|
|
4
|
+
connector: Connection["connector"];
|
|
5
|
+
kind: Connection["kind"];
|
|
6
|
+
}
|
|
7
|
+
declare const ConnectorNameChips: FC<ConnectorNameChipsProps>;
|
|
8
|
+
export default ConnectorNameChips;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GetConnectorRequestSchema } from "../../gen/ingestion/v1/connectors_pb.js";
|
|
2
|
+
import { formatConnectorName, getConnectorFamilyName, getConnectorVariantName } from "./utils.js";
|
|
3
|
+
import { useGetConnectorQuery } from "../../api/queries/connectors.js";
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import Flex, { AlignItems } from "@galaxy-io/dls/layout/Flex";
|
|
7
|
+
import Chip, { ChipSize, ChipVariant } from "@galaxy-io/dls/chips/Chip";
|
|
8
|
+
//#region src/components/connections/ConnectorNameChips.tsx
|
|
9
|
+
var ConnectorNameChips = ({ connector, kind }) => {
|
|
10
|
+
const { data } = useGetConnectorQuery({
|
|
11
|
+
input: create(GetConnectorRequestSchema, {
|
|
12
|
+
connector,
|
|
13
|
+
kind
|
|
14
|
+
}),
|
|
15
|
+
options: { enabled: connector !== "" }
|
|
16
|
+
});
|
|
17
|
+
const variant = getConnectorVariantName(connector);
|
|
18
|
+
return /* @__PURE__ */ jsxs(Flex, {
|
|
19
|
+
alignItems: AlignItems.CENTER,
|
|
20
|
+
gap: 8,
|
|
21
|
+
minWidth: 0,
|
|
22
|
+
children: [/* @__PURE__ */ jsx(Chip, {
|
|
23
|
+
label: data?.connector ? formatConnectorName(data.connector) : getConnectorFamilyName(connector),
|
|
24
|
+
variant: ChipVariant.SECONDARY,
|
|
25
|
+
size: ChipSize.SMALL
|
|
26
|
+
}), variant && /* @__PURE__ */ jsx(Chip, {
|
|
27
|
+
label: variant,
|
|
28
|
+
variant: ChipVariant.SECONDARY,
|
|
29
|
+
size: ChipSize.SMALL
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { ConnectorNameChips as default };
|
package/dist/module/hooks.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare const usePipelineCanvasSearch: () => {
|
|
|
58
58
|
node?: string | undefined;
|
|
59
59
|
resource?: string | undefined;
|
|
60
60
|
showPanel?: boolean | undefined;
|
|
61
|
-
|
|
61
|
+
showActivity?: boolean | undefined;
|
|
62
62
|
view?: import('../pages/pipelines/canvas/types').PipelineCanvasView | undefined;
|
|
63
63
|
sinks?: string[] | undefined;
|
|
64
64
|
};
|
package/dist/module/routes.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export declare const pipelineCanvasRouteOptions: FilamentRouteComponents & {
|
|
|
59
59
|
node: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodString>>;
|
|
60
60
|
resource: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodString>>;
|
|
61
61
|
showPanel: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodBoolean>>;
|
|
62
|
-
|
|
62
|
+
showActivity: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodBoolean>>;
|
|
63
63
|
view: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodEnum<typeof import('../pages/pipelines/canvas/types').PipelineCanvasView>>>;
|
|
64
64
|
sinks: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString>>>;
|
|
65
65
|
}, import('zod/v4/core').$strip>;
|
package/dist/module/schemas.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { RunStatus } from '../gen/ingestion/v1/runs_pb';
|
|
|
4
4
|
import { SortBy, SortOrder } from '../gen/ingestion/v1/sorting_pb';
|
|
5
5
|
import { MetricDimension } from '../gen/metrics/v1/metrics_pb';
|
|
6
6
|
import { ObservabilityRunsView, ObservabilityThroughputView, ObservabilityTimeframe, ObservabilityUsageView } from '../pages/observability/types';
|
|
7
|
-
import { PipelineCanvasPanelTab } from '../pages/pipelines/canvas/panel/types';
|
|
8
7
|
import { PipelineCanvasView } from '../pages/pipelines/canvas/types';
|
|
9
8
|
import { SettingsTeamView } from '../pages/settings/types';
|
|
10
9
|
import { Flow } from './types';
|
|
@@ -60,7 +59,7 @@ export declare const pipelineCanvasSearchSchema: z.ZodObject<{
|
|
|
60
59
|
node: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
61
60
|
resource: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
62
61
|
showPanel: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
63
|
-
|
|
62
|
+
showActivity: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
64
63
|
view: z.ZodCatch<z.ZodOptional<z.ZodEnum<typeof PipelineCanvasView>>>;
|
|
65
64
|
sinks: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
66
65
|
}, z.core.$strip>;
|
package/dist/module/schemas.js
CHANGED
|
@@ -3,7 +3,6 @@ import { SortBy, SortOrder } from "../gen/ingestion/v1/sorting_pb.js";
|
|
|
3
3
|
import { RunStatus } from "../gen/ingestion/v1/runs_pb.js";
|
|
4
4
|
import { ObservabilityRunsView, ObservabilityThroughputView, ObservabilityTimeframe, ObservabilityUsageView } from "../pages/observability/types.js";
|
|
5
5
|
import { MetricDimension } from "../gen/metrics/v1/metrics_pb.js";
|
|
6
|
-
import { PipelineCanvasPanelTab } from "../pages/pipelines/canvas/panel/types.js";
|
|
7
6
|
import { PipelineCanvasView } from "../pages/pipelines/canvas/types.js";
|
|
8
7
|
import { SettingsTeamView } from "../pages/settings/types.js";
|
|
9
8
|
import { Flow } from "./types.js";
|
|
@@ -44,7 +43,7 @@ var pipelineCanvasSearchSchema = z.object({
|
|
|
44
43
|
node: z.string().optional().catch(void 0),
|
|
45
44
|
resource: z.string().optional().catch(void 0),
|
|
46
45
|
showPanel: z.boolean().optional().catch(void 0),
|
|
47
|
-
|
|
46
|
+
showActivity: z.boolean().optional().catch(void 0),
|
|
48
47
|
view: z.enum(PipelineCanvasView).optional().catch(void 0),
|
|
49
48
|
sinks: z.array(z.string()).optional().catch(void 0)
|
|
50
49
|
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { IS_DEBUG } from "../../../../constants.js";
|
|
2
|
-
import { GetConnectorRequestSchema } from "../../../../gen/ingestion/v1/connectors_pb.js";
|
|
3
|
-
import { formatConnectorName, getConnectorFamilyName, getConnectorVariantName } from "../../../../components/connections/utils.js";
|
|
4
|
-
import { useGetConnectorQuery } from "../../../../api/queries/connectors.js";
|
|
5
2
|
import ConnectionKindChip from "../../../../components/connections/ConnectionKindChip.js";
|
|
6
3
|
import { isNotFoundError } from "../../../../utils/errors.js";
|
|
7
4
|
import { createGetConnectionInput, useGetConnectionQuery } from "../../../../api/queries/connections.js";
|
|
8
5
|
import { useOverlaySession } from "../../../../hooks/useOverlaySession.js";
|
|
6
|
+
import ConnectorNameChips from "../../../../components/connections/ConnectorNameChips.js";
|
|
9
7
|
import KeyValueList from "../../../../components/KeyValueList.js";
|
|
10
8
|
import KeyValueListRow from "../../../../components/KeyValueListRow.js";
|
|
11
9
|
import ConnectionDrawerActions from "./ConnectionDrawerActions.js";
|
|
@@ -16,11 +14,9 @@ import ConnectionDrawerPipelines from "./ConnectionDrawerPipelines.js";
|
|
|
16
14
|
import { KeyIcon, LinkBreakIcon, SlidersIcon } from "@phosphor-icons/react";
|
|
17
15
|
import Button, { ButtonSize, ButtonVariant } from "@galaxy-io/dls/buttons/Button";
|
|
18
16
|
import ErrorLayout from "@galaxy-io/dls/layout/ErrorLayout";
|
|
19
|
-
import { create } from "@bufbuild/protobuf";
|
|
20
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
18
|
import PendingLayout from "@galaxy-io/dls/layout/PendingLayout";
|
|
22
19
|
import Flex, { AlignItems, FlexDirection } from "@galaxy-io/dls/layout/Flex";
|
|
23
|
-
import Chip, { ChipSize, ChipVariant } from "@galaxy-io/dls/chips/Chip";
|
|
24
20
|
import Text, { TextSize, TextVariant } from "@galaxy-io/dls/text/Text";
|
|
25
21
|
import { FontFamily } from "@galaxy-io/dls/theme/enums";
|
|
26
22
|
import CopyButton from "@galaxy-io/dls/buttons/CopyButton";
|
|
@@ -36,15 +32,6 @@ var ConnectionDrawer = ({ connectionId, isOpen, onClose }) => {
|
|
|
36
32
|
}
|
|
37
33
|
});
|
|
38
34
|
const connection = data?.connection;
|
|
39
|
-
const { data: connectorData } = useGetConnectorQuery({
|
|
40
|
-
input: create(GetConnectorRequestSchema, {
|
|
41
|
-
connector: connection?.connector ?? "",
|
|
42
|
-
kind: connection?.kind
|
|
43
|
-
}),
|
|
44
|
-
options: { enabled: !!connection }
|
|
45
|
-
});
|
|
46
|
-
const connector = connectorData?.connector;
|
|
47
|
-
const connectorVariant = connection && getConnectorVariantName(connection.connector);
|
|
48
35
|
const renderContent = () => {
|
|
49
36
|
if (isError) {
|
|
50
37
|
const isNotFound = isNotFoundError(error);
|
|
@@ -94,19 +81,9 @@ var ConnectionDrawer = ({ connectionId, isOpen, onClose }) => {
|
|
|
94
81
|
}),
|
|
95
82
|
/* @__PURE__ */ jsx(KeyValueListRow, {
|
|
96
83
|
label: "Connector",
|
|
97
|
-
value: /* @__PURE__ */
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
minWidth: 0,
|
|
101
|
-
children: [/* @__PURE__ */ jsx(Chip, {
|
|
102
|
-
label: connector ? formatConnectorName(connector) : getConnectorFamilyName(connection.connector),
|
|
103
|
-
variant: ChipVariant.SECONDARY,
|
|
104
|
-
size: ChipSize.SMALL
|
|
105
|
-
}), connectorVariant && /* @__PURE__ */ jsx(Chip, {
|
|
106
|
-
label: connectorVariant,
|
|
107
|
-
variant: ChipVariant.SECONDARY,
|
|
108
|
-
size: ChipSize.SMALL
|
|
109
|
-
})]
|
|
84
|
+
value: /* @__PURE__ */ jsx(ConnectorNameChips, {
|
|
85
|
+
connector: connection.connector,
|
|
86
|
+
kind: connection.kind
|
|
110
87
|
})
|
|
111
88
|
}),
|
|
112
89
|
/* @__PURE__ */ jsx(KeyValueListRow, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PipelineCanvasView } from "./canvas/types.js";
|
|
2
2
|
import { usePipelineCanvasSelection } from "./canvas/hooks/usePipelineCanvasSelection.js";
|
|
3
3
|
import PipelineCanvasFlow from "./canvas/PipelineCanvasFlow.js";
|
|
4
|
+
import PipelineCanvasPanelLayout from "./canvas/panel/PipelineCanvasPanelLayout.js";
|
|
4
5
|
import PipelineCanvasRoutes from "./canvas/routes/PipelineCanvasRoutes.js";
|
|
5
6
|
/* empty css */
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -14,7 +15,7 @@ var PipelineCanvasPageWrapper = /*#__PURE__*/ styled("div")({
|
|
|
14
15
|
});
|
|
15
16
|
var PipelineCanvasPage = () => {
|
|
16
17
|
const { view } = usePipelineCanvasSelection();
|
|
17
|
-
return /* @__PURE__ */ jsx(PipelineCanvasPageWrapper, { children: match(view).with(PipelineCanvasView.ROUTES, () => /* @__PURE__ */ jsx(PipelineCanvasRoutes, {})).with(PipelineCanvasView.CANVAS, () => /* @__PURE__ */ jsx(PipelineCanvasFlow, {})).exhaustive() });
|
|
18
|
+
return /* @__PURE__ */ jsx(PipelineCanvasPageWrapper, { children: /* @__PURE__ */ jsx(PipelineCanvasPanelLayout, { children: match(view).with(PipelineCanvasView.ROUTES, () => /* @__PURE__ */ jsx(PipelineCanvasRoutes, {})).with(PipelineCanvasView.CANVAS, () => /* @__PURE__ */ jsx(PipelineCanvasFlow, {})).exhaustive() }) });
|
|
18
19
|
};
|
|
19
20
|
//#endregion
|
|
20
21
|
export { PipelineCanvasPage as default };
|
|
@@ -4,6 +4,7 @@ import { createListConnectionsInput, useListConnectionsQuery } from "../../../ap
|
|
|
4
4
|
import { getNextNodePosition } from "./graph/layout.js";
|
|
5
5
|
import { canAddSourceNode, createNodeFromConnection } from "./graph/rules.js";
|
|
6
6
|
import { usePipelineCanvasActions, usePipelineCanvasState } from "./providers/canvas/PipelineCanvasProvider.js";
|
|
7
|
+
import { usePipelineCanvasSourceNodeResources } from "./hooks/usePipelineCanvasSourceNodeResources.js";
|
|
7
8
|
import PipelineCanvasConnectionSelectorList from "./PipelineCanvasConnectionSelectorList.js";
|
|
8
9
|
import { useState } from "react";
|
|
9
10
|
import { create } from "@bufbuild/protobuf";
|
|
@@ -19,6 +20,7 @@ var PipelineCanvasConnectionSelector = ({ kindFilter = ConnectorKind.UNSPECIFIED
|
|
|
19
20
|
const [state, setState] = useState(DEFAULT_STATE);
|
|
20
21
|
const canvasState = usePipelineCanvasState();
|
|
21
22
|
const { addNode } = usePipelineCanvasActions();
|
|
23
|
+
const sourceResources = usePipelineCanvasSourceNodeResources();
|
|
22
24
|
const handleSearch = (q) => {
|
|
23
25
|
setState((prev) => ({
|
|
24
26
|
...prev,
|
|
@@ -36,7 +38,7 @@ var PipelineCanvasConnectionSelector = ({ kindFilter = ConnectorKind.UNSPECIFIED
|
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
38
40
|
const position = getNextNodePosition(connection.kind, canvasState.nodes);
|
|
39
|
-
addNode(createNodeFromConnection(connection, position));
|
|
41
|
+
addNode(createNodeFromConnection(connection, position), sourceResources);
|
|
40
42
|
};
|
|
41
43
|
return /* @__PURE__ */ jsxs(Flex, {
|
|
42
44
|
direction: FlexDirection.COLUMN,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { PIPELINE_CANVAS_FIT_MIN_ZOOM } from "./constants.js";
|
|
1
|
+
import { PIPELINE_CANVAS_FIT_MIN_ZOOM, PIPELINE_CANVAS_FIT_PADDING } from "./constants.js";
|
|
2
2
|
import { getGraphBounds, getPlaceholderNodes, mapNodesToStackedPositions } from "./graph/layout.js";
|
|
3
|
-
import { getPipelineCanvasFitPadding } from "./utils.js";
|
|
4
3
|
import { usePipelineCanvasActions, usePipelineCanvasReadOnly, usePipelineCanvasState } from "./providers/canvas/PipelineCanvasProvider.js";
|
|
5
|
-
import { usePipelineCanvasSelection } from "./hooks/usePipelineCanvasSelection.js";
|
|
6
4
|
/* empty css */
|
|
7
5
|
import { ArrowCounterClockwiseIcon, MinusIcon, PlusIcon } from "@phosphor-icons/react";
|
|
8
6
|
import Button, { ButtonSize, ButtonVariant } from "@galaxy-io/dls/buttons/Button";
|
|
@@ -24,7 +22,6 @@ var PipelineCanvasControls = () => {
|
|
|
24
22
|
const state = usePipelineCanvasState();
|
|
25
23
|
const isReadOnly = usePipelineCanvasReadOnly();
|
|
26
24
|
const { setNodes } = usePipelineCanvasActions();
|
|
27
|
-
const { showPanel } = usePipelineCanvasSelection();
|
|
28
25
|
const handleResetView = () => {
|
|
29
26
|
let repositioned = state.nodes;
|
|
30
27
|
if (!isReadOnly) {
|
|
@@ -33,7 +30,7 @@ var PipelineCanvasControls = () => {
|
|
|
33
30
|
}
|
|
34
31
|
const bounds = getGraphBounds([...repositioned, ...getPlaceholderNodes(repositioned, isReadOnly)]);
|
|
35
32
|
if (bounds.width === 0) return;
|
|
36
|
-
setViewport(getViewportForBounds(bounds, width, height, PIPELINE_CANVAS_FIT_MIN_ZOOM, 1,
|
|
33
|
+
setViewport(getViewportForBounds(bounds, width, height, PIPELINE_CANVAS_FIT_MIN_ZOOM, 1, PIPELINE_CANVAS_FIT_PADDING));
|
|
37
34
|
};
|
|
38
35
|
return /* @__PURE__ */ jsx(ControlsWrapper, { children: /* @__PURE__ */ jsxs(ButtonGroup, {
|
|
39
36
|
isAttached: true,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { PipelineCanvasNodeType } from "./types.js";
|
|
2
|
-
import { PIPELINE_CANVAS_EDGE_TYPE, PIPELINE_CANVAS_PAN_ON_DRAG, PIPELINE_CANVAS_SNAP_GRID } from "./constants.js";
|
|
2
|
+
import { PIPELINE_CANVAS_EDGE_TYPE, PIPELINE_CANVAS_FIT_VIEW_OPTIONS, PIPELINE_CANVAS_PAN_ON_DRAG, PIPELINE_CANVAS_SNAP_GRID } from "./constants.js";
|
|
3
3
|
import { getPlaceholderNodes } from "./graph/layout.js";
|
|
4
|
-
import {
|
|
5
|
-
import { canConnectEdge } from "./graph/rules.js";
|
|
4
|
+
import { isConnectionNode, mapEdgesToStyledEdges, mapElementsToSelected } from "./utils.js";
|
|
5
|
+
import { canConnectEdge, expandConnection } from "./graph/rules.js";
|
|
6
6
|
import { usePipelineCanvasActions, usePipelineCanvasReadOnly, usePipelineCanvasState } from "./providers/canvas/PipelineCanvasProvider.js";
|
|
7
7
|
import { usePipelineCanvasValidation } from "./hooks/usePipelineCanvasValidation.js";
|
|
8
8
|
import { usePipelineCanvasSelection } from "./hooks/usePipelineCanvasSelection.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import PipelineCanvasEdge from "./edges/PipelineCanvasEdge.js";
|
|
11
11
|
import { usePipelineCanvasIsRunning } from "./hooks/usePipelineCanvasIsRunning.js";
|
|
12
|
+
import { usePipelineCanvasSourceNodeResources } from "./hooks/usePipelineCanvasSourceNodeResources.js";
|
|
12
13
|
import PipelineCanvasNodePlaceholder_default from "./nodes/PipelineCanvasNodePlaceholder.js";
|
|
13
14
|
import PipelineCanvasNodeSink_default from "./nodes/PipelineCanvasNodeSink.js";
|
|
14
15
|
import PipelineCanvasNodeSource_default from "./nodes/PipelineCanvasNodeSource.js";
|
|
@@ -16,7 +17,7 @@ import PipelineCanvasControls from "./PipelineCanvasControls.js";
|
|
|
16
17
|
import PipelineCanvasEditWidget from "./PipelineCanvasEditWidget.js";
|
|
17
18
|
import PipelineCanvasSelectionReveal from "./PipelineCanvasSelectionReveal.js";
|
|
18
19
|
import PipelineCanvasViewSwitcher from "./PipelineCanvasViewSwitcher.js";
|
|
19
|
-
import
|
|
20
|
+
import PipelineCanvasPanelOpenButton from "./panel/PipelineCanvasPanelOpenButton.js";
|
|
20
21
|
/* empty css */
|
|
21
22
|
import { useCallback, useMemo } from "react";
|
|
22
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -36,9 +37,9 @@ var FlowWrapper = /*#__PURE__*/ styled("div")({
|
|
|
36
37
|
class: "filament-PipelineCanvasFlow-FlowWrapper-f19lsdo4",
|
|
37
38
|
propsAsIs: false
|
|
38
39
|
});
|
|
39
|
-
var
|
|
40
|
-
name: "
|
|
41
|
-
class: "filament-PipelineCanvasFlow-
|
|
40
|
+
var FlowToolbar = /*#__PURE__*/ styled("div")({
|
|
41
|
+
name: "FlowToolbar",
|
|
42
|
+
class: "filament-PipelineCanvasFlow-FlowToolbar-f179xgkm",
|
|
42
43
|
propsAsIs: false
|
|
43
44
|
});
|
|
44
45
|
var PipelineCanvasFlow = () => {
|
|
@@ -46,7 +47,8 @@ var PipelineCanvasFlow = () => {
|
|
|
46
47
|
const state = usePipelineCanvasState();
|
|
47
48
|
const { applyNodeChanges, applyEdgeChanges, connect } = usePipelineCanvasActions();
|
|
48
49
|
const isReadOnly = usePipelineCanvasReadOnly();
|
|
49
|
-
const
|
|
50
|
+
const sourceResources = usePipelineCanvasSourceNodeResources();
|
|
51
|
+
const { selectedNodeId, selectedResourceId, selectNode, selectResource, clearSelection } = usePipelineCanvasSelection();
|
|
50
52
|
const onNodesChange = useCallback((changes) => {
|
|
51
53
|
if (isReadOnly) return;
|
|
52
54
|
const applicable = filterSelectionChanges(changes);
|
|
@@ -64,9 +66,13 @@ var PipelineCanvasFlow = () => {
|
|
|
64
66
|
const onEdgeClick = useCallback((_event, edge) => selectResource(edge.id), [selectResource]);
|
|
65
67
|
const onConnect = useCallback((connection) => {
|
|
66
68
|
if (isReadOnly) return;
|
|
67
|
-
connect(connection);
|
|
68
|
-
}, [
|
|
69
|
-
|
|
69
|
+
connect(expandConnection(connection, sourceResources));
|
|
70
|
+
}, [
|
|
71
|
+
connect,
|
|
72
|
+
isReadOnly,
|
|
73
|
+
sourceResources
|
|
74
|
+
]);
|
|
75
|
+
const isValidConnection = useCallback((connection) => expandConnection(connection, sourceResources).some((expanded) => canConnectEdge(expanded, state.edges)), [state.edges, sourceResources]);
|
|
70
76
|
const selectedNodes = useMemo(() => mapElementsToSelected(state.nodes, selectedNodeId), [state.nodes, selectedNodeId]);
|
|
71
77
|
const selectedEdges = useMemo(() => mapElementsToSelected(state.edges, selectedResourceId), [state.edges, selectedResourceId]);
|
|
72
78
|
const renderedNodes = useMemo(() => [...selectedNodes, ...getPlaceholderNodes(state.nodes, isReadOnly)], [
|
|
@@ -74,7 +80,6 @@ var PipelineCanvasFlow = () => {
|
|
|
74
80
|
state.nodes,
|
|
75
81
|
isReadOnly
|
|
76
82
|
]);
|
|
77
|
-
const fitViewOptions = useMemo(() => getPipelineCanvasFitViewOptions(showPanel), [showPanel]);
|
|
78
83
|
const isRunning = usePipelineCanvasIsRunning();
|
|
79
84
|
const { invalidEdgeIds } = usePipelineCanvasValidation();
|
|
80
85
|
const styledEdges = useMemo(() => mapEdgesToStyledEdges(selectedEdges, selectedNodes, theme, isRunning, invalidEdgeIds), [
|
|
@@ -105,7 +110,7 @@ var PipelineCanvasFlow = () => {
|
|
|
105
110
|
snapToGrid: true,
|
|
106
111
|
snapGrid: PIPELINE_CANVAS_SNAP_GRID,
|
|
107
112
|
fitView: true,
|
|
108
|
-
fitViewOptions,
|
|
113
|
+
fitViewOptions: PIPELINE_CANVAS_FIT_VIEW_OPTIONS,
|
|
109
114
|
deleteKeyCode: isReadOnly ? null : ["Backspace", "Delete"],
|
|
110
115
|
proOptions: { hideAttribution: true },
|
|
111
116
|
children: [
|
|
@@ -132,9 +137,8 @@ var PipelineCanvasFlow = () => {
|
|
|
132
137
|
})
|
|
133
138
|
]
|
|
134
139
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
!isReadOnly && /* @__PURE__ */ jsx(PipelineCanvasEditWidget, {})
|
|
137
|
-
/* @__PURE__ */ jsx(PipelineCanvasPanel, {})
|
|
140
|
+
/* @__PURE__ */ jsxs(FlowToolbar, { children: [/* @__PURE__ */ jsx(PipelineCanvasViewSwitcher, {}), /* @__PURE__ */ jsx(PipelineCanvasPanelOpenButton, {})] }),
|
|
141
|
+
!isReadOnly && /* @__PURE__ */ jsx(PipelineCanvasEditWidget, {})
|
|
138
142
|
] });
|
|
139
143
|
};
|
|
140
144
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Icon as PhosphorIcon } from '@phosphor-icons/react';
|
|
2
|
-
import { HandleType, Position } from '@xyflow/react';
|
|
2
|
+
import { FitViewOptions, HandleType, Position } from '@xyflow/react';
|
|
3
3
|
import { Space } from '@galaxy-io/dls/theme/enums';
|
|
4
4
|
import { ConnectorKind } from '../../../gen/ingestion/v1/common_pb';
|
|
5
5
|
import { PipelineCanvasEditMode } from './providers/canvas/types';
|
|
@@ -8,6 +8,8 @@ export declare const PIPELINE_CANVAS_FIT_MIN_ZOOM = 0.5;
|
|
|
8
8
|
export declare const PIPELINE_CANVAS_FIT_MAX_ZOOM = 1;
|
|
9
9
|
export declare const PIPELINE_CANVAS_FIT_INSET_Y = 48;
|
|
10
10
|
export declare const PIPELINE_CANVAS_FIT_INSET_LEFT = 80;
|
|
11
|
+
export declare const PIPELINE_CANVAS_FIT_PADDING: NonNullable<FitViewOptions["padding"]>;
|
|
12
|
+
export declare const PIPELINE_CANVAS_FIT_VIEW_OPTIONS: FitViewOptions;
|
|
11
13
|
export declare const PIPELINE_CANVAS_REVEAL_DURATION = 300;
|
|
12
14
|
export declare const PIPELINE_CANVAS_REVEAL_ZOOM = 1.15;
|
|
13
15
|
export declare const PIPELINE_CANVAS_SNAP_GRID: [number, number];
|
|
@@ -5,6 +5,16 @@ import { FlowArrowIcon, PlusIcon, TreeStructureIcon } from "@phosphor-icons/reac
|
|
|
5
5
|
import { Position } from "@xyflow/react";
|
|
6
6
|
//#region src/pages/pipelines/canvas/constants.ts
|
|
7
7
|
var PIPELINE_CANVAS_FIT_MIN_ZOOM = .5;
|
|
8
|
+
var PIPELINE_CANVAS_FIT_PADDING = {
|
|
9
|
+
top: `48px`,
|
|
10
|
+
bottom: `48px`,
|
|
11
|
+
left: `80px`,
|
|
12
|
+
right: `48px`
|
|
13
|
+
};
|
|
14
|
+
var PIPELINE_CANVAS_FIT_VIEW_OPTIONS = {
|
|
15
|
+
padding: PIPELINE_CANVAS_FIT_PADDING,
|
|
16
|
+
maxZoom: 1
|
|
17
|
+
};
|
|
8
18
|
var PIPELINE_CANVAS_REVEAL_ZOOM = 1.15;
|
|
9
19
|
var PIPELINE_CANVAS_SNAP_GRID = [20, 20];
|
|
10
20
|
var PIPELINE_CANVAS_PAN_ON_DRAG = [
|
|
@@ -60,4 +70,4 @@ var PIPELINE_CANVAS_VIEW_TO_ICON_MAP = {
|
|
|
60
70
|
[PipelineCanvasView.ROUTES]: FlowArrowIcon
|
|
61
71
|
};
|
|
62
72
|
//#endregion
|
|
63
|
-
export { CONNECTOR_KIND_TO_HANDLE_ID_MAP, CONNECTOR_KIND_TO_HANDLE_TYPE_MAP, CONNECTOR_KIND_TO_NODE_TYPE_MAP, CONNECTOR_KIND_TO_NORMALIZED_KIND_MAP, CONNECTOR_KIND_TO_XYFLOW_POSITION_MAP, PIPELINE_CANVAS_EDGE_TYPE, PIPELINE_CANVAS_EDGE_Z_INDEX, PIPELINE_CANVAS_EDIT_MODE_TO_ICON_MAP, PIPELINE_CANVAS_FIT_MIN_ZOOM, PIPELINE_CANVAS_NODE_SINK_HANDLE_ID, PIPELINE_CANVAS_NODE_SOURCE_HANDLE_ID, PIPELINE_CANVAS_NODE_TYPE_TO_CONNECTOR_KIND_MAP, PIPELINE_CANVAS_NODE_TYPE_TO_COUNTERPART_TYPE_MAP, PIPELINE_CANVAS_PAN_ON_DRAG, PIPELINE_CANVAS_REVEAL_ZOOM, PIPELINE_CANVAS_SNAP_GRID, PIPELINE_CANVAS_VIEW_TO_ICON_MAP, PIPELINE_CANVAS_VIEW_TO_LABEL_MAP };
|
|
73
|
+
export { CONNECTOR_KIND_TO_HANDLE_ID_MAP, CONNECTOR_KIND_TO_HANDLE_TYPE_MAP, CONNECTOR_KIND_TO_NODE_TYPE_MAP, CONNECTOR_KIND_TO_NORMALIZED_KIND_MAP, CONNECTOR_KIND_TO_XYFLOW_POSITION_MAP, PIPELINE_CANVAS_EDGE_TYPE, PIPELINE_CANVAS_EDGE_Z_INDEX, PIPELINE_CANVAS_EDIT_MODE_TO_ICON_MAP, PIPELINE_CANVAS_FIT_MIN_ZOOM, PIPELINE_CANVAS_FIT_PADDING, PIPELINE_CANVAS_FIT_VIEW_OPTIONS, PIPELINE_CANVAS_NODE_SINK_HANDLE_ID, PIPELINE_CANVAS_NODE_SOURCE_HANDLE_ID, PIPELINE_CANVAS_NODE_TYPE_TO_CONNECTOR_KIND_MAP, PIPELINE_CANVAS_NODE_TYPE_TO_COUNTERPART_TYPE_MAP, PIPELINE_CANVAS_PAN_ON_DRAG, PIPELINE_CANVAS_REVEAL_ZOOM, PIPELINE_CANVAS_SNAP_GRID, PIPELINE_CANVAS_VIEW_TO_ICON_MAP, PIPELINE_CANVAS_VIEW_TO_LABEL_MAP };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Connection as CanvasConnection } from '@xyflow/react';
|
|
2
2
|
import { Connection } from '../../../../gen/ingestion/v1/connections_pb';
|
|
3
|
+
import { Resource } from '../../../../gen/ingestion/v1/connectors_pb';
|
|
3
4
|
import { CanvasEdge, CanvasNode } from '../types';
|
|
4
5
|
export declare const createNodeFromConnection: (connection: Connection, position: {
|
|
5
6
|
x: number;
|
|
@@ -7,7 +8,7 @@ export declare const createNodeFromConnection: (connection: Connection, position
|
|
|
7
8
|
}) => CanvasNode;
|
|
8
9
|
type CanvasEdgeEndpoints = Pick<CanvasEdge, "source" | "target" | "sourceHandle">;
|
|
9
10
|
export declare const canConnectEdge: (connection: CanvasEdgeEndpoints, edges: CanvasEdge[]) => boolean;
|
|
10
|
-
export declare const
|
|
11
|
+
export declare const expandConnection: <T extends CanvasEdgeEndpoints>(connection: T, resources: Resource["name"][]) => T[];
|
|
11
12
|
export declare const canAddSourceNode: (nodes: CanvasNode[]) => boolean;
|
|
12
|
-
export declare const getAutoConnections: (node: CanvasNode, nodes: CanvasNode[]) => CanvasConnection[];
|
|
13
|
+
export declare const getAutoConnections: (node: CanvasNode, nodes: CanvasNode[], resources: Resource["name"][]) => CanvasConnection[];
|
|
13
14
|
export {};
|
|
@@ -20,49 +20,25 @@ var createNodeFromConnection = (connection, position) => {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
var getPairEdges = (edges, pair) => edges.filter((edge) => edge.source === pair.source && edge.target === pair.target);
|
|
23
|
-
var mapEdgesToPairs = (edges) => {
|
|
24
|
-
const pairs = /* @__PURE__ */ new Map();
|
|
25
|
-
for (const edge of edges) {
|
|
26
|
-
const key = `${edge.source} ${edge.target}`;
|
|
27
|
-
pairs.set(key, [...pairs.get(key) ?? [], edge]);
|
|
28
|
-
}
|
|
29
|
-
return [...pairs.values()];
|
|
30
|
-
};
|
|
31
23
|
var canConnectEdge = (connection, edges) => {
|
|
32
|
-
const pairEdges = getPairEdges(edges, connection);
|
|
33
|
-
if (!pairEdges.length) return true;
|
|
34
24
|
const resource = getCanvasEdgeResource(connection);
|
|
35
|
-
|
|
36
|
-
return pairEdges.every((edge) => {
|
|
37
|
-
const existing = getCanvasEdgeResource(edge);
|
|
38
|
-
return existing !== "" && existing !== resource;
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
var getPipelineGraphConflicts = (edges, connectionByNodeId) => {
|
|
42
|
-
const getNodeLabel = (nodeId) => connectionByNodeId.get(nodeId)?.name ?? nodeId;
|
|
43
|
-
return mapEdgesToPairs(edges).flatMap((pairEdges) => {
|
|
44
|
-
const { source, target } = pairEdges[0];
|
|
45
|
-
const resources = pairEdges.map(getCanvasEdgeResource);
|
|
46
|
-
const named = resources.filter(Boolean);
|
|
47
|
-
const route = `${getNodeLabel(source)} → ${getNodeLabel(target)}`;
|
|
48
|
-
const conflicts = [];
|
|
49
|
-
if (named.length && named.length !== resources.length) conflicts.push(`${route} routes all resources and individual resources at the same time. Remove one or the other.`);
|
|
50
|
-
const duplicated = [...new Set(named.filter((name, index) => named.indexOf(name) !== index))];
|
|
51
|
-
if (duplicated.length) conflicts.push(`${route} routes ${duplicated.join(", ")} more than once.`);
|
|
52
|
-
return conflicts;
|
|
53
|
-
});
|
|
25
|
+
return resource !== "" && !getPairEdges(edges, connection).some((edge) => getCanvasEdgeResource(edge) === resource);
|
|
54
26
|
};
|
|
27
|
+
var expandConnection = (connection, resources) => connection.sourceHandle === "output" ? resources.map((resource) => ({
|
|
28
|
+
...connection,
|
|
29
|
+
sourceHandle: resource
|
|
30
|
+
})) : [connection];
|
|
55
31
|
var canAddSourceNode = (nodes) => !nodes.some((node) => node.type === PipelineCanvasNodeType.SOURCE);
|
|
56
|
-
var getAutoConnections = (node, nodes) => {
|
|
32
|
+
var getAutoConnections = (node, nodes, resources) => {
|
|
57
33
|
if (!isConnectionNode(node) || nodes.some((existing) => existing.type === node.type)) return [];
|
|
58
34
|
const isSource = node.type === PipelineCanvasNodeType.SOURCE;
|
|
59
35
|
const counterpartType = PIPELINE_CANVAS_NODE_TYPE_TO_COUNTERPART_TYPE_MAP[node.type];
|
|
60
|
-
return nodes.filter((counterpart) => counterpart.type === counterpartType).
|
|
36
|
+
return nodes.filter((counterpart) => counterpart.type === counterpartType).flatMap((counterpart) => expandConnection({
|
|
61
37
|
source: isSource ? node.id : counterpart.id,
|
|
62
38
|
sourceHandle: PIPELINE_CANVAS_NODE_SOURCE_HANDLE_ID,
|
|
63
39
|
target: isSource ? counterpart.id : node.id,
|
|
64
40
|
targetHandle: PIPELINE_CANVAS_NODE_SINK_HANDLE_ID
|
|
65
|
-
}));
|
|
41
|
+
}, resources));
|
|
66
42
|
};
|
|
67
43
|
//#endregion
|
|
68
|
-
export { canAddSourceNode, canConnectEdge, createNodeFromConnection,
|
|
44
|
+
export { canAddSourceNode, canConnectEdge, createNodeFromConnection, expandConnection, getAutoConnections };
|
|
@@ -3,20 +3,20 @@ import { Resource, ResourceColumn } from '../../../../gen/ingestion/v1/connector
|
|
|
3
3
|
import { CanvasEdge } from '../types';
|
|
4
4
|
import { PipelineCanvasEdgeModeOptions } from '../utils';
|
|
5
5
|
interface PipelineCanvasEdgeConfigOptions extends PipelineCanvasEdgeModeOptions {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
resource: Resource["name"];
|
|
7
|
+
defaultCursor: ResourceColumn["name"];
|
|
8
8
|
}
|
|
9
|
-
export declare const usePipelineCanvasEdgeConfig: (edge: CanvasEdge, { readModeOptions, writeModeOptions, effectiveReadMode, effectiveWriteMode,
|
|
9
|
+
export declare const usePipelineCanvasEdgeConfig: (edge: CanvasEdge, { readModeOptions, writeModeOptions, effectiveReadMode, effectiveWriteMode, resource, defaultCursor, }: PipelineCanvasEdgeConfigOptions) => {
|
|
10
10
|
configuredReadMode: ReadMode;
|
|
11
11
|
configuredWriteMode: WriteMode;
|
|
12
12
|
readMode: ReadMode;
|
|
13
13
|
writeMode: WriteMode;
|
|
14
14
|
cursors: import('../../../../gen/ingestion/v1/pipelines_pb').ResourceCursorConfig[];
|
|
15
|
-
|
|
15
|
+
cursor: string | undefined;
|
|
16
16
|
readModeSelectOptions: import('@galaxy-io/dls/inputs/SelectInput').SelectOption<string>[];
|
|
17
17
|
writeModeSelectOptions: import('@galaxy-io/dls/inputs/SelectInput').SelectOption<string>[];
|
|
18
18
|
handleReadModeChange: (mode: ReadMode) => void;
|
|
19
19
|
handleWriteModeChange: (mode: WriteMode) => void;
|
|
20
|
-
handleCursorChange: (
|
|
20
|
+
handleCursorChange: (field: ResourceColumn["name"]) => void;
|
|
21
21
|
};
|
|
22
22
|
export {};
|
|
@@ -5,7 +5,7 @@ import { hasSiblingIncrementalRead } from "../utils.js";
|
|
|
5
5
|
import { usePipelineCanvasActions, usePipelineCanvasState } from "../providers/canvas/PipelineCanvasProvider.js";
|
|
6
6
|
import { create } from "@bufbuild/protobuf";
|
|
7
7
|
//#region src/pages/pipelines/canvas/hooks/usePipelineCanvasEdgeConfig.ts
|
|
8
|
-
var usePipelineCanvasEdgeConfig = (edge, { readModeOptions, writeModeOptions, effectiveReadMode, effectiveWriteMode,
|
|
8
|
+
var usePipelineCanvasEdgeConfig = (edge, { readModeOptions, writeModeOptions, effectiveReadMode, effectiveWriteMode, resource, defaultCursor }) => {
|
|
9
9
|
const { edges } = usePipelineCanvasState();
|
|
10
10
|
const { setEdgeConfig, setRouteWriteMode } = usePipelineCanvasActions();
|
|
11
11
|
const configuredReadMode = edge.data?.readMode ?? ReadMode.UNSPECIFIED;
|
|
@@ -13,12 +13,13 @@ var usePipelineCanvasEdgeConfig = (edge, { readModeOptions, writeModeOptions, ef
|
|
|
13
13
|
const readMode = configuredReadMode === ReadMode.UNSPECIFIED ? effectiveReadMode : configuredReadMode;
|
|
14
14
|
const writeMode = configuredWriteMode === WriteMode.UNSPECIFIED ? effectiveWriteMode : configuredWriteMode;
|
|
15
15
|
const cursors = edge.data?.cursors ?? [];
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const cursorConfig = cursors.find((candidate) => candidate.resource === resource);
|
|
17
|
+
const cursor = cursorConfig?.field;
|
|
18
|
+
const createDefaultCursors = () => defaultCursor === "" ? [] : [create(ResourceCursorConfigSchema, {
|
|
19
|
+
resource,
|
|
20
|
+
field: defaultCursor,
|
|
20
21
|
lookbackSeconds: 0n
|
|
21
|
-
})
|
|
22
|
+
})];
|
|
22
23
|
const routeHasIncremental = readMode === ReadMode.INCREMENTAL || hasSiblingIncrementalRead(edges, edge, edge.id);
|
|
23
24
|
const compatibleWriteModes = getCompatibleWriteModes(writeModeOptions, routeHasIncremental ? [ReadMode.INCREMENTAL] : []);
|
|
24
25
|
const handleReadModeChange = (mode) => {
|
|
@@ -32,14 +33,14 @@ var usePipelineCanvasEdgeConfig = (edge, { readModeOptions, writeModeOptions, ef
|
|
|
32
33
|
if (nextWriteMode !== writeMode) setRouteWriteMode(edge.source, edge.target, nextWriteMode);
|
|
33
34
|
};
|
|
34
35
|
const handleWriteModeChange = (mode) => setRouteWriteMode(edge.source, edge.target, mode);
|
|
35
|
-
const handleCursorChange = (
|
|
36
|
+
const handleCursorChange = (field) => setEdgeConfig(edge.id, {
|
|
36
37
|
readMode,
|
|
37
38
|
writeMode,
|
|
38
39
|
transform: edge.data?.transform,
|
|
39
|
-
cursors: [
|
|
40
|
-
resource
|
|
40
|
+
cursors: [create(ResourceCursorConfigSchema, {
|
|
41
|
+
resource,
|
|
41
42
|
field,
|
|
42
|
-
lookbackSeconds:
|
|
43
|
+
lookbackSeconds: cursorConfig?.lookbackSeconds ?? 0n
|
|
43
44
|
})]
|
|
44
45
|
});
|
|
45
46
|
return {
|
|
@@ -48,9 +49,9 @@ var usePipelineCanvasEdgeConfig = (edge, { readModeOptions, writeModeOptions, ef
|
|
|
48
49
|
readMode,
|
|
49
50
|
writeMode,
|
|
50
51
|
cursors,
|
|
51
|
-
|
|
52
|
-
readModeSelectOptions: getReadModeSelectOptions(readModeOptions),
|
|
53
|
-
writeModeSelectOptions: getWriteModeSelectOptions(compatibleWriteModes),
|
|
52
|
+
cursor,
|
|
53
|
+
readModeSelectOptions: getReadModeSelectOptions(readModeOptions, readMode),
|
|
54
|
+
writeModeSelectOptions: getWriteModeSelectOptions(compatibleWriteModes, writeMode),
|
|
54
55
|
handleReadModeChange,
|
|
55
56
|
handleWriteModeChange,
|
|
56
57
|
handleCursorChange
|
|
@@ -10,13 +10,12 @@ export interface PipelineCanvasEdgeResources {
|
|
|
10
10
|
isTransformable: boolean;
|
|
11
11
|
isLoadingColumns: boolean;
|
|
12
12
|
sourceConnectionId: Connection["id"];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
primaryKeyByResource: Record<Resource["name"], Resource["primaryKey"]>;
|
|
13
|
+
resource: Resource["name"];
|
|
14
|
+
columns: ResourceColumn[] | undefined;
|
|
15
|
+
cursorOptions: ResourceColumn[];
|
|
16
|
+
defaultCursor: ResourceColumn["name"];
|
|
17
|
+
isManagedIncremental: boolean;
|
|
18
|
+
hasPrimaryKey: boolean;
|
|
20
19
|
}
|
|
21
20
|
export declare const usePipelineCanvasEdgeResources: (edge: CanvasEdge, { enabled }?: PipelineCanvasEdgeResourcesOptions) => PipelineCanvasEdgeResources;
|
|
22
21
|
export {};
|
|
@@ -15,47 +15,41 @@ var usePipelineCanvasEdgeResources = (edge, { enabled = true } = {}) => {
|
|
|
15
15
|
const sourceConnectionId = sourceConnection?.id ?? "";
|
|
16
16
|
const hasReadLevers = !(sourceConnection?.replication === ReplicationMode.CDC) && !isContinuous;
|
|
17
17
|
const isTransformable = !isContinuous;
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const resource = getCanvasEdgeResource(edge);
|
|
19
|
+
const isQueryable = enabled && sourceConnectionId !== "" && resource !== "";
|
|
20
|
+
const { data: discovered } = useDiscoverResourcesQuery({
|
|
20
21
|
input: create(DiscoverResourcesRequestSchema, { connectionId: sourceConnectionId }),
|
|
21
22
|
options: {
|
|
22
23
|
...PROBE_QUERY_OPTIONS,
|
|
23
|
-
enabled:
|
|
24
|
+
enabled: isQueryable
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
|
-
const
|
|
27
|
-
const { data: columns, isLoading: isLoadingResourceColumns } = useGetResourceColumnsQuery({
|
|
27
|
+
const { data: columnsData, isLoading } = useGetResourceColumnsQuery({
|
|
28
28
|
input: create(GetResourceColumnsRequestSchema, {
|
|
29
29
|
connectionId: sourceConnectionId,
|
|
30
|
-
resources:
|
|
30
|
+
resources: [resource]
|
|
31
31
|
}),
|
|
32
32
|
options: {
|
|
33
33
|
...PROBE_QUERY_OPTIONS,
|
|
34
|
-
enabled:
|
|
34
|
+
enabled: isQueryable
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const defaultCursorByResource = useMemo(() => Object.fromEntries(coveredResources.map((resource) => [resource, managedIncrementalResources.has(resource) ? "" : getDefaultCursor(columnsByResource.get(resource) ?? [])])), [
|
|
42
|
-
coveredResources,
|
|
43
|
-
columnsByResource,
|
|
44
|
-
managedIncrementalResources
|
|
45
|
-
]);
|
|
37
|
+
const entry = columnsData?.resources.find((candidate) => candidate.resource === resource);
|
|
38
|
+
const columns = entry?.columns;
|
|
39
|
+
const isManagedIncremental = entry?.managedIncremental ?? false;
|
|
40
|
+
const cursorOptions = useMemo(() => getCursorOptions(columns ?? []), [columns]);
|
|
46
41
|
return {
|
|
47
42
|
isContinuous,
|
|
48
43
|
hasReadLevers,
|
|
49
44
|
isTransformable,
|
|
50
|
-
isLoadingColumns:
|
|
45
|
+
isLoadingColumns: isQueryable && isLoading,
|
|
51
46
|
sourceConnectionId,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
primaryKeyByResource
|
|
47
|
+
resource,
|
|
48
|
+
columns,
|
|
49
|
+
cursorOptions,
|
|
50
|
+
defaultCursor: isManagedIncremental ? "" : getDefaultCursor(columns ?? []),
|
|
51
|
+
isManagedIncremental,
|
|
52
|
+
hasPrimaryKey: (discovered?.resources.find((candidate) => candidate.name === resource)?.primaryKey.length ?? 0) > 0
|
|
59
53
|
};
|
|
60
54
|
};
|
|
61
55
|
//#endregion
|