From 48a2a9a135450c6cfcc48eb2588f5cfe0f13d58a Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 7 Dec 2023 20:40:54 +0800 Subject: [PATCH] Unify node and rel prop editing (#46) * Unify node and rel prop editing * Unify node and rel prop editing --- .../PropertiesPanelContent/DetailsPane.tsx | 1 + .../VisualizationView/VisualizationView.tsx | 26 ++++++++++++++----- .../PropertiesTable/PropertiesTable.test.tsx | 1 + .../PropertiesTable/PropertiesTable.tsx | 21 ++++++++++----- .../DefaultDetailsPane.tsx | 1 + .../Graph/GraphEventHandlerModel.ts | 4 +-- src/neo4j-arc/graph-visualization/index.ts | 2 +- src/neo4j-arc/package.json | 2 +- 8 files changed, 42 insertions(+), 16 deletions(-) diff --git a/src/browser/modules/Stream/CypherFrame/VisualizationView/PropertiesPanelContent/DetailsPane.tsx b/src/browser/modules/Stream/CypherFrame/VisualizationView/PropertiesPanelContent/DetailsPane.tsx index c21a7df8583..95bd59b8d53 100644 --- a/src/browser/modules/Stream/CypherFrame/VisualizationView/PropertiesPanelContent/DetailsPane.tsx +++ b/src/browser/modules/Stream/CypherFrame/VisualizationView/PropertiesPanelContent/DetailsPane.tsx @@ -131,6 +131,7 @@ export function DetailsPane({ { @@ -372,6 +382,10 @@ LIMIT ${maxNewNeighbours}` } } ) + + const cmd = 'MATCH (n) RETURN n;' + const action = executeCommand(cmd, { source: commandSources.rerunFrame }) + this.props.bus.send(action.type, action) } if (event == REL_ON_CANVAS_CREATE) { diff --git a/src/neo4j-arc/common/components/PropertiesTable/PropertiesTable.test.tsx b/src/neo4j-arc/common/components/PropertiesTable/PropertiesTable.test.tsx index aae94f6fdd0..c5b76860e8b 100644 --- a/src/neo4j-arc/common/components/PropertiesTable/PropertiesTable.test.tsx +++ b/src/neo4j-arc/common/components/PropertiesTable/PropertiesTable.test.tsx @@ -72,6 +72,7 @@ describe('', () => { } return render( { if (event.keyCode === 13) { event.preventDefault() - onGraphInteraction(NODE_PROP_UPDATE, { - nodeId: nodeId, + onGraphInteraction(PROP_UPDATE, { + isNode: isNode, + nodeOrRelId: nodeOrRelId, propKey: propKey, propVal: event.currentTarget.textContent }) @@ -97,6 +102,7 @@ function ExpandableValue({ } type PropertiesViewProps = { + isNode: boolean visibleProperties: VizItemProperty[] onMoreClick: (numMore: number) => void totalNumItems: number @@ -104,7 +110,9 @@ type PropertiesViewProps = { nodeInspectorWidth: number onGraphInteraction?: GraphInteractionCallBack } + export const PropertiesTable = ({ + isNode, visibleProperties, totalNumItems, onMoreClick, @@ -131,7 +139,8 @@ export const PropertiesTable = ({