@galaxy-io/filament-ui 0.7.0 → 0.8.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/components/BaseHeader.d.ts +2 -0
- package/dist/components/BaseHeader.js +3 -2
- package/dist/components/fields/Field.js +31 -27
- package/dist/components/fields/utils.js +2 -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/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/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/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/observability/components/setup/ObservabilitySetupChecklist.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/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 +7 -9
- 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/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/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 +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/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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import Flex, { AlignItems, JustifyContent } from "@galaxy-io/dls/layout/Flex";
|
|
5
|
+
import Chip, { ChipSize, ChipVariant } from "@galaxy-io/dls/chips/Chip";
|
|
6
|
+
import Text, { TextSize, TextVariant } from "@galaxy-io/dls/text/Text";
|
|
7
|
+
import { FontFamily } from "@galaxy-io/dls/theme/enums";
|
|
8
|
+
import { isSearchMatch } from "@galaxy-io/dls/utils/search";
|
|
9
|
+
import EmptyLayout, { EmptyLayoutSize } from "@galaxy-io/dls/layout/EmptyLayout";
|
|
10
|
+
import InfiniteTable, { InfiniteTableSize } from "@galaxy-io/dls/table/InfiniteTable";
|
|
11
|
+
//#region src/pages/pipelines/components/resource/PipelineResourceColumnsTable.tsx
|
|
12
|
+
var RESOURCE_COLUMN_TABLE_COLUMNS = [{
|
|
13
|
+
id: "name",
|
|
14
|
+
header: "Column",
|
|
15
|
+
isRowHeader: true,
|
|
16
|
+
cell: ({ row }) => /* @__PURE__ */ jsxs(Flex, {
|
|
17
|
+
alignItems: AlignItems.CENTER,
|
|
18
|
+
gap: 8,
|
|
19
|
+
minWidth: 0,
|
|
20
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
21
|
+
size: TextSize.BODY_SM,
|
|
22
|
+
family: FontFamily.MONO,
|
|
23
|
+
lineClamp: 1,
|
|
24
|
+
children: row.name
|
|
25
|
+
}), row.isPrimaryKey && /* @__PURE__ */ jsx(Chip, {
|
|
26
|
+
label: "primary key",
|
|
27
|
+
tooltip: "Part of the primary key",
|
|
28
|
+
size: ChipSize.SMALL,
|
|
29
|
+
variant: ChipVariant.TERTIARY
|
|
30
|
+
})]
|
|
31
|
+
})
|
|
32
|
+
}, {
|
|
33
|
+
id: "type",
|
|
34
|
+
header: "Type",
|
|
35
|
+
width: 200,
|
|
36
|
+
align: "right",
|
|
37
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(Flex, {
|
|
38
|
+
justifyContent: JustifyContent.END,
|
|
39
|
+
fillWidth: true,
|
|
40
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
41
|
+
size: TextSize.BODY_SM,
|
|
42
|
+
family: FontFamily.MONO,
|
|
43
|
+
variant: TextVariant.TERTIARY,
|
|
44
|
+
lineClamp: 1,
|
|
45
|
+
children: row.nativeType || row.logicalType
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
}];
|
|
49
|
+
var PipelineResourceColumnsTable = ({ columns, selected, locked, isDisabled, search = "", onChange }) => {
|
|
50
|
+
const visibleColumns = useMemo(() => columns.filter((column) => isSearchMatch(search, column.name)), [columns, search]);
|
|
51
|
+
const handleChange = (next) => {
|
|
52
|
+
const visibleNames = new Set(visibleColumns.map((column) => column.name));
|
|
53
|
+
const kept = columns.map((column) => column.name).filter((name) => next.includes(name) || locked.includes(name) || !visibleNames.has(name) && selected.includes(name));
|
|
54
|
+
if (kept.length > 0) onChange(kept);
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ jsx(InfiniteTable, {
|
|
57
|
+
ariaLabel: "Columns",
|
|
58
|
+
columns: RESOURCE_COLUMN_TABLE_COLUMNS,
|
|
59
|
+
data: visibleColumns,
|
|
60
|
+
getRowId: (row) => row.name,
|
|
61
|
+
size: InfiniteTableSize.SMALL,
|
|
62
|
+
inset: 4,
|
|
63
|
+
value: selected,
|
|
64
|
+
onChange: isDisabled ? void 0 : handleChange,
|
|
65
|
+
canSelectRow: (column) => !locked.includes(column.name),
|
|
66
|
+
emptyState: /* @__PURE__ */ jsx(EmptyLayout, {
|
|
67
|
+
size: EmptyLayoutSize.SMALL,
|
|
68
|
+
icon: MagnifyingGlassIcon,
|
|
69
|
+
header: "No columns match your search"
|
|
70
|
+
}),
|
|
71
|
+
isSelectable: true
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
export { PipelineResourceColumnsTable as default };
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { Space } from '@galaxy-io/dls/theme/enums';
|
|
1
2
|
import { ReadMode, WriteMode } from '../../../../gen/ingestion/v1/common_pb';
|
|
2
3
|
export declare const READ_MODE_TO_WRITE_MODES_MAP: Record<ReadMode, WriteMode[]>;
|
|
4
|
+
export declare const PIPELINE_RESOURCE_COLUMNS_TABLE_INSET: Space;
|
|
5
|
+
export declare const PIPELINE_RESOURCE_COLUMNS_TABLE_WIDTH_TYPE = 200;
|
|
@@ -3,7 +3,8 @@ import { CanvasNode } from '../../canvas/types';
|
|
|
3
3
|
export declare enum PipelineResourceStatusField {
|
|
4
4
|
READ_MODE = "readMode",
|
|
5
5
|
CURSOR = "cursor",
|
|
6
|
-
WRITE_MODE = "writeMode"
|
|
6
|
+
WRITE_MODE = "writeMode",
|
|
7
|
+
COLUMNS = "columns"
|
|
7
8
|
}
|
|
8
9
|
export interface PipelineResourceStatus {
|
|
9
10
|
resource: Resource["name"];
|
|
@@ -3,6 +3,7 @@ var PipelineResourceStatusField = /* @__PURE__ */ function(PipelineResourceStatu
|
|
|
3
3
|
PipelineResourceStatusField["READ_MODE"] = "readMode";
|
|
4
4
|
PipelineResourceStatusField["CURSOR"] = "cursor";
|
|
5
5
|
PipelineResourceStatusField["WRITE_MODE"] = "writeMode";
|
|
6
|
+
PipelineResourceStatusField["COLUMNS"] = "columns";
|
|
6
7
|
return PipelineResourceStatusField;
|
|
7
8
|
}({});
|
|
8
9
|
//#endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SelectOption } from '@galaxy-io/dls/inputs/SelectInput';
|
|
2
2
|
import { ReadMode, WriteMode } from '../../../../gen/ingestion/v1/common_pb';
|
|
3
3
|
import { Resource, ResourceColumn } from '../../../../gen/ingestion/v1/connectors_pb';
|
|
4
|
+
import { ResourceColumnSelection } from '../../../../gen/ingestion/v1/pipelines_pb';
|
|
4
5
|
import { PipelineResourceStatus } from './types';
|
|
5
6
|
export declare const getReadModeSelectOptions: (modes: ReadMode[], selected: ReadMode) => SelectOption[];
|
|
6
7
|
export declare const getWriteModeSelectOptions: (modes: WriteMode[], selected: WriteMode) => SelectOption[];
|
|
@@ -10,6 +11,22 @@ export declare const getCompatibleWriteModes: (writeModes: WriteMode[], readMode
|
|
|
10
11
|
export declare const getCursorOptions: (columns: ResourceColumn[]) => ResourceColumn[];
|
|
11
12
|
export declare const getRecommendedCursor: (columns: ResourceColumn[]) => ResourceColumn["name"];
|
|
12
13
|
export declare const getDefaultCursor: (columns: ResourceColumn[]) => ResourceColumn["name"];
|
|
14
|
+
export declare const getLockedColumnNames: ({ primaryKey, cursor, isCursorLocked, }: {
|
|
15
|
+
primaryKey: ResourceColumn["name"][];
|
|
16
|
+
cursor: ResourceColumn["name"];
|
|
17
|
+
isCursorLocked: boolean;
|
|
18
|
+
}) => ResourceColumn["name"][];
|
|
19
|
+
export declare const getEffectiveColumnSelection: ({ stored, columns, locked, }: {
|
|
20
|
+
stored: ResourceColumn["name"][] | undefined;
|
|
21
|
+
columns: ResourceColumn[] | undefined;
|
|
22
|
+
locked: ResourceColumn["name"][];
|
|
23
|
+
}) => ResourceColumn["name"][];
|
|
24
|
+
export declare const createResourceColumnSelections: ({ resource, selected, columns, }: {
|
|
25
|
+
resource: Resource["name"];
|
|
26
|
+
selected: ResourceColumn["name"][];
|
|
27
|
+
columns: ResourceColumn[];
|
|
28
|
+
}) => ResourceColumnSelection[];
|
|
29
|
+
export declare const addColumnToSelections: (selections: ResourceColumnSelection[], resource: Resource["name"], column: ResourceColumn["name"]) => ResourceColumnSelection[];
|
|
13
30
|
export declare const getDefaultReadMode: ({ columns, readModeOptions, managedIncremental, fallback, }: {
|
|
14
31
|
columns: ResourceColumn[];
|
|
15
32
|
readModeOptions: ReadMode[];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ReadMode, WriteMode } from "../../../../gen/ingestion/v1/common_pb.js";
|
|
2
2
|
import { createEnumSelectOptions } from "../../../../utils/select.js";
|
|
3
|
+
import { ResourceColumnSelectionSchema } from "../../../../gen/ingestion/v1/pipelines_pb.js";
|
|
3
4
|
import { READ_MODE_TO_LABEL_MAP, WRITE_MODE_TO_LABEL_MAP } from "../create/constants.js";
|
|
4
5
|
import { READ_MODE_TO_WRITE_MODES_MAP } from "./constants.js";
|
|
5
6
|
import { PipelineResourceStatusField } from "./types.js";
|
|
7
|
+
import { create } from "@bufbuild/protobuf";
|
|
6
8
|
//#region src/pages/pipelines/components/resource/utils.ts
|
|
7
9
|
var getReadModeSelectOptions = (modes, selected) => createEnumSelectOptions(selected === ReadMode.UNSPECIFIED || modes.includes(selected) ? modes : [...modes, selected], READ_MODE_TO_LABEL_MAP);
|
|
8
10
|
var getWriteModeSelectOptions = (modes, selected) => createEnumSelectOptions(selected === WriteMode.UNSPECIFIED || modes.includes(selected) ? modes : [...modes, selected], WRITE_MODE_TO_LABEL_MAP);
|
|
@@ -25,6 +27,21 @@ var getDefaultCursor = (columns) => {
|
|
|
25
27
|
const eligible = getCursorOptions(columns);
|
|
26
28
|
return eligible.length === 1 ? eligible[0].name : "";
|
|
27
29
|
};
|
|
30
|
+
var getLockedColumnNames = ({ primaryKey, cursor, isCursorLocked }) => isCursorLocked && cursor ? [...primaryKey, cursor] : primaryKey;
|
|
31
|
+
var getEffectiveColumnSelection = ({ stored, columns, locked }) => {
|
|
32
|
+
const known = columns?.map((column) => column.name);
|
|
33
|
+
if (stored === void 0) return known ?? [];
|
|
34
|
+
const kept = known ? stored.filter((name) => known.includes(name)) : stored;
|
|
35
|
+
return (known ?? [...kept, ...locked]).filter((name) => kept.includes(name) || locked.includes(name));
|
|
36
|
+
};
|
|
37
|
+
var createResourceColumnSelections = ({ resource, selected, columns }) => selected.length === 0 || selected.length === columns.length ? [] : [create(ResourceColumnSelectionSchema, {
|
|
38
|
+
resource,
|
|
39
|
+
columns: selected
|
|
40
|
+
})];
|
|
41
|
+
var addColumnToSelections = (selections, resource, column) => column === "" ? selections : selections.map((selection) => selection.resource === resource && !selection.columns.includes(column) ? create(ResourceColumnSelectionSchema, {
|
|
42
|
+
resource,
|
|
43
|
+
columns: [...selection.columns, column]
|
|
44
|
+
}) : selection);
|
|
28
45
|
var getDefaultReadMode = ({ columns, readModeOptions, managedIncremental, fallback }) => (managedIncremental || getRecommendedCursor(columns) !== "") && readModeOptions.includes(ReadMode.INCREMENTAL) ? ReadMode.INCREMENTAL : fallback;
|
|
29
46
|
var getPipelineResourceStatus = ({ resource, readMode, readModeOptions, cursorField, cursorOptions, isCursorKnown, managedIncremental, hasPrimaryKey, needsPrimaryKey }) => {
|
|
30
47
|
if (!readModeOptions.includes(readMode)) return {
|
|
@@ -55,4 +72,4 @@ var getPipelineResourceStatus = ({ resource, readMode, readModeOptions, cursorFi
|
|
|
55
72
|
};
|
|
56
73
|
};
|
|
57
74
|
//#endregion
|
|
58
|
-
export { getCompatibleWriteModes, getCursorOptions, getCursorSelectOptions, getDefaultCursor, getDefaultReadMode, getPipelineResourceStatus, getReadModeSelectOptions, getRecommendedCursor, getSharedModes, getWriteModeSelectOptions };
|
|
75
|
+
export { addColumnToSelections, createResourceColumnSelections, getCompatibleWriteModes, getCursorOptions, getCursorSelectOptions, getDefaultCursor, getDefaultReadMode, getEffectiveColumnSelection, getLockedColumnNames, getPipelineResourceStatus, getReadModeSelectOptions, getRecommendedCursor, getSharedModes, getWriteModeSelectOptions };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Pipeline } from '../../../../gen/ingestion/v1/pipelines_pb';
|
|
3
|
+
interface PipelineRunModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
pipelineId?: Pipeline["id"];
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const PipelineRunModal: FC<PipelineRunModalProps>;
|
|
9
|
+
export default PipelineRunModal;
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { FilamentPath } from "../../../../module/paths.js";
|
|
2
|
+
import { useFilamentNavigate } from "../../../../module/hooks.js";
|
|
3
|
+
import { IS_DEBUG } from "../../../../constants.js";
|
|
4
|
+
import { isNotFoundError } from "../../../../utils/errors.js";
|
|
5
|
+
import { createGetConnectionInput, useGetConnectionQuery } from "../../../../api/queries/connections.js";
|
|
6
|
+
import { useOverlayRecord } from "../../../../hooks/useOverlayRecord.js";
|
|
7
|
+
import { useOverlaySession } from "../../../../hooks/useOverlaySession.js";
|
|
8
|
+
import PipelineFlow, { PipelineFlowSize } from "../../../../components/pipelines/PipelineFlow.js";
|
|
9
|
+
import { formatPipelineName, mapVersionNodesToFlowEndpoints } from "../../../../components/pipelines/utils.js";
|
|
10
|
+
import { createGetPipelineInput, useGetPipelineQuery } from "../../../../api/queries/pipelines.js";
|
|
11
|
+
import { getPipelineResources } from "../../utils.js";
|
|
12
|
+
import { formatWorkerConfiguration, isWorkerConfigurationEqual, parseWorkerConfiguration } from "../worker/utils.js";
|
|
13
|
+
import PipelineWorkerConfigurationEditor from "../worker/PipelineWorkerConfigurationEditor.js";
|
|
14
|
+
import PipelineRunModalSectionChip from "./PipelineRunModalSectionChip.js";
|
|
15
|
+
import { canPipelineRunSubset } from "./utils.js";
|
|
16
|
+
import PipelineRunModalResourcesPane from "./PipelineRunModalResourcesPane.js";
|
|
17
|
+
import { usePipelineRun } from "../../hooks/usePipelineRun.js";
|
|
18
|
+
import { CaretRightIcon, PlayIcon } from "@phosphor-icons/react";
|
|
19
|
+
import Button, { ButtonVariant } from "@galaxy-io/dls/buttons/Button";
|
|
20
|
+
import ErrorLayout from "@galaxy-io/dls/layout/ErrorLayout";
|
|
21
|
+
import { useCallback, useState } from "react";
|
|
22
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
import PendingLayout from "@galaxy-io/dls/layout/PendingLayout";
|
|
24
|
+
import Flex, { AlignItems, FlexDirection, JustifyContent } from "@galaxy-io/dls/layout/Flex";
|
|
25
|
+
import Text, { TextSize, TextVariant, TextWeight } from "@galaxy-io/dls/text/Text";
|
|
26
|
+
import Widget from "@galaxy-io/dls/widget/Widget";
|
|
27
|
+
import Icon, { IconVariant, IconWeight } from "@galaxy-io/dls/icons/Icon";
|
|
28
|
+
import Modal, { ModalSize } from "@galaxy-io/dls/modal/Modal";
|
|
29
|
+
//#region src/pages/pipelines/components/run/PipelineRunModal.tsx
|
|
30
|
+
var PipelineRunModalContent = ({ isOpen, pipeline, onClose }) => {
|
|
31
|
+
const navigate = useFilamentNavigate();
|
|
32
|
+
const { startRun, isRunning } = usePipelineRun();
|
|
33
|
+
const { workerConfiguration, currentVersion } = pipeline;
|
|
34
|
+
const resources = getPipelineResources(currentVersion);
|
|
35
|
+
const { sourceId, sinkIds } = mapVersionNodesToFlowEndpoints(currentVersion?.graph?.nodes ?? []);
|
|
36
|
+
const pipelineName = formatPipelineName(pipeline);
|
|
37
|
+
const { data: sourceData } = useGetConnectionQuery({
|
|
38
|
+
input: createGetConnectionInput(sourceId ?? ""),
|
|
39
|
+
options: { enabled: !!sourceId }
|
|
40
|
+
});
|
|
41
|
+
const canSubset = canPipelineRunSubset(pipeline, sourceData?.connection);
|
|
42
|
+
const defaultWorkerConfiguration = formatWorkerConfiguration(workerConfiguration);
|
|
43
|
+
const [state, setState] = useState(() => ({
|
|
44
|
+
workerConfiguration: defaultWorkerConfiguration,
|
|
45
|
+
selectedResources: resources,
|
|
46
|
+
resyncResources: [],
|
|
47
|
+
isResourcesPaneOpen: false
|
|
48
|
+
}));
|
|
49
|
+
const parsed = parseWorkerConfiguration(state.workerConfiguration);
|
|
50
|
+
const isWorkerDefault = state.workerConfiguration === defaultWorkerConfiguration || !parsed.error && isWorkerConfigurationEqual(parsed.configuration, workerConfiguration);
|
|
51
|
+
const runResources = canSubset ? state.selectedResources : resources;
|
|
52
|
+
const isSubset = runResources.length < resources.length;
|
|
53
|
+
const resyncResources = state.resyncResources.filter((resource) => runResources.includes(resource));
|
|
54
|
+
const isResourcesDefault = !isSubset && resyncResources.length === 0;
|
|
55
|
+
const isDefault = isWorkerDefault && isResourcesDefault;
|
|
56
|
+
const handleSelectedResourcesChange = useCallback((selectedResources) => setState((prev) => ({
|
|
57
|
+
...prev,
|
|
58
|
+
selectedResources
|
|
59
|
+
})), []);
|
|
60
|
+
const handleResyncResourcesChange = useCallback((resyncResources) => setState((prev) => ({
|
|
61
|
+
...prev,
|
|
62
|
+
resyncResources
|
|
63
|
+
})), []);
|
|
64
|
+
const handleResourcesPaneToggle = (isResourcesPaneOpen) => setState((prev) => ({
|
|
65
|
+
...prev,
|
|
66
|
+
isResourcesPaneOpen
|
|
67
|
+
}));
|
|
68
|
+
const handleWorkerConfigurationChange = (workerConfiguration) => setState((prev) => ({
|
|
69
|
+
...prev,
|
|
70
|
+
workerConfiguration
|
|
71
|
+
}));
|
|
72
|
+
const handleReset = () => setState((prev) => ({
|
|
73
|
+
...prev,
|
|
74
|
+
workerConfiguration: defaultWorkerConfiguration,
|
|
75
|
+
selectedResources: resources,
|
|
76
|
+
resyncResources: []
|
|
77
|
+
}));
|
|
78
|
+
const handleRun = () => {
|
|
79
|
+
startRun(pipeline, {
|
|
80
|
+
workerConfiguration: isWorkerDefault ? void 0 : parsed.configuration,
|
|
81
|
+
resources: isSubset ? runResources : [],
|
|
82
|
+
resyncResources,
|
|
83
|
+
onSuccess: () => void navigate({
|
|
84
|
+
to: FilamentPath.PIPELINE_CANVAS,
|
|
85
|
+
params: { id: pipeline.id },
|
|
86
|
+
search: ({ flow: _, pipelineId: __, ...rest }) => rest
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
91
|
+
isOpen,
|
|
92
|
+
header: /* @__PURE__ */ jsxs(Flex, {
|
|
93
|
+
alignItems: AlignItems.CENTER,
|
|
94
|
+
gap: 8,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
97
|
+
component: PlayIcon,
|
|
98
|
+
size: 15,
|
|
99
|
+
weight: IconWeight.FILL,
|
|
100
|
+
variant: IconVariant.PRIMARY
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ jsx(Text, {
|
|
103
|
+
size: TextSize.BODY_LG,
|
|
104
|
+
weight: TextWeight.MEDIUM,
|
|
105
|
+
children: "Run"
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ jsx(PipelineFlow, {
|
|
108
|
+
sourceId,
|
|
109
|
+
sinkIds,
|
|
110
|
+
size: PipelineFlowSize.SMALL
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ jsx(Text, {
|
|
113
|
+
size: TextSize.BODY_LG,
|
|
114
|
+
weight: TextWeight.MEDIUM,
|
|
115
|
+
children: pipelineName
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
}),
|
|
119
|
+
ariaLabel: `Run ${pipelineName}`,
|
|
120
|
+
size: ModalSize.MEDIUM,
|
|
121
|
+
aside: state.isResourcesPaneOpen ? /* @__PURE__ */ jsx(PipelineRunModalResourcesPane, {
|
|
122
|
+
resources,
|
|
123
|
+
selectedResources: runResources,
|
|
124
|
+
resyncResources: state.resyncResources,
|
|
125
|
+
isDefault: isResourcesDefault,
|
|
126
|
+
canSubset,
|
|
127
|
+
onSelectedChange: handleSelectedResourcesChange,
|
|
128
|
+
onResyncChange: handleResyncResourcesChange,
|
|
129
|
+
onClose: () => handleResourcesPaneToggle(false)
|
|
130
|
+
}) : null,
|
|
131
|
+
footer: /* @__PURE__ */ jsxs(Flex, {
|
|
132
|
+
justifyContent: JustifyContent.END,
|
|
133
|
+
gap: 8,
|
|
134
|
+
fillWidth: true,
|
|
135
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
136
|
+
label: "Reset",
|
|
137
|
+
variant: ButtonVariant.SECONDARY,
|
|
138
|
+
isDisabled: isDefault,
|
|
139
|
+
onClick: handleReset
|
|
140
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
141
|
+
label: isDefault ? "Run now" : "Start custom run",
|
|
142
|
+
icon: PlayIcon,
|
|
143
|
+
iconWeight: IconWeight.FILL,
|
|
144
|
+
variant: ButtonVariant.PRIMARY,
|
|
145
|
+
isLoading: isRunning,
|
|
146
|
+
isDisabled: !!parsed.error || runResources.length === 0,
|
|
147
|
+
onClick: handleRun
|
|
148
|
+
})]
|
|
149
|
+
}),
|
|
150
|
+
hasDividers: true,
|
|
151
|
+
onOpenChange: (isOpen) => {
|
|
152
|
+
if (!isOpen) onClose();
|
|
153
|
+
},
|
|
154
|
+
children: /* @__PURE__ */ jsxs(Flex, {
|
|
155
|
+
direction: FlexDirection.COLUMN,
|
|
156
|
+
alignItems: AlignItems.STRETCH,
|
|
157
|
+
gap: 12,
|
|
158
|
+
children: [/* @__PURE__ */ jsx(Widget, {
|
|
159
|
+
isInteractive: true,
|
|
160
|
+
ariaLabel: state.isResourcesPaneOpen ? "Close resources" : "Open resources",
|
|
161
|
+
isDisabled: resources.length === 0,
|
|
162
|
+
onClick: () => handleResourcesPaneToggle(!state.isResourcesPaneOpen),
|
|
163
|
+
children: /* @__PURE__ */ jsxs(Flex, {
|
|
164
|
+
alignItems: AlignItems.CENTER,
|
|
165
|
+
justifyContent: JustifyContent.SPACE_BETWEEN,
|
|
166
|
+
gap: 8,
|
|
167
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
168
|
+
size: TextSize.BODY_MD,
|
|
169
|
+
weight: TextWeight.MEDIUM,
|
|
170
|
+
variant: state.isResourcesPaneOpen ? TextVariant.PRIMARY : TextVariant.SECONDARY,
|
|
171
|
+
children: "Resources"
|
|
172
|
+
}), /* @__PURE__ */ jsxs(Flex, {
|
|
173
|
+
alignItems: AlignItems.CENTER,
|
|
174
|
+
gap: 8,
|
|
175
|
+
children: [/* @__PURE__ */ jsx(PipelineRunModalSectionChip, { isDefault: isResourcesDefault }), /* @__PURE__ */ jsx(Icon, {
|
|
176
|
+
component: CaretRightIcon,
|
|
177
|
+
size: 12,
|
|
178
|
+
variant: IconVariant.SECONDARY
|
|
179
|
+
})]
|
|
180
|
+
})]
|
|
181
|
+
})
|
|
182
|
+
}), /* @__PURE__ */ jsx(Widget, {
|
|
183
|
+
isCollapsible: true,
|
|
184
|
+
defaultIsOpen: true,
|
|
185
|
+
header: "Worker configuration",
|
|
186
|
+
actions: /* @__PURE__ */ jsx(PipelineRunModalSectionChip, { isDefault: isWorkerDefault }),
|
|
187
|
+
children: /* @__PURE__ */ jsx(PipelineWorkerConfigurationEditor, {
|
|
188
|
+
value: state.workerConfiguration,
|
|
189
|
+
onChange: handleWorkerConfigurationChange,
|
|
190
|
+
error: parsed.error,
|
|
191
|
+
isPerRun: true
|
|
192
|
+
})
|
|
193
|
+
})]
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
var PipelineRunModal = ({ isOpen, pipelineId, onClose }) => {
|
|
198
|
+
const session = useOverlaySession(isOpen);
|
|
199
|
+
const heldPipelineId = useOverlayRecord(isOpen, pipelineId);
|
|
200
|
+
const { data, error, isError } = useGetPipelineQuery({
|
|
201
|
+
input: createGetPipelineInput(heldPipelineId ?? ""),
|
|
202
|
+
options: {
|
|
203
|
+
enabled: !!session && !!heldPipelineId,
|
|
204
|
+
retry: false
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
if (!session) return null;
|
|
208
|
+
if (isError) {
|
|
209
|
+
const isNotFound = isNotFoundError(error);
|
|
210
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
211
|
+
isOpen,
|
|
212
|
+
header: "Run pipeline",
|
|
213
|
+
size: ModalSize.MEDIUM,
|
|
214
|
+
onOpenChange: (isOpen) => {
|
|
215
|
+
if (!isOpen) onClose();
|
|
216
|
+
},
|
|
217
|
+
children: /* @__PURE__ */ jsx(ErrorLayout, {
|
|
218
|
+
header: isNotFound ? "Pipeline not found" : "Failed to load pipeline",
|
|
219
|
+
description: isNotFound ? "This pipeline no longer exists." : "The pipeline could not be loaded. Try again later.",
|
|
220
|
+
detail: IS_DEBUG ? error?.message : void 0,
|
|
221
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
222
|
+
label: "Close",
|
|
223
|
+
onClick: onClose,
|
|
224
|
+
variant: ButtonVariant.SECONDARY
|
|
225
|
+
})
|
|
226
|
+
})
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
if (!data?.pipeline) return /* @__PURE__ */ jsx(Modal, {
|
|
230
|
+
isOpen,
|
|
231
|
+
header: "Run pipeline",
|
|
232
|
+
size: ModalSize.MEDIUM,
|
|
233
|
+
onOpenChange: (isOpen) => {
|
|
234
|
+
if (!isOpen) onClose();
|
|
235
|
+
},
|
|
236
|
+
children: /* @__PURE__ */ jsx(PendingLayout, {})
|
|
237
|
+
});
|
|
238
|
+
return /* @__PURE__ */ jsx(PipelineRunModalContent, {
|
|
239
|
+
isOpen,
|
|
240
|
+
pipeline: data.pipeline,
|
|
241
|
+
onClose
|
|
242
|
+
}, session);
|
|
243
|
+
};
|
|
244
|
+
//#endregion
|
|
245
|
+
export { PipelineRunModal as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface PipelineRunModalResourcesPaneProps {
|
|
3
|
+
resources: string[];
|
|
4
|
+
selectedResources: string[];
|
|
5
|
+
resyncResources: string[];
|
|
6
|
+
isDefault: boolean;
|
|
7
|
+
canSubset: boolean;
|
|
8
|
+
onSelectedChange: (selectedResources: string[]) => void;
|
|
9
|
+
onResyncChange: (resyncResources: string[]) => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const PipelineRunModalResourcesPane: FC<PipelineRunModalResourcesPaneProps>;
|
|
13
|
+
export default PipelineRunModalResourcesPane;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import BaseHeader, { BaseHeaderSize } from "../../../../components/BaseHeader.js";
|
|
2
|
+
import { PipelineRunResourceMode } from "./types.js";
|
|
3
|
+
import { PIPELINE_RUN_RESOURCE_MODE_OPTIONS } from "./constants.js";
|
|
4
|
+
import PipelineRunModalSectionChip from "./PipelineRunModalSectionChip.js";
|
|
5
|
+
import { setPipelineRunResourceMode } from "./utils.js";
|
|
6
|
+
import { FlowArrowIcon, MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
7
|
+
import { useMemo, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import Flex, { AlignItems, FlexDirection, JustifyContent } from "@galaxy-io/dls/layout/Flex";
|
|
10
|
+
import Box from "@galaxy-io/dls/layout/Box";
|
|
11
|
+
import Text, { TextSize } from "@galaxy-io/dls/text/Text";
|
|
12
|
+
import { FontFamily } from "@galaxy-io/dls/theme/enums";
|
|
13
|
+
import SearchInput from "@galaxy-io/dls/inputs/SearchInput";
|
|
14
|
+
import Divider from "@galaxy-io/dls/layout/Divider";
|
|
15
|
+
import { isSearchMatch } from "@galaxy-io/dls/utils/search";
|
|
16
|
+
import EmptyLayout, { EmptyLayoutSize } from "@galaxy-io/dls/layout/EmptyLayout";
|
|
17
|
+
import InfiniteTable, { InfiniteTableSize } from "@galaxy-io/dls/table/InfiniteTable";
|
|
18
|
+
import ToggleInput, { ToggleInputSize } from "@galaxy-io/dls/inputs/ToggleInput";
|
|
19
|
+
//#region src/pages/pipelines/components/run/PipelineRunModalResourcesPane.tsx
|
|
20
|
+
var PipelineRunModalResourcesPane = ({ resources, selectedResources, resyncResources, isDefault, canSubset, onSelectedChange, onResyncChange, onClose }) => {
|
|
21
|
+
const [search, setSearch] = useState("");
|
|
22
|
+
const visibleResources = useMemo(() => resources.filter((resource) => isSearchMatch(search, resource)), [resources, search]);
|
|
23
|
+
const handleSelectedChange = (next) => onSelectedChange(resources.filter((resource) => next.includes(resource) || !visibleResources.includes(resource) && selectedResources.includes(resource)));
|
|
24
|
+
const columns = useMemo(() => [{
|
|
25
|
+
id: "name",
|
|
26
|
+
header: "Resource",
|
|
27
|
+
isRowHeader: true,
|
|
28
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(Text, {
|
|
29
|
+
size: TextSize.BODY_SM,
|
|
30
|
+
family: FontFamily.MONO,
|
|
31
|
+
lineClamp: 1,
|
|
32
|
+
children: row
|
|
33
|
+
})
|
|
34
|
+
}, {
|
|
35
|
+
id: "mode",
|
|
36
|
+
header: "Mode",
|
|
37
|
+
width: 130,
|
|
38
|
+
align: "right",
|
|
39
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(Flex, {
|
|
40
|
+
justifyContent: JustifyContent.END,
|
|
41
|
+
fillWidth: true,
|
|
42
|
+
children: /* @__PURE__ */ jsx(ToggleInput, {
|
|
43
|
+
ariaLabel: `${row} mode`,
|
|
44
|
+
options: PIPELINE_RUN_RESOURCE_MODE_OPTIONS,
|
|
45
|
+
value: resyncResources.includes(row) ? PipelineRunResourceMode.RESYNC : PipelineRunResourceMode.CONTINUE,
|
|
46
|
+
onChange: (mode) => onResyncChange(setPipelineRunResourceMode(resources, resyncResources, [row], mode)),
|
|
47
|
+
size: ToggleInputSize.X_SMALL,
|
|
48
|
+
isDisabled: !selectedResources.includes(row)
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
}], [
|
|
52
|
+
resources,
|
|
53
|
+
selectedResources,
|
|
54
|
+
resyncResources,
|
|
55
|
+
onResyncChange
|
|
56
|
+
]);
|
|
57
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
58
|
+
width: 420,
|
|
59
|
+
height: "100%",
|
|
60
|
+
children: /* @__PURE__ */ jsxs(Flex, {
|
|
61
|
+
direction: FlexDirection.COLUMN,
|
|
62
|
+
height: "100%",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Flex, {
|
|
65
|
+
alignItems: AlignItems.CENTER,
|
|
66
|
+
padding: [
|
|
67
|
+
12,
|
|
68
|
+
12,
|
|
69
|
+
12,
|
|
70
|
+
16
|
|
71
|
+
],
|
|
72
|
+
shrink: 0,
|
|
73
|
+
children: /* @__PURE__ */ jsx(BaseHeader, {
|
|
74
|
+
title: "Resources",
|
|
75
|
+
icon: FlowArrowIcon,
|
|
76
|
+
size: BaseHeaderSize.MEDIUM,
|
|
77
|
+
actions: [/* @__PURE__ */ jsx(PipelineRunModalSectionChip, { isDefault }, "status")],
|
|
78
|
+
onClose
|
|
79
|
+
})
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
82
|
+
/* @__PURE__ */ jsx(Box, {
|
|
83
|
+
padding: 8,
|
|
84
|
+
children: /* @__PURE__ */ jsx(SearchInput, {
|
|
85
|
+
value: search,
|
|
86
|
+
onChange: setSearch,
|
|
87
|
+
placeholder: "Search resources...",
|
|
88
|
+
ariaLabel: "Search resources",
|
|
89
|
+
fillWidth: true
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
93
|
+
/* @__PURE__ */ jsx(Flex, {
|
|
94
|
+
direction: FlexDirection.COLUMN,
|
|
95
|
+
grow: 1,
|
|
96
|
+
basis: 0,
|
|
97
|
+
minHeight: 0,
|
|
98
|
+
children: /* @__PURE__ */ jsx(InfiniteTable, {
|
|
99
|
+
ariaLabel: "Resources",
|
|
100
|
+
columns,
|
|
101
|
+
data: visibleResources,
|
|
102
|
+
getRowId: (row) => row,
|
|
103
|
+
size: InfiniteTableSize.SMALL,
|
|
104
|
+
inset: 4,
|
|
105
|
+
value: canSubset ? selectedResources : void 0,
|
|
106
|
+
onChange: canSubset ? handleSelectedChange : void 0,
|
|
107
|
+
isSelectable: canSubset,
|
|
108
|
+
emptyState: /* @__PURE__ */ jsx(EmptyLayout, {
|
|
109
|
+
size: EmptyLayoutSize.SMALL,
|
|
110
|
+
icon: MagnifyingGlassIcon,
|
|
111
|
+
header: "No resources match your search"
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
//#endregion
|
|
120
|
+
export { PipelineRunModalResourcesPane as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Chip, { ChipSize, ChipVariant } from "@galaxy-io/dls/chips/Chip";
|
|
3
|
+
//#region src/pages/pipelines/components/run/PipelineRunModalSectionChip.tsx
|
|
4
|
+
var PipelineRunModalSectionChip = ({ isDefault }) => isDefault ? /* @__PURE__ */ jsx(Chip, {
|
|
5
|
+
label: "Default",
|
|
6
|
+
size: ChipSize.SMALL,
|
|
7
|
+
variant: ChipVariant.SECONDARY
|
|
8
|
+
}) : /* @__PURE__ */ jsx(Chip, {
|
|
9
|
+
label: "Custom",
|
|
10
|
+
size: ChipSize.SMALL,
|
|
11
|
+
variant: ChipVariant.WARNING
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { PipelineRunModalSectionChip as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PipelineRunResourceMode } from './types';
|
|
2
|
+
export declare const PIPELINE_RUN_MODAL_TITLE_ICON_SIZE = 15;
|
|
3
|
+
export declare const PIPELINE_RUN_MODAL_RESOURCES_CARET_SIZE = 12;
|
|
4
|
+
export declare const PIPELINE_RUN_MODAL_RESOURCES_PANE_WIDTH = 420;
|
|
5
|
+
export declare const PIPELINE_RUN_MODAL_RESOURCE_MODE_COLUMN_WIDTH = 130;
|
|
6
|
+
export declare const PIPELINE_RUN_RESOURCE_MODE_OPTIONS: {
|
|
7
|
+
id: PipelineRunResourceMode;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PipelineRunResourceMode } from "./types.js";
|
|
2
|
+
//#region src/pages/pipelines/components/run/constants.ts
|
|
3
|
+
var PIPELINE_RUN_RESOURCE_MODE_OPTIONS = [{
|
|
4
|
+
id: PipelineRunResourceMode.CONTINUE,
|
|
5
|
+
label: "Continue"
|
|
6
|
+
}, {
|
|
7
|
+
id: PipelineRunResourceMode.RESYNC,
|
|
8
|
+
label: "Resync"
|
|
9
|
+
}];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { PIPELINE_RUN_RESOURCE_MODE_OPTIONS };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/pages/pipelines/components/run/types.ts
|
|
2
|
+
var PipelineRunResourceMode = /* @__PURE__ */ function(PipelineRunResourceMode) {
|
|
3
|
+
PipelineRunResourceMode["CONTINUE"] = "CONTINUE";
|
|
4
|
+
PipelineRunResourceMode["RESYNC"] = "RESYNC";
|
|
5
|
+
return PipelineRunResourceMode;
|
|
6
|
+
}({});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { PipelineRunResourceMode };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Connection } from '../../../../gen/ingestion/v1/connections_pb';
|
|
2
|
+
import { Pipeline } from '../../../../gen/ingestion/v1/pipelines_pb';
|
|
3
|
+
import { PipelineRunResourceMode } from './types';
|
|
4
|
+
export declare const canPipelineRunSubset: (pipeline: Pipeline, source: Connection | undefined) => boolean;
|
|
5
|
+
export declare const setPipelineRunResourceMode: (resources: string[], resyncResources: string[], targets: string[], mode: PipelineRunResourceMode) => string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExecutionMode, ReplicationMode } from "../../../../gen/ingestion/v1/common_pb.js";
|
|
2
|
+
import { PipelineRunResourceMode } from "./types.js";
|
|
3
|
+
//#region src/pages/pipelines/components/run/utils.ts
|
|
4
|
+
var canPipelineRunSubset = (pipeline, source) => pipeline.executionMode !== ExecutionMode.CONTINUOUS && !!source && source.replication !== ReplicationMode.CDC;
|
|
5
|
+
var setPipelineRunResourceMode = (resources, resyncResources, targets, mode) => resources.filter((resource) => targets.includes(resource) ? mode === PipelineRunResourceMode.RESYNC : resyncResources.includes(resource));
|
|
6
|
+
//#endregion
|
|
7
|
+
export { canPipelineRunSubset, setPipelineRunResourceMode };
|
|
@@ -5,12 +5,12 @@ import { getErrorMessage } from "../../../../utils/errors.js";
|
|
|
5
5
|
import { formatRunDuration } from "../../../../utils/runs.js";
|
|
6
6
|
import PipelineName from "../../../../components/pipelines/PipelineName.js";
|
|
7
7
|
import PipelineScheduleIndicator from "../../../../components/pipelines/PipelineScheduleIndicator.js";
|
|
8
|
+
import { usePipelineRun } from "../../hooks/usePipelineRun.js";
|
|
8
9
|
import PipelineRunStatus from "../../../../components/runs/PipelineRunStatus.js";
|
|
9
10
|
import { PIPELINES_TABLE_COLUMN_ID_PIPELINE, PIPELINES_TABLE_COLUMN_LAYOUT_STORAGE_KEY } from "./constants.js";
|
|
10
11
|
import PipelinesTableColumnFlow from "./columns/PipelinesTableColumnFlow.js";
|
|
11
12
|
import PipelinesTableColumnRecentRuns from "./columns/PipelinesTableColumnRecentRuns.js";
|
|
12
13
|
import PipelinesTableRowActions from "./PipelinesTableRowActions.js";
|
|
13
|
-
import { usePipelineRun } from "../../hooks/usePipelineRun.js";
|
|
14
14
|
import { useUpdatePipelineScheduleMutation } from "../../../../api/queries/schedules.js";
|
|
15
15
|
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
16
16
|
import { create } from "@bufbuild/protobuf";
|