Skip to content

Commit 5466669

Browse files
committed
Modifications for running NeoDash as a Neo4j Graph App
1 parent e361245 commit 5466669

File tree

11 files changed

+77
-20
lines changed

11 files changed

+77
-20
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
.idea
22
*.iml
3+
*.pem
4+
*.cert
5+
*.passphrase
36
node_modules
47
package-lock.json
58
build
6-
9+
target
710
/node_modules
811
/.pnp
912
.pnp.js

desktop-signer.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
APPNAME=NeoDash
2+
3+
npm run-script build
4+
npm pack
5+
rm -rf ../target
6+
mkdir ../target
7+
mv *.tgz ../target/
8+
cd ../target
9+
tar -xvf ${APPNAME}*.tgz
10+
rm -f ${APPNAME}*.tgz
11+
cp -r package/build package/dist
12+
cp package/dist/favicon.ico package/favicon.ico
13+
GRAPH_APP_PASSPHRASE=$( cat ../desktop.passphrase )
14+
15+
# sign the code & verify
16+
#npx @neo4j/code-signer --app ./package --private-key ../neo4j-labs-app.pem --cert ../neo4j-labs-app.cert --passphrase $GRAPH_APP_PASSPHRASE
17+
#npx @neo4j/code-signer --verify --app ./package --root-cert ../neo4j_desktop.cert
18+
19+
# pack it back up again
20+
cd package
21+
npm pack
22+
mv ${APPNAME}*.tgz ../
23+
24+
# file:///home/niels/IdeaProjects/grandstack-for-dummies-2/target/NeoDash-1.0.2.tgz

ui/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
PUBLIC_URL=https://nielsdejong.nl/neodash
1+
PUBLIC_URL=./

ui/.env.hosted

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PUBLIC_URL=https://nielsdejong.nl/neodash

ui/.env.local

Lines changed: 0 additions & 1 deletion
This file was deleted.

ui/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "neodash",
2+
"name": "NeoDash",
33
"description": "NeoDash - Neo4j Dashboard Builder",
44
"version": "1.0.2",
5-
"homepage":"https://nielsdejong.nl/neodash",
5+
"homepage": "https://nielsdejong.nl/neodash",
66
"neo4jDesktop": {
77
"apiVersion": "^1.2.0"
88
},
@@ -11,21 +11,24 @@
1111
{
1212
"src": "favicon.ico",
1313
"type": "ico"
14+
},
15+
{
16+
"src": "favicon.png",
17+
"type": "png"
1418
}
1519
],
1620
"repository": {
1721
"type": "git",
1822
"url": "https://github.com/nielsdejong/neodash/"
1923
},
20-
2124
"private": false,
2225
"dependencies": {
2326
"@apollo/react-hooks": "^3.1.2",
2427
"@testing-library/jest-dom": "^4.2.4",
2528
"@testing-library/react": "^9.5.0",
2629
"@testing-library/user-event": "^7.2.1",
2730
"apollo-boost": "^0.4.4",
28-
"axios": "^0.16.2",
31+
"axios": "^0.18.1",
2932
"d3": "4.5.0",
3033
"graphql": "^14.5.8",
3134
"graphql-tag": "^2.10.1",

ui/public/favicon.png

9.09 KB
Loading

ui/public/manifest.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
"short_name": "NeoDash",
33
"name": "NeoDash - Neo4j Dashboard Builder",
44
"homepage": "https://github.com/nielsdejong/neodash/",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"neo4jDesktop": {
77
"apiVersion": "^1.2.0"
88
},
99
"icons": [
1010
{
1111
"src": "favicon.ico",
1212
"type": "ico"
13+
},
14+
{
15+
"src": "favicon.png",
16+
"type": "png"
1317
}
1418
],
1519
"start_url": "./index.html",

ui/src/NeoDash.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import neo4j from "neo4j-driver";
1515
import {Checkbox} from "react-materialize";
1616
import NeoCheckBox from "./component/NeoCheckBox";
1717
import NeoTextButton from "./component/NeoTextButton";
18-
18+
import defaultDashboard from './default_dashboard.json';
1919

2020
class NeoDash extends React.Component {
2121
version = '1.0';
@@ -149,18 +149,11 @@ class NeoDash extends React.Component {
149149
}
150150
}
151151

152+
152153
setDefaultDashboard() {
153154
let state = this.state;
154-
fetch("/default_dashboard.json")
155-
.then(response => response.text())
156-
.then((jsonData) => {
157-
state.json = jsonData;
158-
this.loadJson()
159-
160-
}).catch((error) => {
161-
// handle your errors here
162-
alert(error)
163-
})
155+
this.state.json = JSON.stringify(defaultDashboard);
156+
this.loadJson()
164157
}
165158

166159
stateChanged(update) {

ui/src/default_dashboard.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"title": "NeoDash ⚡",
3+
"version": "1.0",
4+
"editable": true,
5+
"reports": [
6+
{
7+
"title": "Hi there \uD83D\uDC4B",
8+
"width": 4,
9+
"height": 4,
10+
"type": "text",
11+
"query": "This is your first dashboard! \n \nYou can click (⋮) to edit this report, or add a new report to get started. You can run any Cypher query directly from each report and render data in a variety of formats. \n \nTip: try renaming this report by editing the title text. You can also edit the dashboard header at the top of the screen.",
12+
"page": 1,
13+
"properties": [],
14+
"parameters": "",
15+
"refresh": 0
16+
},
17+
{
18+
"title": "Example Query",
19+
"width": 4,
20+
"height": 4,
21+
"type": "graph",
22+
"query": "CALL db.schema.visualization()",
23+
"page": 2,
24+
"properties": [],
25+
"parameters": "",
26+
"refresh": 0
27+
},
28+
{}
29+
]
30+
}

0 commit comments

Comments
 (0)