diff --git a/docs/modules/ROOT/pages/operations/on-canvas-operations.adoc b/docs/modules/ROOT/pages/operations/on-canvas-operations.adoc index dc4025b883d..babbbd913fb 100644 --- a/docs/modules/ROOT/pages/operations/on-canvas-operations.adoc +++ b/docs/modules/ROOT/pages/operations/on-canvas-operations.adoc @@ -32,4 +32,12 @@ image:modifying-node-label-example.png[width=600] == Creating On-Canvas Relationships Alt-clicking one node, release the alk key, and alt-clicking another node will create a relationship between the two - \ No newline at end of file + +== Editing the Relationshiop Type and Properties in Node Inspection Panel + +[NOTE] +==== +Make sure APOC plugin is enabled in Neo4J database: + +image:enable-apoc.png[width=600] +==== \ No newline at end of file diff --git a/e2e_tests/integration/node-inspection-panel.spec.ts b/e2e_tests/integration/node-inspection-panel.spec.ts index b8e4186f3b7..843cd19dc19 100644 --- a/e2e_tests/integration/node-inspection-panel.spec.ts +++ b/e2e_tests/integration/node-inspection-panel.spec.ts @@ -43,7 +43,7 @@ describe('Node Inspection Panel rendering', () => { .contains('My Node') }) - it('details pane title should be editable', () => { + it('details pane title should be editable and pressing enter does not insert a line break at the end of new title', () => { cy.executeCommand(':clear') cy.executeCommand(`CREATE (s:SourceNode {name: 'My Node'}) RETURN s`, { parseSpecialCharSequences: false @@ -65,5 +65,74 @@ describe('Node Inspection Panel rendering', () => { .trigger('mouseenter', { force: true }) .get('[data-testid="viz-details-pane-title"]') .contains('New Title') + .should(title => { + expect(title.text()).to.equal('New Title') + }) + }) + + it('can directly modify node label in node inspector panel and pressing enter does not insert a line break at the end of new label', () => { + cy.executeCommand(':clear') + cy.executeCommand(`CREATE (a:TestLabel {name: 'testNode'}) RETURN a`, { + parseSpecialCharSequences: false + }) + + cy.get(`[aria-label^="graph-node"]`) + .first() + .trigger('mouseover', { force: true }) + .trigger('mouseenter', { force: true }) + .trigger('click', { force: true }) + .get('[data-testid="styleable-node-label"]', { timeout: 5000 }) + .clear() + .type('New Label{enter}', { force: true }) + .wait(1500) + .get('[data-testid="styleable-node-label"]', { timeout: 5000 }) + .contains('New Label') + .should(label => { + expect(label.text()).to.equal('New Label') + }) + }) + + it('can directly modify relationship type in node inspector panel', () => { + cy.executeCommand(':clear') + cy.executeCommand( + 'CREATE (a:TestLabel)-[:CONNECTS]->(b:TestLabel) RETURN a, b' + ) + .wait(3000) + .get('.relationship', { timeout: 5000 }) + .click(5, 40) + // .trigger('click', { force: true }) clicking on the rel center this way won't work + .get('[data-testid="styleable-rel-type"]', { timeout: 5000 }) + .first() + .clear() + .type('New Link Label{enter}', { force: true }) + .wait(1500) + .get('[data-testid="styleable-rel-type"]', { timeout: 5000 }) + .contains('New Link Label') + }) + + it('can directly modify properties table value and pressing enter does not insert a line break at the end of new value', () => { + cy.executeCommand(':clear') + cy.executeCommand(`CREATE (a:TestLabel {name: 'testNode'}) RETURN a`, { + parseSpecialCharSequences: false + }) + .wait(3000) + .get(`[aria-label^="graph-node"]`) + .first() + .trigger('mouseover', { force: true }) + .trigger('mouseenter', { force: true }) + .trigger('click', { force: true }) + .get('[data-testid="properties-table-name-value-cell"]', { + timeout: 5000 + }) + .clear() + .type('New Name{enter}', { force: true }) + .wait(1500) + .get('[data-testid="properties-table-name-value-cell"]', { + timeout: 5000 + }) + .contains('New Name') + .should(cellValue => { + expect(cellValue.text()).to.equal('New Name') + }) }) }) diff --git a/src/browser/modules/Stream/CypherFrame/VisualizationView/PropertiesPanelContent/StyleableNodeLabel.tsx b/src/browser/modules/Stream/CypherFrame/VisualizationView/PropertiesPanelContent/StyleableNodeLabel.tsx index 8b753785672..f066fc7d21a 100644 --- a/src/browser/modules/Stream/CypherFrame/VisualizationView/PropertiesPanelContent/StyleableNodeLabel.tsx +++ b/src/browser/modules/Stream/CypherFrame/VisualizationView/PropertiesPanelContent/StyleableNodeLabel.tsx @@ -57,6 +57,7 @@ export function StyleableNodeLabel({ return (