Skip to content

Commit b08cb5a

Browse files
nielsdejongTkrogholtTKQT
authored
2.0.12 (#105)
* Stability fixes for 2.0.11 * Added prototype SSO implementation * Changed dockerfile usage from ENV to ARG (#93) * Stability fixes for 2.0.11 (#76) Fix for rendering dictionaries in tables/single value charts. Added resize handler for fullscreen map views. Added missing auto-run config to pie charts. Fixed broken value scale parameter for bar charts. * Changed dockerfile usage from ENV to ARG Also using CMD as opposed to ENTRYPOINT * Updated supporting docker scripts * Renamed docker run scripts, deleted docker-build.bash * Changed dockerfile usage from ENV to ARG Also using CMD as opposed to ENTRYPOINT * Updated supporting docker scripts * Renamed docker run scripts, deleted docker-build.bash * Updated README to match new Docker image setup Co-authored-by: Niels de Jong <[email protected]> Co-authored-by: Tobias <[email protected]> * Added color selector component. Clean up/refactoring of file names * Tweaking of color picker for advanced settings, added framework for rule-based styling of reports * Clean up, refactoring of project structure * Added version number to Dockerfile * Moved version number in docker file to before RUN command * Added some more comments to the docker scripts * Restructured scripts and docker file locations, added conf.d * Added conf.d directory * Updated version number and Dockerfile references * updated path to conf.d * Updated version number in dockerfile * First version of rule-based styling is completed * Fixed handling of nginx configuration file (#98) * Remedied errors in handling of nginx configs * Adjusted copy of default.conf Co-authored-by: Tobias Krøgholt <[email protected]> * Update Dockerfile * Update Dockerfile * Improved handling of null values in tables * Added support for custom style rules to relevant report types * Removed standalone password from default configuration * Fixed default styling for config.json * Updated release notes, readme and docker push script for 2.0.12 * Updated description of component hierarchy * Set dockerfile to pull from master by default Co-authored-by: Tkrogholt <[email protected]> Co-authored-by: Tobias <[email protected]>
1 parent 6c84da1 commit b08cb5a

File tree

95 files changed

+1314
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1314
-290
lines changed

tools/Dockerfile renamed to Dockerfile

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ FROM nginx:alpine AS neodash
1212
RUN apk upgrade
1313
COPY --from=build-stage /usr/local/src/neodash/dist /usr/share/nginx/html
1414

15-
# Set default config options
16-
ENV standalone=false
15+
COPY ./conf/default.conf /etc/nginx/conf.d/
1716

1817
RUN chown -R nginx:nginx /var/cache/nginx && \
1918
chown -R nginx:nginx /var/log/nginx && \
@@ -27,19 +26,22 @@ USER nginx
2726
EXPOSE 5005
2827
HEALTHCHECK cmd curl --fail http://localhost:5005 || exit 1
2928

30-
# Set the defaults for the environment variables. These can be changed at runtime by modifying the docker arguments, avoiding container rebuilds.
31-
ENV standalone=false
32-
ENV ssoEnabled=false
33-
ENV ssoDiscoveryUrl='https://example.com'
34-
ENV standaloneProtocol='neo4j+s'
35-
ENV standaloneHost='test.databases.neo4j.io'
36-
ENV standalonePort=7687
37-
ENV standaloneDatabase='neo4j'
38-
ENV standaloneDashboardName='My Dashboard'
39-
ENV standaloneDashboardDatabase='neo4j'
29+
# Set the defaults for the build arguments. When the image is created, these variables can be changed with --build-arg
30+
# Such as --build-arg ssoEnabled=true
31+
ARG standalone=false
32+
ARG ssoEnabled=false
33+
ARG ssoDiscoveryUrl='https://example.com'
34+
ARG standaloneProtocol='neo4j+s'
35+
ARG standaloneHost='test.databases.neo4j.io'
36+
ARG standalonePort=7687
37+
ARG standaloneDatabase='neo4j'
38+
ARG standaloneDashboardName='My Dashboard'
39+
ARG standaloneDashboardDatabase='neo4j'
40+
41+
LABEL version="2.0.12"
4042

4143
# Dynamically set app config on container startup.
42-
ENTRYPOINT echo " \
44+
RUN echo " \
4345
{ \
4446
\"ssoEnabled\": ${ssoEnabled}, \
4547
\"ssoDiscoveryUrl\": \"${ssoDiscoveryUrl}\", \
@@ -50,7 +52,8 @@ ENTRYPOINT echo " \
5052
\"standaloneDatabase\": \"${standaloneDatabase}\", \
5153
\"standaloneDashboardName\": \"${standaloneDashboardName}\", \
5254
\"standaloneDashboardDatabase\": \"${standaloneDashboardDatabase}\" \
53-
}" > /usr/share/nginx/html/config.json && \
54-
nginx -g 'daemon off;'
55+
}" > /usr/share/nginx/html/config.json
56+
57+
CMD ["nginx", "-g", "daemon off;"]
5558

56-
# neodash will be available at http://localhost:8080 by default.
59+
# neodash will be available at http://localhost:80 inside the container. See `scripts/docker-build-run-unix.bash` on how to map ports.

README.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,24 @@ To build the app for production:
4343

4444

4545
## Build Docker image
46-
Make sure you have a recent version of `docker` installed.
47-
On a Unix-like system you can run `./tools/docker-build.bash` to build the multi-stage NeoDash image.
46+
A pre-built Docker image is available [on DockerHub](https://hub.docker.com/r/nielsdejong/neodash).
47+
This image is built using the default configuration (running in editor mode, without SSO).
48+
49+
### To build the image yourself:
4850

49-
After this, you can run Neo4j in a container. On Unix (Mac/Linux) systems:
51+
Make sure you have a recent version of `docker` installed to build the multi-stage NeoDash image and run it.
52+
53+
On Unix (Mac/Linux) systems:
5054
```
51-
$ cd tools/
52-
$ ./docker-run-unix.bash
55+
$ ./scripts/docker-build-run-unix.bash
5356
```
5457

5558
If you use Windows, you should have installed WSL. In WSL, you can run the script as follows:
5659
```
57-
$ cd tools/
58-
$ ./docker-run-windows.bash
60+
$ ./scripts/docker-build-run-windows.bash
5961
```
60-
Then visit `http://localhost:8080` with the chosen port in your browser.
62+
Then visit `http://localhost:8080` in your browser.
6163

62-
A pre-built Docker image is available [on DockerHub](https://hub.docker.com/r/nielsdejong/neodash).
6364

6465
## Run in standalone mode
6566
NeoDash can be deployed in a 'standalone mode' for dashboard viewers. This mode will:
@@ -71,7 +72,7 @@ The diagram below illustrates how NeoDash standalone mode can be deployed next t
7172

7273
![](doc/standalone-architecture.png)
7374

74-
You can configure an instance to run as standalone by changing the variables in `tools/docker-run-unix.bash`, or, if you're not using docker, directly modifying `public/config.json`. Note that the editor mode is determined at runtime by the React app, and *not* at build time. You therefore do not need to (re-)build a docker image.
75+
You can configure an instance to run as standalone by changing the variables in `scripts/docker-build-run-unix.bash`, or, if you're not using docker, directly modifying `public/config.json`. Note that the editor mode is determined at runtime by the React app, and *not* at build time. You therefore do not need to (re-)build the React application, just the image.
7576

7677
## Extending NeoDash
7778
There are two categories of extensions to NeoDash you can build:
@@ -88,22 +89,22 @@ To extend the core functionality of the app, it helps to be familiar with the fo
8889
- Redux Thunks
8990

9091
The image below contains a high-level overview of the component hierarchy within the application. The following conceptual building blocks are used to create the interface:
91-
- The Application
92-
- The Dashboard
93-
- Modals
94-
- Drawer
95-
- Dashboard Header
96-
- Pages
97-
- Cards
98-
- Card Views
99-
- Card Settings
100-
- Card View Header
101-
- Report
102-
- Card View Footer
103-
- Card Settings Header
104-
- Card Settings Content
105-
- Card Settings Footer
106-
- Charts
92+
- **The Application** - highest level in the component structure. Handles all application-level logic (e.g. initalizing the app).
93+
- **Modals** - all pop-up windows used by the tool. (Connection modal, save-dashboard modal, errors/warnings, etc.)
94+
- **Drawer** - the sidebar on the left side of the screen. Contains buttons to perform application-level actions.
95+
- **The Dashboard** - Main dashboard component. Renders components dynamically based on the current state.
96+
- **Dashboard Header** - the textbox at the top of the screen that lets you set a title for the dashboard, plus the page selector.
97+
- **Pages** - a dashboard has one or more pages, each of which can have a list of cards.
98+
- **Cards** - a 'block' inside a dashboard. Each card contains a 'view' window, and a 'settings' window.
99+
- **Card View** - the front of the card containing the selected report.
100+
- **Card Settings** - the back of the card, containing the cypher editor and advanced settings for the report.
101+
- **Card View Header** - the header of the card, containing a text box that acts as the name of the report.
102+
- **Report** - the component inside the card view that handles query execution and result parsing. Contains a single chart (visualization)
103+
- **Card View Footer** - The footer of the card view. Depending on the type, contains several 'selectors' that modify the visualization.
104+
- **Card Settings Header** - Header of the card settings, used for moving/deleting the card.
105+
- **Card Settings Content** - the component containing the main content of the report. This is most often the Cypher query editor.
106+
- **Card Settings Footer** - the 'footer' of the card. This contains the 'advanced settings' window for reports.
107+
- **Charts** - the different visualizations used by the application: bar charts, tables, graphs, etc.
107108

108109
![](doc/component-hierarchy.png)
109110

conf/default.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
server {
2+
listen 5005;
3+
server_name localhost;
4+
include mime.types;
5+
location / {
6+
root /usr/share/nginx/html;
7+
try_files $uri $uri/ /index.html;
8+
index index.html index.htm;
9+
}
10+
# redirect server error pages to the static page /50x.html
11+
# Note: This is optional, depending on the implementation in React
12+
error_page 500 502 503 504 /50x.html;
13+
location = /50x.html {
14+
root /usr/share/nginx/html;
15+
}
16+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "neodash",
3-
"version": "2.0.11",
3+
"version": "2.0.12",
44
"description": "NeoDash - Neo4j Dashboard Builder",
55
"neo4jDesktop": {
66
"apiVersion": "^1.2.0"
@@ -34,6 +34,7 @@
3434
"@material-ui/core": "^4.12.3",
3535
"@material-ui/icons": "^4.11.2",
3636
"@material-ui/lab": "^4.0.0-alpha.60",
37+
"@material-ui/styles": "^4.11.4",
3738
"@mui/material": "^5.3.0",
3839
"@mui/x-data-grid": "^5.2.2",
3940
"@nivo/bar": "^0.79.1",
@@ -46,6 +47,8 @@
4647
"cypher-codemirror": "github:nielsdejong/cypher-editor#c0eff97fc97f22355e60b57fb6f8dc26b16f9a5f",
4748
"d3-scale-chromatic": "^3.0.0",
4849
"leaflet": "^1.7.1",
50+
"material-ui-color-picker": "github:nielsdejong/material-ui-color-picker#fd4766cc4e8e38966417fbdbf62ebe628dd699ec",
51+
"neo4j-client-sso": "^1.2.2",
4952
"react": "^17.0.2",
5053
"react-cool-dimensions": "^2.0.7",
5154
"react-dom": "^17.0.2",

public/config.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
2-
"ssoEnabled": false,
3-
"ssoDiscoveryUrl": "https://example.com",
2+
"ssoEnabled": false,
3+
"ssoDiscoveryUrl": "https://example.com",
44
"standalone": false,
55
"standaloneProtocol": "neo4j",
66
"standaloneHost": "localhost",
7-
"standalonePassword":"test123",
87
"standalonePort": "7687",
9-
"standaloneDatabase": "neo4j",
8+
"standaloneDatabase": "neo4j",
109
"standaloneDashboardName": "My Dashboard",
11-
"standaloneDashboardDatabase": "dashboards"
10+
"standaloneDashboardDatabase": "dashboards"
1211
}

public/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
.MuiTablePagination-root{
7777
margin-top: -10px;
7878
} */
79+
.chrome-picker {
80+
margin-top: -285px;
81+
margin-left: 10px;
82+
}
7983
.MuiTablePagination-root{
8084
margin-top: -10px;
8185
}

release-notes.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## NeoDash 2.0.12
2+
Added **rule-based styling**:
3+
- Use the card settings to specify styling rules for tables, graphs, bar/pie/line charts and single values.
4+
- Conditional rules are evaluated on each report render in order of priority.
5+
- Rules can customize colors in tables, node colors & dynamically set the colors of components in your chart.
6+
7+
Minor improvements:
8+
- Better handling of null values in tables.
9+
- Tweaking/reorganization of the Docker file and deployment scripts.
10+
- Renaming/restructuring of source code.
11+
112
## NeoDash 2.0.8 / 2.0.9 / 2.0.10 / 2.0.11
213
Stability fixes to supplement 2.0.7:
314
- Hotfix for missing config file in Neo4j Desktop causing startup issue.

scripts/docker-build-run-unix.bash

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# The port to expose NeoDash on.
2+
port=8080
3+
# Set `standalone=true`` to disable the editor, and create a 'fixed' dashboard view.
4+
standalone=false
5+
# If `standalone=true`, the protocol for the hardcoded database connection.
6+
standaloneProtocol='neo4j+s'
7+
# If `standalone=true`, the hostname for the hardcoded database connection.
8+
standaloneHost='example.databases.neo4j.io'
9+
# If `standalone=true`, the port for the hardcoded database connection.
10+
standalonePort=7687
11+
# If `standalone=true`, the database for the hardcoded database connection.
12+
standaloneDatabase='neo4j'
13+
# If `standalone=true`, the name of the dashboard stored in Neo4j to load. This is case-sensitive, and will load the latest version of a dashboard with the exact name.
14+
standaloneDashboardName='My Dashboard'
15+
# If `standalone=true`, the database name that the "to be loaded" dashboard is stored in.
16+
standaloneDashboardDatabase='neo4j'
17+
18+
# SSO settings. Experimental.
19+
ssoEnabled=false
20+
ssoDiscoveryUrl='https://example.com'
21+
22+
echo "-----------------------------------------------"
23+
echo "neodash is available at http://localhost:$port."
24+
echo "-----------------------------------------------"
25+
docker build --build-arg standalone=$standalone --build-arg ssoEnabled=$ssoEnabled --build-arg ssoDiscoveryUrl=$ssoDiscoveryUrl --build-arg standaloneProtocol=$standaloneProtocol --build-arg standaloneHost=$standaloneHost --build-arg standalonePort=$standalonePort --build-arg standaloneDatabase=$standaloneDatabase --build-arg standaloneDashboardName="${standaloneDashboardName}" --build-arg standaloneDashboardDatabase=$standaloneDashboardDatabase -t neodash .
26+
docker run -it --rm -p $port:80 neodash
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# The port to expose NeoDash on.
2+
port=8080
3+
# Set `standalone=true`` to disable the editor, and create a 'fixed' dashboard view.
4+
standalone=false
5+
# If `standalone=true`, the protocol for the hardcoded database connection.
6+
standaloneProtocol='neo4j+s'
7+
# If `standalone=true`, the hostname for the hardcoded database connection.
8+
standaloneHost='example.databases.neo4j.io'
9+
# If `standalone=true`, the port for the hardcoded database connection.
10+
standalonePort=7687
11+
# If `standalone=true`, the database for the hardcoded database connection.
12+
standaloneDatabase='neo4j'
13+
# If `standalone=true`, the name of the dashboard stored in Neo4j to load. This is case-sensitive, and will load the latest version of a dashboard with the exact name.
14+
standaloneDashboardName='My Dashboard'
15+
# If `standalone=true`, the database name that the "to be loaded" dashboard is stored in.
16+
standaloneDashboardDatabase='neo4j'
17+
18+
# SSO settings. Experimental.
19+
ssoEnabled=false
20+
ssoDiscoveryUrl='https://example.com'
21+
22+
echo "-----------------------------------------------"
23+
echo "neodash is available at http://localhost:$port."
24+
echo "-----------------------------------------------"
25+
winpty docker build --build-arg standalone=$standalone --build-arg ssoEnabled=$ssoEnabled --build-arg ssoDiscoveryUrl=$ssoDiscoveryUrl --build-arg standaloneProtocol=$standaloneProtocol --build-arg standaloneHost=$standaloneHost --build-arg standalonePort=$standalonePort --build-arg standaloneDatabase=$standaloneDatabase --build-arg standaloneDashboardName="${standaloneDashboardName}" --build-arg standaloneDashboardDatabase=$standaloneDashboardDatabase -t neodash .
26+
winpty docker run -it --rm -p $port:80 neodash
File renamed without changes.

0 commit comments

Comments
 (0)