Skip to content

Commit 6a617e3

Browse files
committed
Release 1.0.4
1 parent 1e67359 commit 6a617e3

File tree

3 files changed

+59
-35
lines changed

3 files changed

+59
-35
lines changed

desktop-signer.sh

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,35 @@ cd $PWD
55

66
npm run-script build
77
npm pack
8-
rm -rf ../target
9-
mkdir ../target
10-
mv *.tgz ../target/
11-
cd ../target
12-
tar -xvf ${APPNAME}*.tgz
13-
rm -f ${APPNAME}*.tgz
14-
cp -r package/build package/dist
8+
rm -rf target
9+
mkdir target
10+
mv *.tgz target/
11+
cd target/
12+
tar -xvf *.tgz
13+
rm -f *.tgz
14+
# cp -r package/build package/dist
1515
cp package/dist/favicon.ico package/favicon.ico
16+
17+
# Remove certificates and keys
18+
rm package/*.cert
19+
rm package/*.pem
20+
1621
GRAPH_APP_PASSPHRASE=$( cat ../desktop.passphrase )
1722

1823
# sign the code & verify
19-
npx @neo4j/code-signer --app ./package --private-key ../neo4j-labs-app.pem --cert ../neo4j-labs-app.cert --passphrase $GRAPH_APP_PASSPHRASE
24+
npx @neo4j/code-signer --app ./package --private-key ../neo4j-labs-app.pem --cert ../neo4j-labs-app.cert --passphrase $GRAPH_APP_PASSPHRASE
2025
npx @neo4j/code-signer --verify --app ./package --root-cert ../neo4j_desktop.cert
2126

2227
# pack it back up again
2328
cd package
2429
npm pack
25-
mv ${APPNAME}*.tgz ../
30+
mv *.tgz ../
2631

2732
# remove the package folder
28-
cd ../
2933
rm -rf package
30-
34+
cd ..
3135
# verify it again
32-
tar xvf ${APPNAME}*.tgz package
36+
tar xvf *.tgz package
3337

3438
npx @neo4j/code-signer --verify \
3539
--app ./package \
@@ -38,4 +42,4 @@ npx @neo4j/code-signer --verify \
3842
rm -rf package
3943

4044
# Publish to npm
41-
npm publish --access public ${APPNAME}*.tgz
45+
npm publish --access public neodash*.tgz

src/NeoDash.js

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,27 @@ class NeoDash extends React.Component {
2525

2626
// Neo4j Desktop integration
2727
let neo4jDesktopApi = window.neo4jDesktopApi;
28-
if (neo4jDesktopApi){
28+
if (neo4jDesktopApi) {
2929
let promise = neo4jDesktopApi.getContext();
3030
let a = this;
3131
promise.then(function (context) {
32+
3233
let desktopIntegration = new Neo4jDesktopIntegration(context);
3334
let neo4j = desktopIntegration.getActiveDatabase();
3435
if (neo4j) {
3536

3637
a.connection = {
3738
url: neo4j.connection.configuration.protocols.bolt.url,
38-
database:"",
39+
database: "",
3940
username: neo4j.connection.configuration.protocols.bolt.username,
4041
password: neo4j.connection.configuration.protocols.bolt.password,
4142
encryption: neo4j.connection.configuration.protocols.bolt.tlsLevel === "REQUIRED"
4243
}
4344
a.connect()
4445

45-
}else{
46-
a.connect()
46+
} else {
4747
a.updateConnectionModal(a.connect, true);
48+
a.stateChanged({label:"HideError"})
4849
}
4950
});
5051

@@ -67,13 +68,16 @@ class NeoDash extends React.Component {
6768
this.stateChanged = this.stateChanged.bind(this);
6869
this.loadJson = this.loadJson.bind(this);
6970
this.connect = this.connect.bind(this);
70-
if(neo4jDesktopApi){
71-
// this.updateConnectionModal(this.connect, true);
72-
this.stateChanged({label: "CreateError", value: "Connecting to " + this.connection.url + "..."})
73-
// this.errorModal = null;
74-
}else{
71+
72+
// If not running from desktop, always ask for connection details
73+
if (!neo4jDesktopApi) {
7574
this.updateConnectionModal(this.connect, true);
75+
}else{
76+
// If running from desktop, the constructor will set up a connection using the promise.
77+
this.stateChanged({label: "CreateError", value: "Trying to connect to your active database..."});
7678
}
79+
80+
7781
}
7882

7983
componentDidMount() {
@@ -210,24 +214,33 @@ class NeoDash extends React.Component {
210214
if (update.label === "PasswordChanged") {
211215
this.connection.password = update.value;
212216
}
217+
if (update.label === "HideError"){
218+
this.errorModal = null;
219+
this.state.count += 1;
220+
}
213221
if (update.label === "CreateError") {
214222
let content = update.value;
223+
215224
if (content.startsWith("Could not perform discovery. No routing servers available.")) {
216225
let encryption = this.connection.encryption;
217226
content = "Unable to connect to the specified Neo4j database. " +
218227
"The database might be unreachable, or it does not accept " + ((encryption === "on") ? "encrypted" : "unencrypted") + " connections. " + content;
219228

220229
}
221-
let header = (content.startsWith("Connecting to")) ? "Connecting..." : "Error";
230+
let header = (content.startsWith("Trying to connect")) ? "Connecting..." : "Error";
231+
if (content === "If you have questions about NeoDash, or want to build a production grade Neo4j front-end: reach out to Niels at [email protected]."){
232+
header = "Contact"
233+
}
234+
222235
this.errorModal = <NeoModal header={header}
223-
style={{'maxWidth': '550px'}}
224-
open={true}
225-
trigger={null}
226-
content={<p>{content}</p>}
227-
key={this.state.count}
228-
id={this.state.count}
229-
root={document.getElementById("root")}
230-
actions={[
236+
style={{'maxWidth': '550px'}}
237+
open={true}
238+
trigger={null}
239+
content={<p>{content}</p>}
240+
key={this.state.count}
241+
id={this.state.count}
242+
root={document.getElementById("root")}
243+
actions={[
231244
<Button flat modal="close"
232245
node="button"
233246
waves="red">Close</Button>
@@ -331,6 +344,12 @@ class NeoDash extends React.Component {
331344

332345
}
333346

347+
handleGetInTouchClick(neodash) {
348+
let contactMessage = "If you have questions about NeoDash, or want to build a production grade Neo4j front-end: reach out to Niels at [email protected].";
349+
neodash.stateChanged({label: "CreateError", value: contactMessage})
350+
}
351+
352+
334353
generateSaveLoadModal(loadJson) {
335354
let trigger = <NavItem href="" onClick={e => this.stateChanged({})}>Load/Export</NavItem>;
336355

@@ -368,6 +387,7 @@ class NeoDash extends React.Component {
368387
/>;
369388
}
370389

390+
371391
updateConnectionModal(connect, open) {
372392
this.neoConnectionModal =
373393
<NeoModal
@@ -382,9 +402,9 @@ class NeoDash extends React.Component {
382402
actions={[
383403
<p>
384404
NeoDash is a tool for prototyping Neo4j dashboards.
385-
Building a production-grade front-end instead? <u><a style={{color: "white"}}
386-
href={"mailto:[email protected]"}
387-
target={"_blank"}>Get in touch</a></u>!
405+
Building a production-grade front-end instead? &nbsp;
406+
<u><a style={{color: "white"}} href="#"
407+
onClick={e => this.handleGetInTouchClick(this)}>Get in touch</a></u>!
388408
</p>
389409

390410
]}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import appLogo from './logo.png'
77
const root = document.getElementById("root");
88
const url = "https://github.com/nielsdejong/neodash/";
99
const link = <u><a href={"https://github.com/nielsdejong/neodash/blob/master/README.md"} style={{color: "dimgrey"}}
10-
target={"_blank"}>NeoDash 1.0.3 - Neo4j Dashboard Builder</a></u>
10+
target={"_blank"}>NeoDash 1.0.4 - Neo4j Dashboard Builder</a></u>
1111
const copyrights = <div style={{textAlign: 'center', color: 'dimgrey'}}>{link}</div>;
1212
const footer = <Footer style={{backgroundColor: '#ddd'}} moreLinks={copyrights}></Footer>
1313
const logo = () => {

0 commit comments

Comments
 (0)