@galaxy-io/filament-ui 0.7.0 → 0.9.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/api/queries/connectors.d.ts +2 -0
- package/dist/api/queries/connectors.js +9 -2
- package/dist/api/queries/pipeline_versions.d.ts +5 -0
- package/dist/api/queries/runs.d.ts +2 -0
- package/dist/api/queries/version.d.ts +6 -0
- package/dist/api/queries/version.js +11 -0
- package/dist/components/BaseHeader.d.ts +2 -0
- package/dist/components/BaseHeader.js +3 -2
- package/dist/components/connections/constants.js +1 -1
- package/dist/components/fields/Field.js +31 -27
- package/dist/components/fields/utils.js +2 -1
- package/dist/components/pipelines/PipelineName.js +1 -1
- package/dist/components/runs/PipelineRunRecords.js +1 -1
- package/dist/components/runs/PipelineRunVolume.js +1 -1
- package/dist/gen/ingestion/v1/connectors_pb.d.ts +6 -0
- package/dist/gen/ingestion/v1/connectors_pb.js +1 -1
- package/dist/gen/ingestion/v1/pipelines_pb.d.ts +26 -0
- package/dist/gen/ingestion/v1/pipelines_pb.js +17 -12
- package/dist/gen/ingestion/v1/runs_pb.d.ts +23 -0
- package/dist/gen/ingestion/v1/runs_pb.js +1 -1
- package/dist/gen/ingestion/v1/service_pb.d.ts +11 -0
- package/dist/gen/ingestion/v1/service_pb.js +5 -3
- package/dist/gen/ingestion/v1/version_pb.d.ts +37 -0
- package/dist/gen/ingestion/v1/version_pb.js +8 -0
- package/dist/layouts/main/MainLayoutSidebar.js +7 -1
- package/dist/module/FilamentLayout.js +8 -2
- package/dist/module/commands.js +1 -1
- package/dist/module/hooks.d.ts +4 -3
- package/dist/module/hooks.js +3 -2
- package/dist/module/routes.d.ts +1 -0
- package/dist/module/schemas.d.ts +1 -0
- package/dist/module/schemas.js +1 -0
- package/dist/module/types.d.ts +2 -1
- package/dist/module/types.js +1 -0
- package/dist/pages/connections/ConnectionsPage.js +1 -1
- package/dist/pages/connections/components/card/ConnectionCard.js +2 -2
- package/dist/pages/connections/components/create/select/CreateConnectionSelector.js +21 -7
- package/dist/pages/connections/components/create/select/CreateConnectionSelectorBody.d.ts +5 -3
- package/dist/pages/connections/components/create/select/CreateConnectionSelectorBody.js +50 -140
- package/dist/pages/connections/components/create/select/CreateConnectionSelectorSidebar.d.ts +12 -0
- package/dist/pages/connections/components/create/select/CreateConnectionSelectorSidebar.js +54 -0
- package/dist/pages/connections/components/create/select/hooks/useCreateConnectionSelectorCatalog.d.ts +11 -0
- package/dist/pages/connections/components/create/select/hooks/useCreateConnectionSelectorCatalog.js +45 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawer.js +1 -1
- package/dist/pages/connections/components/drawer/ConnectionDrawerJsonSection.js +2 -10
- package/dist/pages/connections/components/edit/EditConnectionModal.js +0 -3
- package/dist/pages/connections/components/form/ConnectionForm.js +0 -4
- package/dist/pages/connections/components/form/ConnectionFormWrapper.d.ts +0 -2
- package/dist/pages/connections/components/form/ConnectionFormWrapper.js +1 -2
- package/dist/pages/connections/constants.d.ts +0 -1
- package/dist/pages/connections/hooks/useConnectionPipelines.js +1 -1
- package/dist/pages/observability/components/metrics/ObservabilityMetricsWidget.js +1 -1
- package/dist/pages/observability/components/runs/ObservabilityRunsPastTable.js +2 -2
- package/dist/pages/observability/components/runs/ObservabilityRunsUpcomingTable.js +1 -1
- package/dist/pages/observability/components/setup/ObservabilitySetupChecklist.js +1 -1
- package/dist/pages/observability/components/setup/constants.js +1 -1
- package/dist/pages/pipelines/PipelineHistoryPage.js +1 -1
- package/dist/pages/pipelines/canvas/PipelineCanvasConnectionSelectorEmpty.js +1 -1
- package/dist/pages/pipelines/canvas/PipelineCanvasFlow.js +5 -7
- package/dist/pages/pipelines/canvas/PipelineCanvasViewSwitcher.d.ts +4 -1
- package/dist/pages/pipelines/canvas/PipelineCanvasViewSwitcher.js +9 -6
- package/dist/pages/pipelines/canvas/constants.d.ts +4 -1
- package/dist/pages/pipelines/canvas/constants.js +3 -5
- package/dist/pages/pipelines/canvas/graph/diff.js +4 -1
- package/dist/pages/pipelines/canvas/graph/serialize.js +1 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasActiveRuns.d.ts +2 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasActiveRuns.js +11 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasEdgeConfig.js +5 -2
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasEdgeResources.d.ts +1 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasEdgeResources.js +1 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasIsConnectionRunning.d.ts +2 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasIsConnectionRunning.js +5 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasIsRunning.js +2 -7
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasPanelResourceOptions.d.ts +1 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasPanelResourceOptions.js +2 -1
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasRunningEdgeIds.d.ts +2 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasRunningEdgeIds.js +18 -0
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasSelectionReveal.js +43 -6
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNode.d.ts +1 -0
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNode.js +4 -2
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeIsland.d.ts +1 -0
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeIsland.js +3 -4
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeSink.js +3 -0
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeSource.js +5 -1
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeSourceIsland.d.ts +1 -0
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeSourceIsland.js +2 -1
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeSourceIslandTableList.js +11 -3
- package/dist/pages/pipelines/canvas/nodes/constants.d.ts +0 -1
- package/dist/pages/pipelines/canvas/nodes/utils.d.ts +2 -0
- package/dist/pages/pipelines/canvas/nodes/utils.js +9 -1
- package/dist/pages/pipelines/canvas/panel/PipelineCanvasPanelHeader.js +2 -0
- package/dist/pages/pipelines/canvas/panel/activity/PipelineCanvasPanelActivityHeader.js +53 -26
- package/dist/pages/pipelines/canvas/panel/activity/constants.d.ts +1 -0
- package/dist/pages/pipelines/canvas/panel/constants.d.ts +1 -0
- package/dist/pages/pipelines/canvas/panel/constants.js +3 -1
- package/dist/pages/pipelines/canvas/panel/overview/PipelineCanvasPanelOverview.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/node/PipelineCanvasPanelNodeDetail.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceColumnsSection.d.ts +12 -0
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceColumnsSection.js +37 -0
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceDetail.js +58 -14
- package/dist/pages/pipelines/canvas/panel/overview/resource/transform/PipelineCanvasPanelResourceTransformSection.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/resource/transform/PipelineCanvasPanelResourceTransformSectionPending.js +1 -0
- package/dist/pages/pipelines/canvas/providers/canvas/PipelineCanvasProvider.d.ts +2 -1
- package/dist/pages/pipelines/canvas/providers/canvas/PipelineCanvasProvider.js +8 -0
- package/dist/pages/pipelines/canvas/providers/canvas/actions.d.ts +12 -3
- package/dist/pages/pipelines/canvas/providers/canvas/actions.js +1 -0
- package/dist/pages/pipelines/canvas/providers/canvas/reducer.js +27 -0
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesDraftRow.js +8 -10
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesIsland.d.ts +1 -0
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesIsland.js +8 -5
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesList.js +4 -3
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesRow.js +11 -11
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesSinkIsland.js +1 -0
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesSourceIsland.js +2 -1
- package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesToolbar.js +39 -17
- package/dist/pages/pipelines/canvas/routes/constants.d.ts +10 -2
- package/dist/pages/pipelines/canvas/types.d.ts +1 -0
- package/dist/pages/pipelines/canvas/utils.d.ts +5 -1
- package/dist/pages/pipelines/canvas/utils.js +13 -3
- package/dist/pages/pipelines/components/create/CreatePipelineModal.js +31 -29
- package/dist/pages/pipelines/components/create/CreatePipelineModalProvider.d.ts +2 -1
- package/dist/pages/pipelines/components/create/CreatePipelineModalProvider.js +4 -0
- package/dist/pages/pipelines/components/create/actions.d.ts +10 -1
- package/dist/pages/pipelines/components/create/actions.js +1 -0
- package/dist/pages/pipelines/components/create/components/CreatePipelineModalSidebar.js +39 -49
- package/dist/pages/pipelines/components/create/constants.d.ts +5 -1
- package/dist/pages/pipelines/components/create/constants.js +2 -2
- package/dist/pages/pipelines/components/create/hooks/useCreatePipelineResources.d.ts +3 -1
- package/dist/pages/pipelines/components/create/hooks/useCreatePipelineResources.js +17 -6
- package/dist/pages/pipelines/components/create/reducer.js +16 -0
- package/dist/pages/pipelines/components/create/rows.js +18 -2
- package/dist/pages/pipelines/components/create/serialize.js +8 -1
- package/dist/pages/pipelines/components/create/steps/CreatePipelineModalResources.d.ts +6 -1
- package/dist/pages/pipelines/components/create/steps/CreatePipelineModalResources.js +6 -2
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalConnectionsState.js +1 -1
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesColumnsPane.d.ts +8 -0
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesColumnsPane.js +83 -0
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesColumnsPaneFooter.d.ts +7 -0
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesColumnsPaneFooter.js +50 -0
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesCursorCell.js +1 -1
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesReadModeCell.js +1 -1
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesTable.d.ts +2 -0
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesTable.js +50 -12
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesWriteModeCell.js +1 -1
- package/dist/pages/pipelines/components/create/types.d.ts +5 -0
- package/dist/pages/pipelines/components/create/utils.js +1 -1
- package/dist/pages/pipelines/components/header/PipelinePageEditActions.js +6 -2
- package/dist/pages/pipelines/components/header/PipelinePageHeading.js +1 -1
- package/dist/pages/pipelines/components/header/PipelinePagePreviewBanner.js +2 -1
- package/dist/pages/pipelines/components/header/PipelinePageRunActions.js +5 -16
- package/dist/pages/pipelines/components/header/PipelinePageRunButton.d.ts +1 -4
- package/dist/pages/pipelines/components/header/PipelinePageRunButton.js +15 -89
- package/dist/pages/pipelines/components/header/PipelinePageScheduleBanner.js +1 -1
- package/dist/pages/pipelines/components/header/constants.d.ts +0 -1
- package/dist/pages/pipelines/components/resource/PipelineResourceColumnsChip.d.ts +8 -0
- package/dist/pages/pipelines/components/resource/PipelineResourceColumnsChip.js +14 -0
- package/dist/pages/pipelines/components/resource/PipelineResourceColumnsTable.d.ts +12 -0
- package/dist/pages/pipelines/components/resource/PipelineResourceColumnsTable.js +75 -0
- package/dist/pages/pipelines/components/resource/constants.d.ts +3 -0
- package/dist/pages/pipelines/components/resource/types.d.ts +2 -1
- package/dist/pages/pipelines/components/resource/types.js +1 -0
- package/dist/pages/pipelines/components/resource/utils.d.ts +17 -0
- package/dist/pages/pipelines/components/resource/utils.js +18 -1
- package/dist/pages/pipelines/components/run/PipelineRunModal.d.ts +9 -0
- package/dist/pages/pipelines/components/run/PipelineRunModal.js +245 -0
- package/dist/pages/pipelines/components/run/PipelineRunModalResourcesPane.d.ts +13 -0
- package/dist/pages/pipelines/components/run/PipelineRunModalResourcesPane.js +120 -0
- package/dist/pages/pipelines/components/run/PipelineRunModalSectionChip.d.ts +6 -0
- package/dist/pages/pipelines/components/run/PipelineRunModalSectionChip.js +14 -0
- package/dist/pages/pipelines/components/run/constants.d.ts +9 -0
- package/dist/pages/pipelines/components/run/constants.js +11 -0
- package/dist/pages/pipelines/components/run/types.d.ts +4 -0
- package/dist/pages/pipelines/components/run/types.js +8 -0
- package/dist/pages/pipelines/components/run/utils.d.ts +5 -0
- package/dist/pages/pipelines/components/run/utils.js +7 -0
- package/dist/pages/pipelines/components/table/PipelinesTable.js +2 -2
- package/dist/pages/pipelines/components/table/columns/PipelinesTableColumnRecentRuns.js +1 -1
- package/dist/pages/pipelines/components/table/columns/PipelinesTableColumnRecentRunsTooltip.js +2 -2
- package/dist/pages/pipelines/history/PipelineHistoryRunContinuousSummary.js +1 -1
- package/dist/pages/pipelines/history/PipelineHistoryRunInfo.js +2 -3
- package/dist/pages/pipelines/history/components/PipelineHistoryRunInfoConnectionColumn.js +1 -1
- package/dist/pages/pipelines/hooks/usePipelineRun.d.ts +3 -1
- package/dist/pages/pipelines/hooks/usePipelineRun.js +3 -1
- package/dist/pages/pipelines/utils.d.ts +1 -0
- package/dist/pages/pipelines/utils.js +2 -1
- package/dist/styles.css +6 -5
- package/dist/utils/format.d.ts +1 -0
- package/dist/utils/format.js +2 -1
- package/package.json +3 -3
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeSourceIslandTableShimmer.d.ts +0 -3
- package/dist/pages/pipelines/canvas/nodes/PipelineCanvasNodeSourceIslandTableShimmer.js +0 -10
|
@@ -2,6 +2,7 @@ import { ReadMode } from "../../../../../gen/ingestion/v1/common_pb.js";
|
|
|
2
2
|
import { PipelineCanvasNodeType } from "../../types.js";
|
|
3
3
|
import { PIPELINE_CANVAS_EDGE_TYPE } from "../../constants.js";
|
|
4
4
|
import { isConnectionNode } from "../../utils.js";
|
|
5
|
+
import { getCanvasEdgeConfig, getCanvasEdgeKey, getProtoEdgeKey } from "../../graph/serialize.js";
|
|
5
6
|
import { PipelineCanvasActionType } from "./actions.js";
|
|
6
7
|
import { canAddSourceNode, canConnectEdge, getAutoConnections } from "../../graph/rules.js";
|
|
7
8
|
import { addEdge, applyEdgeChanges, applyNodeChanges } from "@xyflow/react";
|
|
@@ -63,6 +64,31 @@ function applyEdgeChanges$1(state, action) {
|
|
|
63
64
|
edges: applyEdgeChanges(action.payload, state.edges)
|
|
64
65
|
};
|
|
65
66
|
}
|
|
67
|
+
function settleGraph(state, action) {
|
|
68
|
+
const { version, savedNodeConfigs, savedEdgeData } = action.payload;
|
|
69
|
+
const versionNodesById = new Map((version.graph?.nodes ?? []).map((node) => [node.id, node]));
|
|
70
|
+
const versionEdgesByKey = new Map((version.graph?.edges ?? []).map((edge) => [getProtoEdgeKey(edge), edge]));
|
|
71
|
+
return {
|
|
72
|
+
...state,
|
|
73
|
+
nodes: state.nodes.map((node) => {
|
|
74
|
+
const savedNode = versionNodesById.get(node.id);
|
|
75
|
+
return isConnectionNode(node) && node.data.config && savedNodeConfigs.has(node.data.config) && savedNode ? {
|
|
76
|
+
...node,
|
|
77
|
+
data: {
|
|
78
|
+
...node.data,
|
|
79
|
+
config: savedNode.config
|
|
80
|
+
}
|
|
81
|
+
} : node;
|
|
82
|
+
}),
|
|
83
|
+
edges: state.edges.map((edge) => {
|
|
84
|
+
const savedEdge = versionEdgesByKey.get(getCanvasEdgeKey(edge));
|
|
85
|
+
return edge.data && savedEdgeData.has(edge.data) && savedEdge ? {
|
|
86
|
+
...edge,
|
|
87
|
+
data: getCanvasEdgeConfig({}, savedEdge)
|
|
88
|
+
} : edge;
|
|
89
|
+
})
|
|
90
|
+
};
|
|
91
|
+
}
|
|
66
92
|
function connect(state, action) {
|
|
67
93
|
return {
|
|
68
94
|
...state,
|
|
@@ -127,6 +153,7 @@ var pipelineCanvasReducer = (state, action) => {
|
|
|
127
153
|
case PipelineCanvasActionType.SET_NODE_CONFIG: return setNodeConfig(state, action);
|
|
128
154
|
case PipelineCanvasActionType.SET_EDGE_CONFIG: return setEdgeConfig(state, action);
|
|
129
155
|
case PipelineCanvasActionType.SET_ROUTE_WRITE_MODE: return setRouteWriteMode(state, action);
|
|
156
|
+
case PipelineCanvasActionType.SETTLE_GRAPH: return settleGraph(state, action);
|
|
130
157
|
}
|
|
131
158
|
};
|
|
132
159
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectorKind, ReadMode, WriteMode } from "../../../../gen/ingestion/v1/common_pb.js";
|
|
2
2
|
import { getEnumSelectValue, mapOptionIdToEnum } from "../../../../utils/select.js";
|
|
3
|
-
import { ConnectorTileSize } from "../../../../components/connections/types.js";
|
|
4
3
|
import { ResourceCursorConfigSchema } from "../../../../gen/ingestion/v1/pipelines_pb.js";
|
|
4
|
+
import { ConnectorTileSize } from "../../../../components/connections/types.js";
|
|
5
5
|
import ConnectorTile from "../../../../components/connections/ConnectorTile.js";
|
|
6
6
|
import { getCompatibleWriteModes, getCursorSelectOptions, getDefaultReadMode, getReadModeSelectOptions, getWriteModeSelectOptions } from "../../components/resource/utils.js";
|
|
7
7
|
import { PIPELINE_CANVAS_NODE_SINK_HANDLE_ID } from "../constants.js";
|
|
@@ -18,7 +18,7 @@ import { useMemo } from "react";
|
|
|
18
18
|
import { create } from "@bufbuild/protobuf";
|
|
19
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
20
|
import Flex, { AlignItems } from "@galaxy-io/dls/layout/Flex";
|
|
21
|
-
import SelectInput, { SelectInputSize
|
|
21
|
+
import SelectInput, { SelectInputSize } from "@galaxy-io/dls/inputs/SelectInput";
|
|
22
22
|
import TextInput from "@galaxy-io/dls/inputs/TextInput";
|
|
23
23
|
import Box from "@galaxy-io/dls/layout/Box";
|
|
24
24
|
import Text, { TextSize, TextVariant } from "@galaxy-io/dls/text/Text";
|
|
@@ -133,7 +133,7 @@ var PipelineCanvasRoutesDraftRow = ({ draftState }) => {
|
|
|
133
133
|
onKeyDown: handleKeyDown,
|
|
134
134
|
children: /* @__PURE__ */ jsx(FlexItem, {
|
|
135
135
|
grow: 1,
|
|
136
|
-
minWidth:
|
|
136
|
+
minWidth: 0,
|
|
137
137
|
children: /* @__PURE__ */ jsx(Widget, {
|
|
138
138
|
variant: WidgetVariant.SECONDARY,
|
|
139
139
|
isFlush: true,
|
|
@@ -147,8 +147,8 @@ var PipelineCanvasRoutesDraftRow = ({ draftState }) => {
|
|
|
147
147
|
/* @__PURE__ */ jsxs(Flex, {
|
|
148
148
|
alignItems: AlignItems.CENTER,
|
|
149
149
|
gap: 8,
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
basis: 340,
|
|
151
|
+
minWidth: 220,
|
|
152
152
|
children: [
|
|
153
153
|
/* @__PURE__ */ jsx(ConnectorTile, {
|
|
154
154
|
connector: sourceConnection?.connector ?? "",
|
|
@@ -209,7 +209,6 @@ var PipelineCanvasRoutesDraftRow = ({ draftState }) => {
|
|
|
209
209
|
onChange: (id) => {
|
|
210
210
|
if (id !== null) draftState.setConfig({ readMode: mapOptionIdToEnum(ReadMode, id) });
|
|
211
211
|
},
|
|
212
|
-
variant: SelectInputVariant.SECONDARY,
|
|
213
212
|
size: SelectInputSize.SMALL,
|
|
214
213
|
placeholder: "Read mode...",
|
|
215
214
|
isDisabled: isLoading
|
|
@@ -224,7 +223,6 @@ var PipelineCanvasRoutesDraftRow = ({ draftState }) => {
|
|
|
224
223
|
onChange: (id) => {
|
|
225
224
|
if (id !== null) draftState.setConfig({ cursor: id });
|
|
226
225
|
},
|
|
227
|
-
variant: SelectInputVariant.SECONDARY,
|
|
228
226
|
size: SelectInputSize.SMALL,
|
|
229
227
|
placeholder: "Cursor...",
|
|
230
228
|
isDisabled: isLoading
|
|
@@ -244,15 +242,15 @@ var PipelineCanvasRoutesDraftRow = ({ draftState }) => {
|
|
|
244
242
|
onChange: (id) => {
|
|
245
243
|
if (id !== null) draftState.setConfig({ writeMode: mapOptionIdToEnum(WriteMode, id) });
|
|
246
244
|
},
|
|
247
|
-
variant: SelectInputVariant.SECONDARY,
|
|
248
245
|
size: SelectInputSize.SMALL,
|
|
249
246
|
placeholder: "Write mode...",
|
|
250
247
|
isDisabled: isLoading
|
|
251
248
|
})
|
|
252
249
|
}) })
|
|
253
250
|
] }),
|
|
254
|
-
/* @__PURE__ */ jsx(
|
|
255
|
-
|
|
251
|
+
/* @__PURE__ */ jsx(FlexItem, {
|
|
252
|
+
basis: 200,
|
|
253
|
+
minWidth: 120,
|
|
256
254
|
children: /* @__PURE__ */ jsx(SelectInput, {
|
|
257
255
|
ariaLabel: "Sink",
|
|
258
256
|
fillWidth: true,
|
|
@@ -6,25 +6,28 @@ import { styled } from "@linaria/react";
|
|
|
6
6
|
import { HAIRLINE_WIDTH } from "@galaxy-io/dls/styles/mixins";
|
|
7
7
|
//#region src/pages/pipelines/canvas/routes/PipelineCanvasRoutesIsland.tsx
|
|
8
8
|
var _exp = () => ({ $width }) => $width;
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var _exp2 = () => ({ $minWidth }) => $minWidth;
|
|
10
|
+
var _exp9 = () => ({ $isSelected }) => $isSelected ? t.color.solid.primary.background : t.color.border.primary;
|
|
11
|
+
var _exp1 = () => ({ $isSelected }) => $isSelected ? `${HAIRLINE_WIDTH} solid ${t.color.solid.primary.background}` : "none";
|
|
11
12
|
var Island = /*#__PURE__*/ styled("div")({
|
|
12
13
|
name: "Island",
|
|
13
14
|
class: "filament-PipelineCanvasRoutesIsland-Island-i1amic69",
|
|
14
15
|
propsAsIs: false,
|
|
15
16
|
vars: {
|
|
16
17
|
"i1amic69-0": [_exp(), "px"],
|
|
17
|
-
"i1amic69-1": [
|
|
18
|
-
"i1amic69-2": [
|
|
18
|
+
"i1amic69-1": [_exp2(), "px"],
|
|
19
|
+
"i1amic69-2": [_exp9()],
|
|
20
|
+
"i1amic69-3": [_exp1()]
|
|
19
21
|
}
|
|
20
22
|
});
|
|
21
|
-
var PipelineCanvasRoutesIsland = ({ width, isSelected, onSelect, children }) => {
|
|
23
|
+
var PipelineCanvasRoutesIsland = ({ width, minWidth, isSelected, onSelect, children }) => {
|
|
22
24
|
const handleClick = (event) => {
|
|
23
25
|
event.stopPropagation();
|
|
24
26
|
onSelect();
|
|
25
27
|
};
|
|
26
28
|
return /* @__PURE__ */ jsx(Island, {
|
|
27
29
|
$width: width,
|
|
30
|
+
$minWidth: minWidth,
|
|
28
31
|
$isSelected: isSelected,
|
|
29
32
|
"data-island": true,
|
|
30
33
|
"data-selected": isSelected,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { isPipelineCanvasRouteRunning } from "../utils.js";
|
|
1
2
|
import { usePipelineCanvasSelection } from "../hooks/usePipelineCanvasSelection.js";
|
|
2
|
-
import {
|
|
3
|
+
import { usePipelineCanvasActiveRuns } from "../hooks/usePipelineCanvasActiveRuns.js";
|
|
3
4
|
import { PipelineCanvasRoutesListItemKind } from "./types.js";
|
|
4
5
|
import { getPipelineCanvasRoutesListItems } from "./utils.js";
|
|
5
6
|
import { usePipelineCanvasRoutesVirtualizer } from "./hooks/usePipelineCanvasRoutesVirtualizer.js";
|
|
@@ -29,7 +30,7 @@ var ListRowSlot = /*#__PURE__*/ styled("div")({
|
|
|
29
30
|
});
|
|
30
31
|
var PipelineCanvasRoutesList = ({ routes, hasRoutes, draftState }) => {
|
|
31
32
|
const { selectedNodeId, selectedResourceId, selectResource, clearSelection } = usePipelineCanvasSelection();
|
|
32
|
-
const
|
|
33
|
+
const runs = usePipelineCanvasActiveRuns();
|
|
33
34
|
const items = useMemo(() => getPipelineCanvasRoutesListItems(routes, draftState.draft, draftState.resource), [
|
|
34
35
|
routes,
|
|
35
36
|
draftState.draft,
|
|
@@ -52,7 +53,7 @@ var PipelineCanvasRoutesList = ({ routes, hasRoutes, draftState }) => {
|
|
|
52
53
|
route,
|
|
53
54
|
isSelected: route.edge.id === selectedResourceId,
|
|
54
55
|
isGroupSelected: route.groupKey === selectedGroupKey,
|
|
55
|
-
isRunning,
|
|
56
|
+
isRunning: isPipelineCanvasRouteRunning(runs, route.sourceConnection?.id, route.sinkConnection?.id, route.resource),
|
|
56
57
|
onSelect: selectResource,
|
|
57
58
|
onAddSink: route.groupSize < draftState.sinkCount ? onAddSink : void 0
|
|
58
59
|
});
|
|
@@ -4,6 +4,7 @@ import PipelineCanvasRoutesSourceIsland from "./PipelineCanvasRoutesSourceIsland
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { memo } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import Flex from "@galaxy-io/dls/layout/Flex";
|
|
7
8
|
import { styled } from "@linaria/react";
|
|
8
9
|
//#region src/pages/pipelines/canvas/routes/PipelineCanvasRoutesRow.tsx
|
|
9
10
|
var RowWrapper = /*#__PURE__*/ styled("div")({
|
|
@@ -11,18 +12,17 @@ var RowWrapper = /*#__PURE__*/ styled("div")({
|
|
|
11
12
|
class: "filament-PipelineCanvasRoutesRow-RowWrapper-r125217",
|
|
12
13
|
propsAsIs: false
|
|
13
14
|
});
|
|
14
|
-
var SourceSlot = /*#__PURE__*/ styled("div")({
|
|
15
|
-
name: "SourceSlot",
|
|
16
|
-
class: "filament-PipelineCanvasRoutesRow-SourceSlot-syl3xfx",
|
|
17
|
-
propsAsIs: false
|
|
18
|
-
});
|
|
19
15
|
var PipelineCanvasRoutesRow = ({ route, isSelected, isGroupSelected, isRunning, onSelect, onAddSink }) => /* @__PURE__ */ jsxs(RowWrapper, { children: [
|
|
20
|
-
/* @__PURE__ */ jsx(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
/* @__PURE__ */ jsx(Flex, {
|
|
17
|
+
basis: 340,
|
|
18
|
+
minWidth: 220,
|
|
19
|
+
children: route.groupIndex === 0 && /* @__PURE__ */ jsx(PipelineCanvasRoutesSourceIsland, {
|
|
20
|
+
route,
|
|
21
|
+
isSelected: isGroupSelected,
|
|
22
|
+
onSelect: () => onSelect(route.edge.id),
|
|
23
|
+
onAddSink: onAddSink && (() => onAddSink(route.resource))
|
|
24
|
+
})
|
|
25
|
+
}),
|
|
26
26
|
/* @__PURE__ */ jsx(PipelineCanvasRoutesRowEdge, {
|
|
27
27
|
route,
|
|
28
28
|
isSelected,
|
|
@@ -8,6 +8,7 @@ import FlexItem from "@galaxy-io/dls/layout/FlexItem";
|
|
|
8
8
|
//#region src/pages/pipelines/canvas/routes/PipelineCanvasRoutesSinkIsland.tsx
|
|
9
9
|
var PipelineCanvasRoutesSinkIsland = ({ route, isSelected, onSelect }) => /* @__PURE__ */ jsxs(PipelineCanvasRoutesIsland, {
|
|
10
10
|
width: 200,
|
|
11
|
+
minWidth: 120,
|
|
11
12
|
isSelected,
|
|
12
13
|
onSelect,
|
|
13
14
|
children: [/* @__PURE__ */ jsx(ConnectorTile, {
|
|
@@ -17,7 +17,8 @@ var AddSinkSlot = /*#__PURE__*/ styled("div")({
|
|
|
17
17
|
propsAsIs: false
|
|
18
18
|
});
|
|
19
19
|
var PipelineCanvasRoutesSourceIsland = ({ route, isSelected, onSelect, onAddSink }) => /* @__PURE__ */ jsxs(PipelineCanvasRoutesIsland, {
|
|
20
|
-
width:
|
|
20
|
+
width: 340,
|
|
21
|
+
minWidth: 220,
|
|
21
22
|
isSelected,
|
|
22
23
|
onSelect,
|
|
23
24
|
children: [
|
|
@@ -7,20 +7,25 @@ import PipelineCanvasPanelOpenButton from "../panel/PipelineCanvasPanelOpenButto
|
|
|
7
7
|
import { usePipelineCanvasRoutesSinks } from "./hooks/usePipelineCanvasRoutesSinks.js";
|
|
8
8
|
import { PlusIcon } from "@phosphor-icons/react";
|
|
9
9
|
import Button, { ButtonSize, ButtonVariant } from "@galaxy-io/dls/buttons/Button";
|
|
10
|
-
import { useMemo } from "react";
|
|
10
|
+
import { useMemo, useRef } from "react";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import Flex, { AlignItems } from "@galaxy-io/dls/layout/Flex";
|
|
13
|
-
import Box from "@galaxy-io/dls/layout/Box";
|
|
12
|
+
import Flex, { AlignItems, JustifyContent } from "@galaxy-io/dls/layout/Flex";
|
|
14
13
|
import Text from "@galaxy-io/dls/text/Text";
|
|
15
14
|
import { InputVariant } from "@galaxy-io/dls/inputs/Input";
|
|
16
15
|
import MultiSelectInput, { MultiSelectInputSize, MultiSelectInputVariant } from "@galaxy-io/dls/inputs/MultiSelectInput";
|
|
17
16
|
import FlexItem from "@galaxy-io/dls/layout/FlexItem";
|
|
18
17
|
import SearchInput from "@galaxy-io/dls/inputs/SearchInput";
|
|
19
18
|
import pluralize from "pluralize";
|
|
19
|
+
import { useElementWidth } from "@galaxy-io/dls/hooks/useElementWidth";
|
|
20
20
|
//#region src/pages/pipelines/canvas/routes/PipelineCanvasRoutesToolbar.tsx
|
|
21
21
|
var PipelineCanvasRoutesToolbar = ({ onSearch, canAddRoute, onAddRoute }) => {
|
|
22
22
|
const { sinkIds, setSinkIds } = usePipelineCanvasSelection();
|
|
23
23
|
const sinks = usePipelineCanvasRoutesSinks();
|
|
24
|
+
const toolbarRef = useRef(null);
|
|
25
|
+
const toolbarWidth = useElementWidth(toolbarRef);
|
|
26
|
+
const isCompact = toolbarWidth !== void 0 && toolbarWidth < 580;
|
|
27
|
+
const isIconOnly = toolbarWidth !== void 0 && toolbarWidth < 500;
|
|
28
|
+
const hasSinkFilter = toolbarWidth === void 0 || toolbarWidth >= 380;
|
|
24
29
|
const sinkOptions = useMemo(() => sinks.map((sink) => ({
|
|
25
30
|
id: sink.nodeId,
|
|
26
31
|
label: sink.label,
|
|
@@ -36,15 +41,23 @@ var PipelineCanvasRoutesToolbar = ({ onSearch, canAddRoute, onAddRoute }) => {
|
|
|
36
41
|
setSinkIds(ids.length === sinkOptions.length ? [] : ids);
|
|
37
42
|
};
|
|
38
43
|
return /* @__PURE__ */ jsxs(Flex, {
|
|
44
|
+
ref: toolbarRef,
|
|
39
45
|
alignItems: AlignItems.CENTER,
|
|
40
46
|
gap: 12,
|
|
41
47
|
padding: 16,
|
|
42
48
|
shrink: 0,
|
|
49
|
+
minWidth: 0,
|
|
50
|
+
overflow: "hidden",
|
|
43
51
|
fillWidth: true,
|
|
44
52
|
children: [
|
|
45
|
-
/* @__PURE__ */ jsx(
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
/* @__PURE__ */ jsx(FlexItem, {
|
|
54
|
+
shrink: 0,
|
|
55
|
+
children: /* @__PURE__ */ jsx(PipelineCanvasViewSwitcher, { isIconOnly })
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ jsx(FlexItem, {
|
|
58
|
+
shrink: 1,
|
|
59
|
+
basis: 280,
|
|
60
|
+
minWidth: 96,
|
|
48
61
|
children: /* @__PURE__ */ jsx(SearchInput, {
|
|
49
62
|
ariaLabel: "Search resources",
|
|
50
63
|
variant: InputVariant.SECONDARY,
|
|
@@ -54,8 +67,10 @@ var PipelineCanvasRoutesToolbar = ({ onSearch, canAddRoute, onAddRoute }) => {
|
|
|
54
67
|
fillWidth: true
|
|
55
68
|
})
|
|
56
69
|
}),
|
|
57
|
-
/* @__PURE__ */ jsx(
|
|
58
|
-
|
|
70
|
+
hasSinkFilter && /* @__PURE__ */ jsx(FlexItem, {
|
|
71
|
+
shrink: 3,
|
|
72
|
+
basis: 220,
|
|
73
|
+
minWidth: 88,
|
|
59
74
|
children: /* @__PURE__ */ jsx(MultiSelectInput, {
|
|
60
75
|
ariaLabel: "Sinks",
|
|
61
76
|
fillWidth: true,
|
|
@@ -69,15 +84,22 @@ var PipelineCanvasRoutesToolbar = ({ onSearch, canAddRoute, onAddRoute }) => {
|
|
|
69
84
|
renderValue: (options) => /* @__PURE__ */ jsx(Text, { children: pluralize("sink", options.length, true) })
|
|
70
85
|
})
|
|
71
86
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
/* @__PURE__ */ jsxs(Flex, {
|
|
88
|
+
alignItems: AlignItems.CENTER,
|
|
89
|
+
justifyContent: JustifyContent.END,
|
|
90
|
+
gap: 12,
|
|
91
|
+
grow: 1,
|
|
92
|
+
children: [canAddRoute && /* @__PURE__ */ jsx(Button, {
|
|
93
|
+
icon: PlusIcon,
|
|
94
|
+
variant: ButtonVariant.SECONDARY,
|
|
95
|
+
size: ButtonSize.MEDIUM,
|
|
96
|
+
onClick: onAddRoute,
|
|
97
|
+
...isCompact ? {
|
|
98
|
+
ariaLabel: "Add route",
|
|
99
|
+
tooltip: "Add route"
|
|
100
|
+
} : { label: "Add route" }
|
|
101
|
+
}), /* @__PURE__ */ jsx(PipelineCanvasPanelOpenButton, {})]
|
|
102
|
+
})
|
|
81
103
|
]
|
|
82
104
|
});
|
|
83
105
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { Space } from '@galaxy-io/dls/theme/enums';
|
|
2
2
|
export declare const PIPELINE_CANVAS_ROUTES_ROW_HEIGHT = 44;
|
|
3
3
|
export declare const PIPELINE_CANVAS_ROUTES_ISLAND_HEIGHT = 30;
|
|
4
|
-
export declare const PIPELINE_CANVAS_ROUTES_SOURCE_ISLAND_WIDTH =
|
|
4
|
+
export declare const PIPELINE_CANVAS_ROUTES_SOURCE_ISLAND_WIDTH = 340;
|
|
5
|
+
export declare const PIPELINE_CANVAS_ROUTES_SOURCE_ISLAND_MIN_WIDTH = 220;
|
|
5
6
|
export declare const PIPELINE_CANVAS_ROUTES_SINK_ISLAND_WIDTH = 200;
|
|
7
|
+
export declare const PIPELINE_CANVAS_ROUTES_SINK_ISLAND_MIN_WIDTH = 120;
|
|
6
8
|
export declare const PIPELINE_CANVAS_ROUTES_LIST_PADDING_X: Space;
|
|
7
9
|
export declare const PIPELINE_CANVAS_ROUTES_LIST_PADDING_Y: Space;
|
|
8
10
|
export declare const PIPELINE_CANVAS_ROUTES_OVERSCAN = 6;
|
|
9
11
|
export declare const PIPELINE_CANVAS_ROUTES_EDGE_CONTROL_INSET = 24;
|
|
10
12
|
export declare const PIPELINE_CANVAS_ROUTES_EDGE_CONTROL_GAP: Space;
|
|
11
|
-
export declare const PIPELINE_CANVAS_ROUTES_EDGE_MIN_WIDTH =
|
|
13
|
+
export declare const PIPELINE_CANVAS_ROUTES_EDGE_MIN_WIDTH = 440;
|
|
12
14
|
export declare const PIPELINE_CANVAS_ROUTES_ROW_MIN_WIDTH: number;
|
|
13
15
|
export declare const PIPELINE_CANVAS_ROUTES_EDGE_HIT_PADDING = 4;
|
|
14
16
|
export declare const PIPELINE_CANVAS_ROUTES_EDGE_FAN_CONTROL_X = 22;
|
|
@@ -17,7 +19,13 @@ export declare const PIPELINE_CANVAS_ROUTES_EDGE_DASH_ARRAY = "5 5";
|
|
|
17
19
|
export declare const PIPELINE_CANVAS_ROUTES_EDGE_DASH_PERIOD = 10;
|
|
18
20
|
export declare const PIPELINE_CANVAS_ROUTES_EDGE_DASH_DURATION = "0.5s";
|
|
19
21
|
export declare const PIPELINE_CANVAS_ROUTES_SEARCH_WIDTH = 280;
|
|
22
|
+
export declare const PIPELINE_CANVAS_ROUTES_SEARCH_MIN_WIDTH = 96;
|
|
20
23
|
export declare const PIPELINE_CANVAS_ROUTES_SINK_FILTER_WIDTH = 220;
|
|
24
|
+
export declare const PIPELINE_CANVAS_ROUTES_SINK_FILTER_MIN_WIDTH = 88;
|
|
25
|
+
export declare const PIPELINE_CANVAS_ROUTES_SINK_FILTER_SHRINK = 3;
|
|
26
|
+
export declare const PIPELINE_CANVAS_ROUTES_TOOLBAR_COMPACT_WIDTH = 580;
|
|
27
|
+
export declare const PIPELINE_CANVAS_ROUTES_TOOLBAR_ICON_ONLY_WIDTH = 500;
|
|
28
|
+
export declare const PIPELINE_CANVAS_ROUTES_TOOLBAR_NO_SINK_FILTER_WIDTH = 380;
|
|
21
29
|
export declare const PIPELINE_CANVAS_ROUTES_READ_MODE_SELECT_WIDTH = 112;
|
|
22
30
|
export declare const PIPELINE_CANVAS_ROUTES_CURSOR_SELECT_WIDTH = 136;
|
|
23
31
|
export declare const PIPELINE_CANVAS_ROUTES_WRITE_MODE_SELECT_WIDTH = 104;
|
|
@@ -31,6 +31,7 @@ export type PipelineCanvasPlaceholderNode = Node<PipelineCanvasPlaceholderNodeDa
|
|
|
31
31
|
export type CanvasNode = PipelineCanvasSourceNode | PipelineCanvasSinkNode | PipelineCanvasPlaceholderNode;
|
|
32
32
|
export type PipelineCanvasEdgeTransform = JsonObject;
|
|
33
33
|
export type PipelineCanvasEdgeData = Pick<PipelineEdge, "readMode" | "writeMode" | "cursors"> & {
|
|
34
|
+
columns?: PipelineEdge["columns"];
|
|
34
35
|
transform?: PipelineCanvasEdgeTransform;
|
|
35
36
|
destinationResource?: string;
|
|
36
37
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Rect } from '@xyflow/react';
|
|
1
2
|
import { Theme } from '@galaxy-io/dls/theme/tokens/types';
|
|
2
3
|
import { EdgeValidation } from '../../../gen/ingestion/v1/capabilities_pb';
|
|
3
4
|
import { ReadMode, WriteMode } from '../../../gen/ingestion/v1/common_pb';
|
|
4
5
|
import { Connection } from '../../../gen/ingestion/v1/connections_pb';
|
|
5
6
|
import { ResourceColumn } from '../../../gen/ingestion/v1/connectors_pb';
|
|
6
7
|
import { PipelineEdge } from '../../../gen/ingestion/v1/pipelines_pb';
|
|
8
|
+
import { RunInfo } from '../../../gen/ingestion/v1/runs_pb';
|
|
7
9
|
import { PipelineFlowEndpoints } from '../../../components/pipelines/utils';
|
|
8
10
|
import { PipelineCanvasEdgeResources } from './hooks/usePipelineCanvasEdgeResources';
|
|
9
11
|
import { CanvasEdge, CanvasNode, PipelineCanvasEdgeTransform, PipelineCanvasSinkNode, PipelineCanvasSourceNode } from './types';
|
|
@@ -29,7 +31,9 @@ export declare const mapElementsToSelected: <T extends {
|
|
|
29
31
|
selected?: boolean;
|
|
30
32
|
}>(elements: T[], selectedId: string | undefined) => T[];
|
|
31
33
|
export declare const getDefaultDestinationResource: (resource: PipelineEdge["resource"]) => string;
|
|
32
|
-
export declare const
|
|
34
|
+
export declare const getPipelineCanvasRevealBounds: (bounds: Rect, nodes: CanvasNode[], isDiscovering: boolean) => Rect;
|
|
35
|
+
export declare const isPipelineCanvasRouteRunning: (runs: RunInfo[], sourceConnectionId: Connection["id"] | undefined, sinkConnectionId: Connection["id"] | undefined, resource: PipelineEdge["resource"]) => boolean;
|
|
36
|
+
export declare const mapEdgesToStyledEdges: (edges: CanvasEdge[], nodes: CanvasNode[], theme: Theme, runningEdgeIds: Set<CanvasEdge["id"]>, invalidEdgeIds: Set<CanvasEdge["id"]>) => CanvasEdge[];
|
|
33
37
|
export declare const mapCanvasNodesToFlowEndpoints: (nodes: CanvasNode[]) => PipelineFlowEndpoints;
|
|
34
38
|
export declare const isConnectionNode: (node: CanvasNode) => node is PipelineCanvasSourceNode | PipelineCanvasSinkNode;
|
|
35
39
|
export declare const isPipelineCanvasConnectionDisabled: (connection: Connection, isSourceDisabled: boolean) => boolean;
|
|
@@ -2,7 +2,7 @@ import { ConnectorKind, ReadMode, WriteMode } from "../../../gen/ingestion/v1/co
|
|
|
2
2
|
import { PipelineCanvasNodeType } from "./types.js";
|
|
3
3
|
import { isJsonObject } from "../../../components/fields/utils.js";
|
|
4
4
|
import { getPipelineResourceStatus, getRecommendedCursor, getSharedModes } from "../components/resource/utils.js";
|
|
5
|
-
import { PIPELINE_CANVAS_EDGE_Z_INDEX } from "./constants.js";
|
|
5
|
+
import { PIPELINE_CANVAS_EDGE_Z_INDEX, PIPELINE_CANVAS_SOURCE_NODE_EXPECTED_HEIGHT } from "./constants.js";
|
|
6
6
|
//#region src/pages/pipelines/canvas/utils.ts
|
|
7
7
|
var getEdgeModeOptions = (verdict, hasReadLevers) => ({
|
|
8
8
|
readModeOptions: verdict && hasReadLevers ? getSharedModes(verdict.resources.map((resource) => resource.supportedReadModes)) : [],
|
|
@@ -38,9 +38,19 @@ var mapElementsToSelected = (elements, selectedId) => elements.map((element) =>
|
|
|
38
38
|
};
|
|
39
39
|
});
|
|
40
40
|
var getDefaultDestinationResource = (resource) => resource.replace(/[^a-zA-Z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
|
|
41
|
-
var
|
|
41
|
+
var getPipelineCanvasRevealBounds = (bounds, nodes, isDiscovering) => {
|
|
42
|
+
if (!isDiscovering) return bounds;
|
|
43
|
+
const bottom = nodes.filter((node) => node.type === PipelineCanvasNodeType.SOURCE).reduce((max, node) => Math.max(max, node.position.y + PIPELINE_CANVAS_SOURCE_NODE_EXPECTED_HEIGHT), bounds.y + bounds.height);
|
|
44
|
+
return {
|
|
45
|
+
...bounds,
|
|
46
|
+
height: bottom - bounds.y
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
var isPipelineCanvasRouteRunning = (runs, sourceConnectionId, sinkConnectionId, resource) => runs.some((run) => run.sourceConnectionId === sourceConnectionId && run.sinkConnectionId === sinkConnectionId && (run.resources.length === 0 || run.resources.includes(resource)));
|
|
50
|
+
var mapEdgesToStyledEdges = (edges, nodes, theme, runningEdgeIds, invalidEdgeIds) => {
|
|
42
51
|
const selectedNodeIds = new Set(nodes.filter((node) => node.selected).map((node) => node.id));
|
|
43
52
|
return edges.map((edge) => {
|
|
53
|
+
const isRunning = runningEdgeIds.has(edge.id);
|
|
44
54
|
const isConnectedToSelected = selectedNodeIds.has(edge.source) || selectedNodeIds.has(edge.target);
|
|
45
55
|
const isHighlighted = edge.selected || isConnectedToSelected;
|
|
46
56
|
const isInvalid = invalidEdgeIds.has(edge.id);
|
|
@@ -64,4 +74,4 @@ var mapCanvasNodesToFlowEndpoints = (nodes) => ({
|
|
|
64
74
|
var isConnectionNode = (node) => node.type === PipelineCanvasNodeType.SOURCE || node.type === PipelineCanvasNodeType.SINK;
|
|
65
75
|
var isPipelineCanvasConnectionDisabled = (connection, isSourceDisabled) => isSourceDisabled && connection.kind === ConnectorKind.SOURCE;
|
|
66
76
|
//#endregion
|
|
67
|
-
export { getDefaultDestinationResource, getEdgeModeOptions, getEdgeResourceStatus, getTransformStepCount, isConnectionNode, isPipelineCanvasConnectionDisabled, mapCanvasNodesToFlowEndpoints, mapEdgesToStyledEdges, mapElementsToSelected };
|
|
77
|
+
export { getDefaultDestinationResource, getEdgeModeOptions, getEdgeResourceStatus, getPipelineCanvasRevealBounds, getTransformStepCount, isConnectionNode, isPipelineCanvasConnectionDisabled, isPipelineCanvasRouteRunning, mapCanvasNodesToFlowEndpoints, mapEdgesToStyledEdges, mapElementsToSelected };
|
|
@@ -8,20 +8,31 @@ import CreatePipelineModalConnections from "./steps/CreatePipelineModalConnectio
|
|
|
8
8
|
import CreatePipelineModalDelivery from "./steps/CreatePipelineModalDelivery.js";
|
|
9
9
|
import CreatePipelineModalDetails from "./steps/CreatePipelineModalDetails.js";
|
|
10
10
|
import CreatePipelineModalResources from "./steps/CreatePipelineModalResources.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import CreatePipelineModalResourcesColumnsPane from "./steps/components/CreatePipelineModalResourcesColumnsPane.js";
|
|
12
|
+
import { useState } from "react";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
import Flex, { FlexDirection } from "@galaxy-io/dls/layout/Flex";
|
|
13
15
|
import { match } from "ts-pattern";
|
|
14
16
|
import Box, { BoxVariant } from "@galaxy-io/dls/layout/Box";
|
|
15
|
-
import Modal
|
|
16
|
-
import FlexItem from "@galaxy-io/dls/layout/FlexItem";
|
|
17
|
-
import { Orientation, Radius } from "@galaxy-io/dls/theme/enums";
|
|
18
|
-
import Divider from "@galaxy-io/dls/layout/Divider";
|
|
17
|
+
import Modal from "@galaxy-io/dls/modal/Modal";
|
|
19
18
|
import ScrollArea from "@galaxy-io/dls/layout/ScrollArea";
|
|
20
19
|
//#region src/pages/pipelines/components/create/CreatePipelineModal.tsx
|
|
20
|
+
var DEFAULT_CONTENT_STATE = {};
|
|
21
21
|
var CreatePipelineModalContent = ({ isOpen, onClose }) => {
|
|
22
|
-
const { step } = useCreatePipelineModalState();
|
|
22
|
+
const { step, rowsBySink, activeSinkId } = useCreatePipelineModalState();
|
|
23
|
+
const [localState, setLocalState] = useState(DEFAULT_CONTENT_STATE);
|
|
24
|
+
const activeRow = step === CreatePipelineModalStep.RESOURCES ? rowsBySink[activeSinkId]?.find((row) => row.name === localState.activeResource && row.isColumnSelectable) : void 0;
|
|
25
|
+
const handleActiveResourceChange = (activeResource) => {
|
|
26
|
+
setLocalState((prev) => ({
|
|
27
|
+
...prev,
|
|
28
|
+
activeResource
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
23
31
|
const renderBody = () => {
|
|
24
|
-
const body = match(step).with(CreatePipelineModalStep.CONNECTIONS, () => /* @__PURE__ */ jsx(CreatePipelineModalConnections, {})).with(CreatePipelineModalStep.RESOURCES, () => /* @__PURE__ */ jsx(CreatePipelineModalResources, {
|
|
32
|
+
const body = match(step).with(CreatePipelineModalStep.CONNECTIONS, () => /* @__PURE__ */ jsx(CreatePipelineModalConnections, {})).with(CreatePipelineModalStep.RESOURCES, () => /* @__PURE__ */ jsx(CreatePipelineModalResources, {
|
|
33
|
+
activeRow,
|
|
34
|
+
onActiveResourceChange: handleActiveResourceChange
|
|
35
|
+
})).with(CreatePipelineModalStep.DELIVERY, () => /* @__PURE__ */ jsx(CreatePipelineModalDelivery, {})).with(CreatePipelineModalStep.DETAILS, () => /* @__PURE__ */ jsx(CreatePipelineModalDetails, {})).exhaustive();
|
|
25
36
|
if (CREATE_PIPELINE_MODAL_STEP_TO_IS_PADDED_MAP[step]) return /* @__PURE__ */ jsx(ScrollArea, { children: /* @__PURE__ */ jsx(Box, {
|
|
26
37
|
padding: 16,
|
|
27
38
|
children: body
|
|
@@ -34,32 +45,23 @@ var CreatePipelineModalContent = ({ isOpen, onClose }) => {
|
|
|
34
45
|
};
|
|
35
46
|
return /* @__PURE__ */ jsx(Modal, {
|
|
36
47
|
isOpen,
|
|
37
|
-
|
|
38
|
-
header: "
|
|
48
|
+
isFullscreen: true,
|
|
49
|
+
header: "New pipeline",
|
|
50
|
+
sidebar: activeRow ? null : /* @__PURE__ */ jsx(CreatePipelineModalSidebar, {}),
|
|
39
51
|
footer: /* @__PURE__ */ jsx(CreatePipelineModalFooter, {}),
|
|
52
|
+
aside: activeRow ? /* @__PURE__ */ jsx(CreatePipelineModalResourcesColumnsPane, {
|
|
53
|
+
row: activeRow,
|
|
54
|
+
onClose: () => handleActiveResourceChange(void 0)
|
|
55
|
+
}, activeRow.name) : null,
|
|
56
|
+
hasDividers: true,
|
|
57
|
+
isFlush: true,
|
|
40
58
|
onOpenChange: (isOpen) => {
|
|
41
59
|
if (!isOpen) onClose();
|
|
42
60
|
},
|
|
43
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
62
|
+
variant: BoxVariant.BASE,
|
|
44
63
|
height: "100%",
|
|
45
|
-
|
|
46
|
-
hasBorder: true,
|
|
47
|
-
radius: Radius.LG,
|
|
48
|
-
overflow: "hidden",
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ jsx(CreatePipelineModalSidebar, {}),
|
|
51
|
-
/* @__PURE__ */ jsx(Divider, { orientation: Orientation.VERTICAL }),
|
|
52
|
-
/* @__PURE__ */ jsx(FlexItem, {
|
|
53
|
-
grow: 1,
|
|
54
|
-
basis: 0,
|
|
55
|
-
minWidth: 0,
|
|
56
|
-
children: /* @__PURE__ */ jsx(Box, {
|
|
57
|
-
variant: BoxVariant.BASE,
|
|
58
|
-
height: "100%",
|
|
59
|
-
children: renderBody()
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
]
|
|
64
|
+
children: renderBody()
|
|
63
65
|
})
|
|
64
66
|
});
|
|
65
67
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import { AddNotifierAction, AddResourceAction, GoToStepAction, RemoveNotifierAction, SelectSourceAction, SetActiveSinkAction, SetDescriptionAction, SetExecutionModeAction, SetNameAction, SetNodeConfigAction, SetResourceCursorAction, SetResourceReadModeAction, SetResourceSelectionAction, SetResourceWriteModeAction, SetScheduleAction, SetSinkWriteModeAction, SetSubmittingAction, SetWorkerConfigurationAction, ToggleSinkAction, UpdateNotifierAction } from './actions';
|
|
2
|
+
import { AddNotifierAction, AddResourceAction, GoToStepAction, RemoveNotifierAction, SelectSourceAction, SetActiveSinkAction, SetDescriptionAction, SetExecutionModeAction, SetNameAction, SetNodeConfigAction, SetResourceColumnsAction, SetResourceCursorAction, SetResourceReadModeAction, SetResourceSelectionAction, SetResourceWriteModeAction, SetScheduleAction, SetSinkWriteModeAction, SetSubmittingAction, SetWorkerConfigurationAction, ToggleSinkAction, UpdateNotifierAction } from './actions';
|
|
3
3
|
import { CreatePipelineModalContextValue } from './types';
|
|
4
4
|
export declare const useCreatePipelineModalState: () => CreatePipelineModalContextValue;
|
|
5
5
|
export declare const useCreatePipelineModalActions: () => {
|
|
@@ -11,6 +11,7 @@ export declare const useCreatePipelineModalActions: () => {
|
|
|
11
11
|
setResourceSelection: (payload: SetResourceSelectionAction["payload"]) => void;
|
|
12
12
|
setResourceReadMode: (payload: SetResourceReadModeAction["payload"]) => void;
|
|
13
13
|
setResourceCursor: (payload: SetResourceCursorAction["payload"]) => void;
|
|
14
|
+
setResourceColumns: (payload: SetResourceColumnsAction["payload"]) => void;
|
|
14
15
|
setResourceWriteMode: (payload: SetResourceWriteModeAction["payload"]) => void;
|
|
15
16
|
setSinkWriteMode: (payload: SetSinkWriteModeAction["payload"]) => void;
|
|
16
17
|
setNodeConfig: (payload: SetNodeConfigAction["payload"]) => void;
|
|
@@ -64,6 +64,10 @@ var useCreatePipelineModalActions = () => {
|
|
|
64
64
|
type: CreatePipelineModalActionType.SET_RESOURCE_CURSOR,
|
|
65
65
|
payload
|
|
66
66
|
}),
|
|
67
|
+
setResourceColumns: (payload) => dispatch({
|
|
68
|
+
type: CreatePipelineModalActionType.SET_RESOURCE_COLUMNS,
|
|
69
|
+
payload
|
|
70
|
+
}),
|
|
67
71
|
setResourceWriteMode: (payload) => dispatch({
|
|
68
72
|
type: CreatePipelineModalActionType.SET_RESOURCE_WRITE_MODE,
|
|
69
73
|
payload
|
|
@@ -15,6 +15,7 @@ export declare enum CreatePipelineModalActionType {
|
|
|
15
15
|
SET_RESOURCE_SELECTION = "SET_RESOURCE_SELECTION",
|
|
16
16
|
SET_RESOURCE_READ_MODE = "SET_RESOURCE_READ_MODE",
|
|
17
17
|
SET_RESOURCE_CURSOR = "SET_RESOURCE_CURSOR",
|
|
18
|
+
SET_RESOURCE_COLUMNS = "SET_RESOURCE_COLUMNS",
|
|
18
19
|
SET_RESOURCE_WRITE_MODE = "SET_RESOURCE_WRITE_MODE",
|
|
19
20
|
SET_SINK_WRITE_MODE = "SET_SINK_WRITE_MODE",
|
|
20
21
|
SET_NODE_CONFIG = "SET_NODE_CONFIG",
|
|
@@ -77,6 +78,14 @@ export interface SetResourceCursorAction {
|
|
|
77
78
|
cursorField: ResourceColumn["name"];
|
|
78
79
|
};
|
|
79
80
|
}
|
|
81
|
+
export interface SetResourceColumnsAction {
|
|
82
|
+
type: CreatePipelineModalActionType.SET_RESOURCE_COLUMNS;
|
|
83
|
+
payload: {
|
|
84
|
+
sinkId: Connection["id"];
|
|
85
|
+
resource: Resource["name"];
|
|
86
|
+
columns: ResourceColumn["name"][];
|
|
87
|
+
};
|
|
88
|
+
}
|
|
80
89
|
export interface SetResourceWriteModeAction {
|
|
81
90
|
type: CreatePipelineModalActionType.SET_RESOURCE_WRITE_MODE;
|
|
82
91
|
payload: {
|
|
@@ -144,5 +153,5 @@ export interface SetSubmittingAction {
|
|
|
144
153
|
type: CreatePipelineModalActionType.SET_SUBMITTING;
|
|
145
154
|
payload: boolean;
|
|
146
155
|
}
|
|
147
|
-
export type CreatePipelineModalAction = SelectSourceAction | ToggleSinkAction | SetActiveSinkAction | SetExecutionModeAction | AddResourceAction | SetResourceSelectionAction | SetResourceReadModeAction | SetResourceCursorAction | SetResourceWriteModeAction | SetSinkWriteModeAction | SetNodeConfigAction | SetNameAction | SetDescriptionAction | SetScheduleAction | AddNotifierAction | UpdateNotifierAction | RemoveNotifierAction | SetWorkerConfigurationAction | GoToStepAction | GoBackAction | GoNextAction | SetSubmittingAction;
|
|
156
|
+
export type CreatePipelineModalAction = SelectSourceAction | ToggleSinkAction | SetActiveSinkAction | SetExecutionModeAction | AddResourceAction | SetResourceSelectionAction | SetResourceReadModeAction | SetResourceCursorAction | SetResourceColumnsAction | SetResourceWriteModeAction | SetSinkWriteModeAction | SetNodeConfigAction | SetNameAction | SetDescriptionAction | SetScheduleAction | AddNotifierAction | UpdateNotifierAction | RemoveNotifierAction | SetWorkerConfigurationAction | GoToStepAction | GoBackAction | GoNextAction | SetSubmittingAction;
|
|
148
157
|
export {};
|
|
@@ -8,6 +8,7 @@ var CreatePipelineModalActionType = /* @__PURE__ */ function(CreatePipelineModal
|
|
|
8
8
|
CreatePipelineModalActionType["SET_RESOURCE_SELECTION"] = "SET_RESOURCE_SELECTION";
|
|
9
9
|
CreatePipelineModalActionType["SET_RESOURCE_READ_MODE"] = "SET_RESOURCE_READ_MODE";
|
|
10
10
|
CreatePipelineModalActionType["SET_RESOURCE_CURSOR"] = "SET_RESOURCE_CURSOR";
|
|
11
|
+
CreatePipelineModalActionType["SET_RESOURCE_COLUMNS"] = "SET_RESOURCE_COLUMNS";
|
|
11
12
|
CreatePipelineModalActionType["SET_RESOURCE_WRITE_MODE"] = "SET_RESOURCE_WRITE_MODE";
|
|
12
13
|
CreatePipelineModalActionType["SET_SINK_WRITE_MODE"] = "SET_SINK_WRITE_MODE";
|
|
13
14
|
CreatePipelineModalActionType["SET_NODE_CONFIG"] = "SET_NODE_CONFIG";
|