Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make node label and properties editable in inspector panel #15

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
** xref:operations/rest-requests.adoc[]
** xref:operations/browser-rbac-count.adoc[]
** xref:operations/product-analytics.adoc[]
** xref:operations/on-canvas-operations.adoc[]

* xref:reference-commands.adoc[Command reference]

Expand Down
Binary file added docs/modules/ROOT/images/enable-apoc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/operations/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* xref:operations/rest-requests.adoc[] -- HTTP REST commands.
* xref:operations/browser-rbac-count.adoc[] -- Manual refresh of counts due to RBAC.
* xref:operations/product-analytics.adoc[] -- Configure consent for anonymous usage statistics.

* xref:operations/on-canvas-operations.adoc[] -- On-Canvas Operations.
31 changes: 31 additions & 0 deletions docs/modules/ROOT/pages/operations/on-canvas-operations.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
:description: On-Canvas Operations


[[on-canvas-operations]]
= On-Canvas Operations

== Double-Clicking the Canvas

*Double clicking the white area* on canvas will automatically generate a new node with

1. an auto-incremented ID, i.e. (the max ID of nodes on canvas) + 1
2. a label of "Undefined"
3. the node caption of "New Node"

== Editing the Node Label and Properties in Inspector Panel

[NOTE]
====
Make sure APOC plugin is enabled in Neo4J database:

image:enable-apoc.png[width=600]
====

*Clicking the property value* in node inspector panel will make that property editable and un-clicking the text box
(by for example clicking somewhere else) will persist the new value into Neo4J database:

image:modifying-node-properties-example.png[width=600]

Similary, we can modify node label:

image:modifying-node-label-example.png[width=600]
23 changes: 23 additions & 0 deletions e2e_tests/integration/viz.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { should } from 'chai'

/* global Cypress, cy, before */

const GREY = 'rgb(165, 171, 182)' // Default color for nodes and relationships
Expand Down Expand Up @@ -259,4 +261,25 @@ describe('Viz rendering', () => {

cy.executeCommand('MATCH (n) DETACH DELETE n')
})

it('new node by double-clicking the canvas has "description" and "name" property fields', () => {
cy.executeCommand(':clear')
cy.executeCommand(`CREATE (a:TestLabel {name: 'testNode'}) RETURN a`, {
parseSpecialCharSequences: false
})

cy.get('[data-testid="graphCanvas"]')
.trigger('click', 200, 200, { force: true })
.trigger('dblclick', 200, 200, { force: true })

cy.get('[data-testid="nodeGroups"]', { timeout: 5000 })
.contains('New Node')
.trigger('mouseover', { force: true })
.trigger('mouseenter', { force: true })
.get('[data-testid="viz-details-pane-properties-table"]')
.find('td:nth-child(1)')
.should('have.text', '<id>descriptionname')

cy.executeCommand('MATCH (n) DETACH DELETE n')
})
})
Loading