Skip to content

Commit 31ccf16

Browse files
nielsdejongalfredorubin96BennuFire
authored
2.4.4 Release (#821)
* fixing gantt chart, new driver version was returning {low,high} numbers * Revert "fixing gantt chart, new driver version was returning {low,high} numbers" This reverts commit 4eb9285. * fixing gantt chart, new driver version was returning {low,high} numbers * NaNs * fixing number parsing * Revert "Handle token expiration in SSO (#611)" (#815) This reverts commit 001cee1. * Fixing RBAC feature + parameters (#813) * fixed race condition, to work on other points in PR * Fixes for complex parameter types in forms * Added special case for handling cross-db label access * handling fixed grants without non-fixed grants * Added error handling to RBAC extension * Added back async modifier * bug fixin grbac --------- Co-authored-by: Alfred Rubin <[email protected]> Co-authored-by: Niels de Jong <[email protected]> * Added 2.4.4 release notes, bumped version (#818) * Removed old console.log statements --------- Co-authored-by: Alfred Rubin <[email protected]> Co-authored-by: alfredorubin96 <[email protected]> Co-authored-by: Harold Agudelo <[email protected]>
1 parent cb33e50 commit 31ccf16

24 files changed

+218
-190
lines changed

.github/workflows/master-deployment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
context: .
8080
file: ./Dockerfile
8181
push: true
82-
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.4.3
82+
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.4.4
8383
build-docker-legacy:
8484
needs: build-test
8585
runs-on: neodash-runners
@@ -103,7 +103,7 @@ jobs:
103103
context: .
104104
file: ./Dockerfile
105105
push: true
106-
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.4.3
106+
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.4.4
107107
deploy-gallery:
108108
runs-on: neodash-runners
109109
strategy:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ USER nginx
4343
EXPOSE $NGINX_PORT
4444

4545
HEALTHCHECK cmd curl --fail "http://localhost:$NGINX_PORT" || exit 1
46-
LABEL version="2.4.3"
46+
LABEL version="2.4.4"

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## NeoDash 2.4.4
2+
This is a hotfix release fixing some breaking issues in the 2.4.3:
3+
- Fixed number parsing using newer versions of the Neo4j driver. [811](https://github.com/neo4j-labs/neodash/pull/811)
4+
- Reverted new connection handler for auto-renewed SSO sessions. [815](https://github.com/neo4j-labs/neodash/pull/815)
5+
- Improved handling of parameters in form extension, resolved local state issues. [813](https://github.com/neo4j-labs/neodash/pull/813)
6+
- Updated Role management extension to no longer execute queries in parallel, improved UX and error handling [813](https://github.com/neo4j-labs/neodash/pull/813)
7+
8+
If you are currently using NeoDash version 2.4.3, we recommend updating as soon as possible.
9+
110
## NeoDash 2.4.3
211
This release contains several improvements and additions to multi-dashboard management, as well as a bug fixes and a variety of quality-of-life improvements:
312

docs/modules/ROOT/pages/developer-guide/deploy-a-build.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Depending on the webserver type and version, this could be different directory.
3737
As an example - to copy the files to an nginx webserver using `scp`:
3838

3939
```bash
40-
scp neodash-2.4.3 username@host:/usr/share/nginx/html
40+
scp neodash-2.4.4 username@host:/usr/share/nginx/html
4141
```
4242

4343
NeoDash should now be visible by visiting your (sub)domain in the browser.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "neodash",
3-
"version": "2.4.3",
3+
"version": "2.4.4",
44
"description": "NeoDash - Neo4j Dashboard Builder",
55
"neo4jDesktop": {
66
"apiVersion": "^1.2.0"
@@ -72,7 +72,6 @@
7272
"mui-color": "^2.0.0-beta.2",
7373
"mui-nested-menu": "^3.2.1",
7474
"neo4j-client-sso": "^1.2.2",
75-
"neo4j-driver": "^5.12.0",
7675
"openai": "^3.3.0",
7776
"postcss": "^8.4.21",
7877
"postcss-loader": "^7.2.4",

release-notes.md

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
1-
## NeoDash 2.4.3
2-
This release contains several improvements and additions to multi-dashboard management, as well as a bug fixes and a variety of quality-of-life improvements:
3-
4-
Dashboard management and access control:
5-
- Added a UI for handling dashboard access using RBAC, as well as a new extension to simply access control.
6-
- Added button to sidebar to refresh the list of dashboards saved in the database.
7-
- Improved handling and detection of draft dashboards in the dashboard sidebar.
8-
9-
Other improvements:
10-
- Changed CSV export functionality for tables to use UTF-8 format.
11-
- Various improvements / fixes to the documentation to include new images, and up-to-date functionality.
12-
- Added logic for handling refresh tokens when connected to NeoDash via SSO.
13-
- Incorporated tooltips for bar charts with and without custom labels.
14-
15-
Bug fixes and testing:
16-
- Implemented bug fixes on type casting for numeric parameter selectors.
17-
- Fixed issue with report actions not functioning properly on node click events.
18-
- Extended test suite with Cypress tests for advanced settings in the bar chart.
19-
20-
Thanks to all the contributors for this release:
21-
- [OskarDamkjaer](https://github.com/OskarDamkjaer)
22-
- [alfredorubin96](https://github.com/alfredorubin96),
23-
- [AleSim94](https://github.com/AleSim94),
24-
- [BennuFire](https://github.com/BennuFire),
25-
- [jacobbleakley-neo4j](https://github.com/jacobbleakley-neo4j),
26-
- [josepmonclus](https://github.com/josepmonclus)
27-
- [nielsdejong](https://github.com/nielsdejong)
1+
## NeoDash 2.4.4
2+
This is a hotfix release fixing some breaking issues in the 2.4.3:
3+
- Fixed number parsing using newer versions of the Neo4j driver. [811](https://github.com/neo4j-labs/neodash/pull/811)
4+
- Reverted new connection handler for auto-renewed SSO sessions. [815](https://github.com/neo4j-labs/neodash/pull/815)
5+
- Improved handling of parameters in form extension, resolved local state issues. [813](https://github.com/neo4j-labs/neodash/pull/813)
6+
- Updated Role management extension to no longer execute queries in parallel, improved UX and error handling [813](https://github.com/neo4j-labs/neodash/pull/813)
7+
8+
If you are currently using NeoDash version 2.4.3, we recommend updating as soon as possible.

src/application/ApplicationActions.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* This file contains all state-changing actions relevant for the main application.
33
*/
44

5-
import { SSOProviderOriginal } from 'neo4j-client-sso';
6-
75
export const CLEAR_NOTIFICATION = 'APPLICATION/CLEAR_NOTIFICATION';
86
export const clearNotification = () => ({
97
type: CLEAR_NOTIFICATION,
@@ -58,11 +56,10 @@ export const setConnectionProperties = (
5856
port: string,
5957
database: string,
6058
username: string,
61-
password: string,
62-
ssoProviders?: SSOProviderOriginal[]
59+
password: string
6360
) => ({
6461
type: SET_CONNECTION_PROPERTIES,
65-
payload: { protocol, url, port, database, username, password, ssoProviders },
62+
payload: { protocol, url, port, database, username, password },
6663
});
6764

6865
export const SET_BASIC_CONNECTION_PROPERTIES = 'APPLICATION/SET_BASIC_CONNECTION_PROPERTIES';

src/application/ApplicationReducer.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ const initialState = {
6464
database: '',
6565
username: 'neo4j',
6666
password: '',
67-
ssoProviders: [],
6867
},
6968
shareDetails: undefined,
7069
desktopConnection: null,
@@ -247,7 +246,7 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
247246
return state;
248247
}
249248
case SET_CONNECTION_PROPERTIES: {
250-
const { protocol, url, port, database, username, password, ssoProviders } = payload;
249+
const { protocol, url, port, database, username, password } = payload;
251250
state = update(state, {
252251
connection: {
253252
protocol: protocol,
@@ -256,7 +255,6 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
256255
database: database,
257256
username: username,
258257
password: password,
259-
ssoProviders,
260258
},
261259
});
262260
return state;

src/application/ApplicationThunks.ts

Lines changed: 7 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { createDriver } from 'use-neo4j';
12
import { initializeSSO } from '../component/sso/SSOUtils';
23
import { DEFAULT_SCREEN, Screens } from '../config/ApplicationConfig';
34
import { setDashboard } from '../dashboard/DashboardActions';
@@ -43,9 +44,6 @@ import {
4344
} from './ApplicationActions';
4445
import { setLoggingMode, setLoggingDatabase, setLogErrorNotification } from './logging/LoggingActions';
4546
import { version } from '../modal/AboutModal';
46-
import neo4j, { auth, authTokenManagers } from 'neo4j-driver';
47-
import type { Neo4jScheme } from 'use-neo4j/dist/neo4j-config.interface';
48-
import { SSOProviderOriginal, handleRefreshingToken } from 'neo4j-client-sso';
4947
import { applicationIsStandalone } from './ApplicationSelectors';
5048
import { applicationGetLoggingSettings } from './logging/LoggingSelectors';
5149
import { createLogThunk } from './logging/LoggingThunk';
@@ -56,47 +54,6 @@ import { createUUID } from '../utils/uuid';
5654
* Several actions/other thunks may be dispatched from here.
5755
*/
5856

59-
export const createDriver = (
60-
scheme: Neo4jScheme,
61-
host: string,
62-
port: string | number,
63-
username?: string,
64-
password?: string,
65-
config?: { userAgent?: string },
66-
ssoProviders: SSOProviderOriginal[] = []
67-
) => {
68-
if (ssoProviders.length > 0) {
69-
const authTokenMgr = authTokenManagers.bearer({
70-
tokenProvider: async () => {
71-
const credentials = await handleRefreshingToken(ssoProviders);
72-
const token = auth.bearer(credentials.password);
73-
// Get the expiration from the JWT's payload, which is a JSON string encoded
74-
// using base64. You could also use a JWT parsing lib
75-
const [, payloadBase64] = credentials.password.split('.');
76-
const payload: unknown = JSON.parse(window.atob(payloadBase64 ?? ''));
77-
let expiration: Date;
78-
if (typeof payload === 'object' && payload !== null && 'exp' in payload) {
79-
expiration = new Date(Number(payload.exp) * 1000);
80-
} else {
81-
expiration = new Date();
82-
}
83-
84-
return {
85-
expiration,
86-
token,
87-
};
88-
},
89-
});
90-
return neo4j.driver(`${scheme}://${host}:${port}`, authTokenMgr, config);
91-
}
92-
93-
if (!username || !password) {
94-
return neo4j.driver(`${scheme}://${host}:${port}`);
95-
}
96-
97-
return neo4j.driver(`${scheme}://${host}:${port}`, neo4j.auth.basic(username, password), config);
98-
};
99-
10057
/**
10158
* Establish a connection to Neo4j with the specified credentials. Open/close the relevant windows when connection is made (un)successfully.
10259
* @param protocol - the neo4j protocol (e.g. bolt, bolt+s, neo4j+s, ...)
@@ -105,24 +62,14 @@ export const createDriver = (
10562
* @param database - the Neo4j database to connect to.
10663
* @param username - Neo4j username.
10764
* @param password - Neo4j password.
108-
* @param SSOProviders - List of available SSO providers
10965
*/
11066
export const createConnectionThunk =
111-
(protocol, url, port, database, username, password, SSOProviders = []) =>
112-
(dispatch: any, getState: any) => {
67+
(protocol, url, port, database, username, password) => (dispatch: any, getState: any) => {
11368
const loggingState = getState();
11469
const loggingSettings = applicationGetLoggingSettings(loggingState);
11570
const neodashMode = applicationIsStandalone(loggingState) ? 'Standalone' : 'Editor';
11671
try {
117-
const driver = createDriver(
118-
protocol,
119-
url,
120-
port,
121-
username,
122-
password,
123-
{ userAgent: `neodash/v${version}` },
124-
SSOProviders
125-
);
72+
const driver = createDriver(protocol, url, port, username, password, { userAgent: `neodash/v${version}` });
12673
// eslint-disable-next-line no-console
12774
console.log('Attempting to connect...');
12875
const validateConnection = (records) => {
@@ -561,7 +508,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
561508
dispatch(setAboutModalOpen(false));
562509
dispatch(setConnected(false));
563510
dispatch(setWelcomeScreenOpen(false));
564-
const success = await initializeSSO(state.application.cachedSSODiscoveryUrl, (credentials, ssoProviders) => {
511+
const success = await initializeSSO(state.application.cachedSSODiscoveryUrl, (credentials) => {
565512
if (standalone) {
566513
// Redirected from SSO and running in viewer mode, merge retrieved config with hardcoded credentials.
567514
dispatch(
@@ -571,8 +518,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
571518
config.standalonePort,
572519
config.standaloneDatabase,
573520
credentials.username,
574-
credentials.password,
575-
ssoProviders
521+
credentials.password
576522
)
577523
);
578524
dispatch(
@@ -582,8 +528,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
582528
config.standalonePort,
583529
config.standaloneDatabase,
584530
credentials.username,
585-
credentials.password,
586-
ssoProviders
531+
credentials.password
587532
)
588533
);
589534
} else {
@@ -595,8 +540,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
595540
state.application.connection.port,
596541
state.application.connection.database,
597542
credentials.username,
598-
credentials.password,
599-
ssoProviders
543+
credentials.password
600544
)
601545
);
602546
dispatch(setConnected(true));

src/chart/ChartUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function valueIsObject(value) {
9595
}
9696

9797
export function toNumber(ref) {
98-
if (ref === undefined) {
98+
if (ref === undefined || typeof ref === 'number') {
9999
return ref;
100100
}
101101
let { low, high } = ref;
@@ -172,7 +172,7 @@ export const downloadCSV = (rows) => {
172172
});
173173
csv += '\n';
174174
});
175-
const file = new Blob([`\ufeff${ csv}`], { type: 'text/plain;charset=utf8' });
175+
const file = new Blob([`\ufeff${csv}`], { type: 'text/plain;charset=utf8' });
176176
element.href = URL.createObjectURL(file);
177177
element.download = 'table.csv';
178178
document.body.appendChild(element); // Required for this to work in FireFox

src/chart/graph/util/RecordUtils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { evaluateRulesOnNode, evaluateRulesOnLink } from '../../../extensions/styling/StyleRuleEvaluator';
22
import { extractNodePropertiesFromRecords, mergeNodePropsFieldsLists } from '../../../report/ReportRecordProcessing';
3-
import { valueIsArray, valueIsNode, valueIsRelationship, valueIsPath } from '../../ChartUtils';
3+
import { valueIsArray, valueIsNode, valueIsRelationship, valueIsPath, toNumber } from '../../ChartUtils';
44
import { GraphChartVisualizationProps } from '../GraphChartVisualization';
55
import { assignCurvatureToLink } from './RelUtils';
66
import { isNode } from 'neo4j-driver-core/lib/graph-types.js';
@@ -49,7 +49,9 @@ function extractGraphEntitiesFromField(
4949
nodes[value.identity.low] = {
5050
id: value.identity.low,
5151
labels: value.labels,
52-
size: value.properties[nodeSizeProperty] ? value.properties[nodeSizeProperty] : defaultNodeSize,
52+
size: !Number.isNaN(value.properties[nodeSizeProperty])
53+
? toNumber(value.properties[nodeSizeProperty])
54+
: defaultNodeSize,
5355
properties: value.properties,
5456
mainLabel: value.labels[value.labels.length - 1],
5557
};
@@ -67,7 +69,9 @@ function extractGraphEntitiesFromField(
6769
source: value.start.low,
6870
target: value.end.low,
6971
type: value.type,
70-
width: value.properties[relWidthProperty] ? value.properties[relWidthProperty] : defaultRelWidth,
72+
width: !Number.isNaN(value.properties[relWidthProperty])
73+
? toNumber(value.properties[relWidthProperty])
74+
: defaultRelWidth,
7175
color: value.properties[relColorProperty] ? value.properties[relColorProperty] : defaultRelColor,
7276
properties: value.properties,
7377
});

src/component/sso/SSOUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const initializeSSO = async (cachedSSODiscoveryUrl, _setCredentials) => {
118118
// Successful credentials retrieval.
119119
// Log in at the Neo4j dbms now using the Neo4j (js) driver.
120120
//
121-
_setCredentials(credentials, mergedSSOProviders);
121+
_setCredentials(credentials);
122122

123123
// Exemplifying retrieval of stored URL paramenters
124124
_retrieveAdditionalURLParameters();

src/dashboard/Dashboard.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ import NeoPage from '../page/Page';
33
import NeoDashboardHeader from './header/DashboardHeader';
44
import NeoDashboardTitle from './header/DashboardTitle';
55
import NeoDashboardHeaderPageList from './header/DashboardHeaderPageList';
6-
import { Neo4jProvider } from 'use-neo4j';
6+
import { createDriver, Neo4jProvider } from 'use-neo4j';
77
import { applicationGetConnection, applicationGetStandaloneSettings } from '../application/ApplicationSelectors';
88
import { connect } from 'react-redux';
99
import NeoDashboardConnectionUpdateHandler from '../component/misc/DashboardConnectionUpdateHandler';
1010
import { forceRefreshPage } from '../page/PageActions';
1111
import { getPageNumber } from '../settings/SettingsSelectors';
1212
import { createNotificationThunk } from '../page/PageThunks';
1313
import { version } from '../modal/AboutModal';
14-
import { createDriver } from '../application/ApplicationThunks';
1514
import NeoDashboardSidebar from './sidebar/DashboardSidebar';
1615

1716
const Dashboard = ({
@@ -33,10 +32,8 @@ const Dashboard = ({
3332
connection.port,
3433
connection.username,
3534
connection.password,
36-
{ userAgent: `neodash/v${version}` },
37-
connection.ssoProviders
35+
{ userAgent: `neodash/v${version}` }
3836
);
39-
// @ts-ignore wrong driver version
4037
setDriver(newDriver);
4138
}
4239
const content = (

src/extensions/advancedcharts/chart/gantt/Utils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { toNumber } from '../../../../chart/ChartUtils';
12
import { buildGraphVisualizationObjectFromRecords } from '../../../../chart/graph/util/RecordUtils';
23
import date_utils from './frappe/lib/date_utils';
34

@@ -97,9 +98,9 @@ export function createTasksList(
9798
return undefined;
9899
}
99100
}
100-
return {
101-
start: new Date(neoStartDate.year, neoStartDate.month, neoStartDate.day),
102-
end: new Date(neoEndDate.year, neoEndDate.month, neoEndDate.day),
101+
let res = {
102+
start: new Date(toNumber(neoStartDate.year), toNumber(neoStartDate.month), toNumber(neoStartDate.day)),
103+
end: new Date(toNumber(neoEndDate.year), toNumber(neoEndDate.month), toNumber(neoEndDate.day)),
103104
name: name || '(undefined)',
104105
labels: n.labels,
105106
dependencies: dependencies[n.id],
@@ -112,6 +113,7 @@ export function createTasksList(
112113
isDisabled: true,
113114
styles: { progressColor: '#ffbb54', progressSelectedColor: '#ff9e0d' },
114115
};
116+
return res;
115117
})
116118
.filter((i) => i !== undefined);
117119
}

src/extensions/forms/FormsReportConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const FORMS = {
4646
label: 'Clear parameters after submit',
4747
type: SELECTION_TYPES.LIST,
4848
values: [true, false],
49-
default: false,
49+
default: true,
5050
},
5151
hasResetButton: {
5252
label: 'Has Reset Button',

0 commit comments

Comments
 (0)