Skip to content

Commit b642053

Browse files
authored
Merge pull request #26 from nielsdejong/develop
Release 1.1.1
2 parents 84c4520 + 0ce0f01 commit b642053

File tree

8 files changed

+365
-36
lines changed

8 files changed

+365
-36
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "neodash",
33
"description": "NeoDash - Neo4j Dashboard Builder",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"homepage": "./",
66
"neo4jDesktop": {
77
"apiVersion": "^1.2.0"
@@ -38,6 +38,7 @@
3838
"graphql": "^14.5.8",
3939
"graphql-tag": "^2.10.1",
4040
"jquery": "^3.5.1",
41+
"jsoncrush": "latest",
4142
"leaflet": "latest",
4243
"materialize-css": "^1.0.0",
4344
"neo4j-driver": "latest",

release-notes.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
### NeoDash 1.1 - Multi-page & interactive Neo4j dashboard builder
2-
- Added multi-page dashboards with new dashboard file format.
3-
- Added geographical (Map) visualizations.
4-
- Added better markdown support for code fragments and lists.
5-
- Added the option to embed webpages into reports using iFrames.
6-
- Resolved bug where node labels clip out of graph visualization reports.
7-
- Improved/added documentation (hints) as part of the dashboard builder.
8-
- Improved performance of the 'Property selection' reports.
9-
- A ton of stability improvements and misc bug fixes!
10-
1+
### NeoDash 1.1.1 - Neo4j Dashboard Builder
2+
- Added dashboard sharing functionality.
3+
- Fixed unintuitive margins for bar chart reports.
4+
- Added abort button to save/load screen.
5+
- Added automatic fix for inconsistent DB url + encryption configurations.

src/NeoDash.js

Lines changed: 217 additions & 16 deletions
Large diffs are not rendered by default.

src/card/report/NeoBarChartReport.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class NeoBarChartReport extends NeoReport {
4949
xShift += (maxY < 0 || minY < 0) ? 10 : 0;
5050
var yShift = 20 + xTextLength * 4;
5151
var width = props.clientWidth - 100; //-90 + props.width * 105 - xShift * 0.5;
52-
var height = -140 + props.height * 100 - yShift;
53-
var margin = {top: 0, right: 0, bottom: yShift, left: xShift};
52+
var height = -160 + props.height * 100 - yShift
53+
var margin = {top: 10, right: 0, bottom: yShift, left: xShift};
5454

5555
var svg = d3.select(".chart" + id)
5656
.attr("width", width + margin.left + margin.right)
@@ -74,7 +74,7 @@ class NeoBarChartReport extends NeoReport {
7474
.style("text-anchor", "end");
7575

7676
var y = d3.scaleLinear()
77-
.domain([minY - (maxY - minY) * 0.1, maxY + (maxY - minY) * 0.1])
77+
.domain([minY, maxY])
7878
.range([height, 0]);
7979
svg.append("g")
8080
.call(d3.axisLeft(y));

src/component/NeoSaveLoadModal.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Button from "react-materialize/lib/Button";
44
import Textarea from "react-materialize/lib/Textarea";
55
import NeoModal from "./NeoModal";
66
import NeoTextButton from "./NeoTextButton";
7+
import Icon from "react-materialize/lib/Icon";
78

89
/**
910
* A modal component used for saving/loading dashboards.
@@ -18,8 +19,9 @@ class NeoSaveLoadModal extends NeoModal {
1819
* Draws the modal, creating a textbox defaulting to the current active dashboard state.
1920
*/
2021
render() {
22+
console.log(this.props.connection)
2123
return (
22-
<NeoModal header={"Load/Export Dashboard as JSON"}
24+
<NeoModal header={"Save/Load Dashboard as JSON"}
2325
root={document.getElementById("root")}
2426
json={this.props.json}
2527
placeholder={"Paste a dashboard JSON file here..."}
@@ -35,9 +37,17 @@ class NeoSaveLoadModal extends NeoModal {
3537
text={"load"}
3638
waves="green"/>,
3739
<NeoTextButton right
38-
color={"black"}
40+
color={"red"}
3941
node="button"
4042
style={{backgroundColor: "green", fontWeight: "bold", paddingRight: '0px',width:'50px', position: 'absolute', right: '150px', top: '20px'}}
43+
modal="close"
44+
onClick={this.props.onCancel}
45+
text={<Icon>close</Icon>}
46+
waves="white"/>,
47+
<NeoTextButton right
48+
color={"grey"}
49+
node="button"
50+
style={{backgroundColor: "red", fontWeight: "bold", paddingRight: '0px',width:'50px', position: 'absolute', right: '210px', top: '20px'}}
4151
onClick={this.props.onQuestionMarkClicked}
4252
text={"?"}
4353
waves="white"/>,

src/component/NeoShareModal.js

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
import Modal from "react-materialize/lib/Modal";
2+
import React from "react";
3+
import Button from "react-materialize/lib/Button";
4+
import Textarea from "react-materialize/lib/Textarea";
5+
import NeoModal from "./NeoModal";
6+
import NeoTextButton from "./NeoTextButton";
7+
import Icon from "react-materialize/lib/Icon";
8+
import NeoCheckBox from "./NeoCheckBox";
9+
import NeoButton from "./NeoButton";
10+
import NeoTextInput from "./NeoTextInput";
11+
12+
/**
13+
* A modal component used for saving/loading dashboards.
14+
* The content of the modal is a large multi-line textbox for specifying a dashboard file as JSON.
15+
*/
16+
class NeoShareModal extends NeoModal {
17+
baseURL = "https://nielsdejong.nl/neodash/";
18+
19+
constructor(props) {
20+
super(props);
21+
}
22+
23+
/**
24+
* Draws the modal, creating a textbox defaulting to the current active dashboard state.
25+
*/
26+
render() {
27+
return (
28+
29+
<NeoModal header={<div><Icon>people</Icon> Create Shareable Dashboard Link</div>}
30+
root={document.getElementById("root")}
31+
json={this.props.json}
32+
actions={[
33+
<NeoTextButton right
34+
color={"red"}
35+
node="button"
36+
onClick={e => this.stateChanged({label: "RemoveShareLink"})}
37+
style={{
38+
backgroundColor: "green",
39+
fontWeight: "bold",
40+
paddingRight: '0px',
41+
width: '50px',
42+
position: 'absolute',
43+
right: '20px',
44+
top: '20px'
45+
}}
46+
modal="close"
47+
text={<Icon>close</Icon>}
48+
waves="white"/>
49+
50+
]}
51+
trigger={
52+
this.props.trigger
53+
}
54+
content={<div>
55+
<hr/>
56+
<p>To generate a shareable link for this dashboard,
57+
make it accessible <a href={"https://gist.github.com/"}>online</a>.
58+
Then, paste the <b>direct</b> link here:</p>
59+
<NeoTextInput defaultValue={""} onChange={this.props.stateChanged}
60+
changeEventLabel={"ShareLinkURLChanged"} label={""}
61+
placeholder={'https://gist.githubusercontent.com/nielsdejong/492736631e65200f4159486edd678c5b/raw/ccf94786e07981e2a04e1bf708fe3365244c2d83/neodash.md'}/>
62+
63+
<p>
64+
<NeoCheckBox onChange={this.props.stateChanged}
65+
changeEventLabel={"ShareLinkCredentialsChanged"}
66+
label={"Include Connection Details"}
67+
defaultValue={(this.props.connection) ? "on" : "off"}>
68+
69+
</NeoCheckBox><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
70+
<NeoCheckBox onChange={this.stateChanged}
71+
changeEventLabel={"ShareLinkPasswordChanged"}
72+
label={"Include Password"}
73+
defaultValue={(this.props.password) ? "on" : "off"}>
74+
75+
</NeoCheckBox>
76+
77+
78+
</p>
79+
<hr/><br/>
80+
{(this.props.value && this.props.connection && !this.props.password) ?
81+
<p>Use this URL to load your dashboard, database URL, and username directly into NeoDash:</p> : ""}
82+
{(this.props.value && this.props.connection && this.props.password) ?
83+
<p>Use this URL to load your dashboard, database URL, username, and password directly into NeoDash:</p> : ""}
84+
{(this.props.value && !this.props.connection) ?
85+
<p>Use this URL to load your dashboard directly into NeoDash:</p> : ""}
86+
87+
88+
{(this.props.value && !this.props.value.startsWith("https%3A%2F%2Fgist.github.com")) ?
89+
<Textarea
90+
style={{minHeight: '120px', whiteSpace: 'break-spaces', textDecoration: "underline"}}
91+
id="Textarea-13" l={12} m={12}
92+
s={12} xl={12} value={this.generateShareLink()}
93+
placeholder={this.props.placeholder}/>
94+
:
95+
<></>
96+
}
97+
{(this.props.value && this.props.value.startsWith("https%3A%2F%2Fgist.github.com")) ?
98+
<p><b>That looks like a Github gist URL. Ensure you use a URL to the (raw) JSON instead.<br/>
99+
For gists, these start with https://gist.githubusercontent.com, and can be found by clicking the 'raw' button on the Gist page.</b></p>:
100+
<></>
101+
}
102+
103+
</div>}
104+
/>
105+
)
106+
}
107+
108+
109+
generateShareLink() {
110+
if (this.props.connectionValue) {
111+
return this.baseURL + "?url=" + this.props.value + "&connection=" + this.props.connectionValue;
112+
} else {
113+
return this.baseURL + "?url=" + this.props.value
114+
}
115+
116+
}
117+
}
118+
119+
export default (NeoShareModal);

src/component/NeoTextButton.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ import Icon from "react-materialize/lib/Icon";
77
*/
88
class NeoTextButton extends React.Component {
99
render() {
10+
let float = (this.props.float) ? (this.props.float) : "right";
1011
return (
11-
<Button floating={false} className={"btn right wide-button " + this.props.color} key={this.props.key}
12+
<Button floating={false} className={"btn " + float + " wide-button " + this.props.color}
13+
key={this.props.key}
1214
onClick={this.props.onClick}
1315
style={this.props.style}
1416
modal={this.props.modal}
1517
href="#">{this.props.text}
1618

17-
<Icon className={"fixed-icon"}>{this.props.icon}</Icon>
19+
<Icon className={"fixed-icon"}>{this.props.icon}</Icon>
1820
</Button>
1921
);
2022
}

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Footer from "react-materialize/lib/Footer";
44
import NeoDash from "./NeoDash";
55

66
// Configurable text for the interface
7-
const version = "1.1"
7+
const version = "1.1.1"
88
const readme = "https://github.com/nielsdejong/neodash/blob/master/README.md";
99
const appName = "NeoDash";
1010
const title = "NeoDash - Neo4j Dashboard Builder";
@@ -27,7 +27,8 @@ const Main = () => {
2727
document.title = title
2828

2929
// Check if there's a hard reset, if yes, override everything and dump the latest dashboard JSON.
30-
if (new URLSearchParams(window.location.search).get('reset') === "true") {
30+
let urlParams = new URLSearchParams(window.location.search);
31+
if (urlParams.get('reset') === "true") {
3132
let text = localStorage.getItem("neodash-dashboard");
3233
localStorage.removeItem("neodash-dashboard")
3334
return <div><p>{cacheClearedMessage}</p><code>{text}</code></div>;

0 commit comments

Comments
 (0)