Skip to content

Commit 611bf40

Browse files
author
Zabilsya
committed
[DOP-22352] add SourceParamsNode and TargetParamsNode
1 parent 2b87ad8 commit 611bf40

File tree

10 files changed

+46
-4
lines changed

10 files changed

+46
-4
lines changed

src/features/transfer/MutateTransferForm/components/SourceParams/SourceParams.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export const SourceParams = ({ groupId, initialSourceConnectionType }: SourcePar
1919
<Divider>Source params</Divider>
2020
<Form.Item label="Source connection" name="source_connection_id" rules={[{ required: true }]}>
2121
<ManagedSelect
22+
/** className "nodrag" for opening dropdown in select in custom node React Flow https://github.com/xyflow/xyflow/discussions/2694 */
23+
className="nodrag"
2224
size="large"
2325
queryKey={[ConnectionQueryKey.GET_CONNECTIONS, groupId]}
2426
queryFunction={(params) => connectionService.getConnections({ group_id: groupId, ...params })}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ConnectionType } from '@shared/types';
22

3-
export interface SourceParamsProps {
3+
export type SourceParamsProps = {
44
groupId: number;
55
initialSourceConnectionType?: ConnectionType;
6-
}
6+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
3+
import { SourceParams } from '../SourceParams';
4+
5+
import { SourceParamsNodeProps } from './types';
6+
7+
export const SourceParamsNode = ({ data }: SourceParamsNodeProps) => {
8+
return <SourceParams groupId={data.groupId} initialSourceConnectionType={data.initialSourceConnectionType} />;
9+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './SourceParamsNode';
2+
export * from './types';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Node, NodeProps } from '@xyflow/react';
2+
3+
import { SourceParamsProps } from '../SourceParams';
4+
5+
//TODO: [DOP-22354] change 'sourceParams' to NodeType.SOURCE
6+
export interface SourceParamsNodeData extends Node<SourceParamsProps, 'sourceParams'> {}
7+
8+
export interface SourceParamsNodeProps extends NodeProps<SourceParamsNodeData> {}

src/features/transfer/MutateTransferForm/components/TargetParams/TargetParams.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export const TargetParams = ({ groupId, initialTargetConnectionType }: TargetPar
1919
<Divider>Target params</Divider>
2020
<Form.Item label="Target connection" name="target_connection_id" rules={[{ required: true }]}>
2121
<ManagedSelect
22+
/** className "nodrag" for opening dropdown in select in custom node React Flow https://github.com/xyflow/xyflow/discussions/2694 */
23+
className="nodrag"
2224
size="large"
2325
queryKey={[ConnectionQueryKey.GET_CONNECTIONS, groupId]}
2426
queryFunction={(params) => connectionService.getConnections({ group_id: groupId, ...params })}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ConnectionType } from '@shared/types';
22

3-
export interface TargetParamsProps {
3+
export type TargetParamsProps = {
44
groupId: number;
55
initialTargetConnectionType?: ConnectionType;
6-
}
6+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
3+
import { TargetParams } from '../TargetParams';
4+
5+
import { TargetParamsNodeProps } from './types';
6+
7+
export const TargetParamsNode = ({ data }: TargetParamsNodeProps) => {
8+
return <TargetParams groupId={data.groupId} initialTargetConnectionType={data.initialTargetConnectionType} />;
9+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './TargetParamsNode';
2+
export * from './types';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Node, NodeProps } from '@xyflow/react';
2+
3+
import { TargetParamsProps } from '../TargetParams';
4+
5+
//TODO: [DOP-22354] change 'targetParams' to NodeType.TARGET
6+
export interface TargetParamsNodeData extends Node<TargetParamsProps, 'targetParams'> {}
7+
8+
export interface TargetParamsNodeProps extends NodeProps<TargetParamsNodeData> {}

0 commit comments

Comments
 (0)