Skip to content

Commit 5f3bc05

Browse files
committed
Highlighting column while creating edge
1 parent 8511f6e commit 5f3bc05

File tree

5 files changed

+33
-1
lines changed

5 files changed

+33
-1
lines changed

openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/NodeChildren/NodeChildren.component.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ const NodeChildren = ({
137137
expandAllColumns,
138138
selectedColumn,
139139
useUpdateNodeInternals,
140+
isCreatingEdge,
140141
} = useLineageProvider();
141142
const updateNodeInternals = useUpdateNodeInternals();
142143
const { entityType } = node;
@@ -418,7 +419,8 @@ const NodeChildren = ({
418419
<div
419420
className={classNames(
420421
'column-container',
421-
selectedColumn && 'any-column-selected'
422+
selectedColumn && 'any-column-selected',
423+
isCreatingEdge && 'creating-edge'
422424
)}
423425
data-testid="column-container">
424426
<div className="search-box">

openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/custom-node.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,12 @@
381381
border-color: #5925dc;
382382
}
383383
}
384+
&.creating-edge {
385+
.custom-node-column-container:not(.custom-node-header-column-tracing):hover {
386+
background-color: @primary-1;
387+
border-color: #1570ef;
388+
}
389+
}
384390
}
385391
}
386392
}

openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.component.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ const Lineage = ({
5858
onEdgesChange,
5959
onPaneClick,
6060
onConnect,
61+
onConnectStart,
62+
onConnectEnd,
6163
onInitReactFlow,
6264
updateEntityData,
6365
} = useLineageProvider();
@@ -150,6 +152,8 @@ const Lineage = ({
150152
nodesConnectable={isEditMode}
151153
selectNodesOnDrag={false}
152154
onConnect={onConnect}
155+
onConnectEnd={onConnectEnd}
156+
onConnectStart={onConnectStart}
153157
onDragOver={onDragOver}
154158
onDrop={handleNodeDrop}
155159
onEdgeClick={handleEdgeClick}

openmetadata-ui/src/main/resources/ui/src/context/LineageProvider/LineageProvider.interface.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
Node,
2020
NodeChange,
2121
NodeProps,
22+
OnConnectEnd,
23+
OnConnectStart,
2224
ReactFlowInstance,
2325
UpdateNodeInternals,
2426
} from 'reactflow';
@@ -66,6 +68,7 @@ export interface LineageContextType {
6668
expandAllColumns: boolean;
6769
isPlatformLineage: boolean;
6870
entityFqn: string;
71+
isCreatingEdge: boolean;
6972
exportLineageData: (_: string) => Promise<CSVExportResponse>;
7073
onCloseDrawer: () => void;
7174
toggleColumnView: () => void;
@@ -105,6 +108,8 @@ export interface LineageContextType {
105108
onColumnEdgeRemove: () => void;
106109
onAddPipelineClick: () => void;
107110
onConnect: (connection: Edge | Connection) => void;
111+
onConnectStart: OnConnectStart;
112+
onConnectEnd: OnConnectEnd;
108113
updateEntityData: (
109114
entityType: EntityType,
110115
entity?: SourceType,

openmetadata-ui/src/main/resources/ui/src/context/LineageProvider/LineageProvider.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ const LineageProvider = ({ children }: LineageProviderProps) => {
230230
const { showModal } = useEntityExportModalProvider();
231231
const [isPlatformLineage, setIsPlatformLineage] = useState(false);
232232
const [dqHighlightedEdges, setDqHighlightedEdges] = useState<Set<string>>();
233+
const [isCreatingEdge, setIsCreatingEdge] = useState<boolean>(false);
233234

234235
// Add state for entityFqn that can be updated independently of URL params
235236
const [entityFqn, setEntityFqn] = useState<string>(decodedFqn);
@@ -1289,6 +1290,14 @@ const LineageProvider = ({ children }: LineageProviderProps) => {
12891290
[entityLineage, nodes, entityFqn]
12901291
);
12911292

1293+
const onConnectStart = useCallback(() => {
1294+
setIsCreatingEdge(true);
1295+
}, []);
1296+
1297+
const onConnectEnd = useCallback(() => {
1298+
setIsCreatingEdge(false);
1299+
}, []);
1300+
12921301
const onAddPipelineClick = useCallback(() => {
12931302
setShowAddEdgeModal(true);
12941303
}, []);
@@ -1755,13 +1764,16 @@ const LineageProvider = ({ children }: LineageProviderProps) => {
17551764
platformView,
17561765
isPlatformLineage,
17571766
entityFqn,
1767+
isCreatingEdge,
17581768
exportLineageData,
17591769
onCloseDrawer,
17601770
updateEntityFqn,
17611771
toggleColumnView,
17621772
onInitReactFlow,
17631773
onPaneClick,
17641774
onConnect,
1775+
onConnectStart,
1776+
onConnectEnd,
17651777
onNodeDrop,
17661778
onNodeCollapse,
17671779
onColumnClick,
@@ -1814,13 +1826,16 @@ const LineageProvider = ({ children }: LineageProviderProps) => {
18141826
expandAllColumns,
18151827
isPlatformLineage,
18161828
entityFqn,
1829+
isCreatingEdge,
18171830
exportLineageData,
18181831
onCloseDrawer,
18191832
updateEntityFqn,
18201833
toggleColumnView,
18211834
onInitReactFlow,
18221835
onPaneClick,
18231836
onConnect,
1837+
onConnectStart,
1838+
onConnectEnd,
18241839
onNodeDrop,
18251840
onNodeCollapse,
18261841
onColumnClick,

0 commit comments

Comments
 (0)