Skip to content

Commit

Permalink
2.4.4 Release (#821)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
4 people authored Mar 6, 2024
1 parent cb33e50 commit 31ccf16
Show file tree
Hide file tree
Showing 24 changed files with 218 additions and 190 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/master-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.4.3
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.4.4
build-docker-legacy:
needs: build-test
runs-on: neodash-runners
Expand All @@ -103,7 +103,7 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.4.3
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.4.4
deploy-gallery:
runs-on: neodash-runners
strategy:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ USER nginx
EXPOSE $NGINX_PORT

HEALTHCHECK cmd curl --fail "http://localhost:$NGINX_PORT" || exit 1
LABEL version="2.4.3"
LABEL version="2.4.4"
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## NeoDash 2.4.4
This is a hotfix release fixing some breaking issues in the 2.4.3:
- Fixed number parsing using newer versions of the Neo4j driver. [811](https://github.com/neo4j-labs/neodash/pull/811)
- Reverted new connection handler for auto-renewed SSO sessions. [815](https://github.com/neo4j-labs/neodash/pull/815)
- Improved handling of parameters in form extension, resolved local state issues. [813](https://github.com/neo4j-labs/neodash/pull/813)
- 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)

If you are currently using NeoDash version 2.4.3, we recommend updating as soon as possible.

## NeoDash 2.4.3
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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Depending on the webserver type and version, this could be different directory.
As an example - to copy the files to an nginx webserver using `scp`:

```bash
scp neodash-2.4.3 username@host:/usr/share/nginx/html
scp neodash-2.4.4 username@host:/usr/share/nginx/html
```

NeoDash should now be visible by visiting your (sub)domain in the browser.
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neodash",
"version": "2.4.3",
"version": "2.4.4",
"description": "NeoDash - Neo4j Dashboard Builder",
"neo4jDesktop": {
"apiVersion": "^1.2.0"
Expand Down Expand Up @@ -72,7 +72,6 @@
"mui-color": "^2.0.0-beta.2",
"mui-nested-menu": "^3.2.1",
"neo4j-client-sso": "^1.2.2",
"neo4j-driver": "^5.12.0",
"openai": "^3.3.0",
"postcss": "^8.4.21",
"postcss-loader": "^7.2.4",
Expand Down
35 changes: 8 additions & 27 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
## NeoDash 2.4.3
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:

Dashboard management and access control:
- Added a UI for handling dashboard access using RBAC, as well as a new extension to simply access control.
- Added button to sidebar to refresh the list of dashboards saved in the database.
- Improved handling and detection of draft dashboards in the dashboard sidebar.

Other improvements:
- Changed CSV export functionality for tables to use UTF-8 format.
- Various improvements / fixes to the documentation to include new images, and up-to-date functionality.
- Added logic for handling refresh tokens when connected to NeoDash via SSO.
- Incorporated tooltips for bar charts with and without custom labels.

Bug fixes and testing:
- Implemented bug fixes on type casting for numeric parameter selectors.
- Fixed issue with report actions not functioning properly on node click events.
- Extended test suite with Cypress tests for advanced settings in the bar chart.

Thanks to all the contributors for this release:
- [OskarDamkjaer](https://github.com/OskarDamkjaer)
- [alfredorubin96](https://github.com/alfredorubin96),
- [AleSim94](https://github.com/AleSim94),
- [BennuFire](https://github.com/BennuFire),
- [jacobbleakley-neo4j](https://github.com/jacobbleakley-neo4j),
- [josepmonclus](https://github.com/josepmonclus)
- [nielsdejong](https://github.com/nielsdejong)
## NeoDash 2.4.4
This is a hotfix release fixing some breaking issues in the 2.4.3:
- Fixed number parsing using newer versions of the Neo4j driver. [811](https://github.com/neo4j-labs/neodash/pull/811)
- Reverted new connection handler for auto-renewed SSO sessions. [815](https://github.com/neo4j-labs/neodash/pull/815)
- Improved handling of parameters in form extension, resolved local state issues. [813](https://github.com/neo4j-labs/neodash/pull/813)
- 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)

If you are currently using NeoDash version 2.4.3, we recommend updating as soon as possible.
7 changes: 2 additions & 5 deletions src/application/ApplicationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* This file contains all state-changing actions relevant for the main application.
*/

import { SSOProviderOriginal } from 'neo4j-client-sso';

export const CLEAR_NOTIFICATION = 'APPLICATION/CLEAR_NOTIFICATION';
export const clearNotification = () => ({
type: CLEAR_NOTIFICATION,
Expand Down Expand Up @@ -58,11 +56,10 @@ export const setConnectionProperties = (
port: string,
database: string,
username: string,
password: string,
ssoProviders?: SSOProviderOriginal[]
password: string
) => ({
type: SET_CONNECTION_PROPERTIES,
payload: { protocol, url, port, database, username, password, ssoProviders },
payload: { protocol, url, port, database, username, password },
});

export const SET_BASIC_CONNECTION_PROPERTIES = 'APPLICATION/SET_BASIC_CONNECTION_PROPERTIES';
Expand Down
4 changes: 1 addition & 3 deletions src/application/ApplicationReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const initialState = {
database: '',
username: 'neo4j',
password: '',
ssoProviders: [],
},
shareDetails: undefined,
desktopConnection: null,
Expand Down Expand Up @@ -247,7 +246,7 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
return state;
}
case SET_CONNECTION_PROPERTIES: {
const { protocol, url, port, database, username, password, ssoProviders } = payload;
const { protocol, url, port, database, username, password } = payload;
state = update(state, {
connection: {
protocol: protocol,
Expand All @@ -256,7 +255,6 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
database: database,
username: username,
password: password,
ssoProviders,
},
});
return state;
Expand Down
70 changes: 7 additions & 63 deletions src/application/ApplicationThunks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { createDriver } from 'use-neo4j';
import { initializeSSO } from '../component/sso/SSOUtils';
import { DEFAULT_SCREEN, Screens } from '../config/ApplicationConfig';
import { setDashboard } from '../dashboard/DashboardActions';
Expand Down Expand Up @@ -43,9 +44,6 @@ import {
} from './ApplicationActions';
import { setLoggingMode, setLoggingDatabase, setLogErrorNotification } from './logging/LoggingActions';
import { version } from '../modal/AboutModal';
import neo4j, { auth, authTokenManagers } from 'neo4j-driver';
import type { Neo4jScheme } from 'use-neo4j/dist/neo4j-config.interface';
import { SSOProviderOriginal, handleRefreshingToken } from 'neo4j-client-sso';
import { applicationIsStandalone } from './ApplicationSelectors';
import { applicationGetLoggingSettings } from './logging/LoggingSelectors';
import { createLogThunk } from './logging/LoggingThunk';
Expand All @@ -56,47 +54,6 @@ import { createUUID } from '../utils/uuid';
* Several actions/other thunks may be dispatched from here.
*/

export const createDriver = (
scheme: Neo4jScheme,
host: string,
port: string | number,
username?: string,
password?: string,
config?: { userAgent?: string },
ssoProviders: SSOProviderOriginal[] = []
) => {
if (ssoProviders.length > 0) {
const authTokenMgr = authTokenManagers.bearer({
tokenProvider: async () => {
const credentials = await handleRefreshingToken(ssoProviders);
const token = auth.bearer(credentials.password);
// Get the expiration from the JWT's payload, which is a JSON string encoded
// using base64. You could also use a JWT parsing lib
const [, payloadBase64] = credentials.password.split('.');
const payload: unknown = JSON.parse(window.atob(payloadBase64 ?? ''));
let expiration: Date;
if (typeof payload === 'object' && payload !== null && 'exp' in payload) {
expiration = new Date(Number(payload.exp) * 1000);
} else {
expiration = new Date();
}

return {
expiration,
token,
};
},
});
return neo4j.driver(`${scheme}://${host}:${port}`, authTokenMgr, config);
}

if (!username || !password) {
return neo4j.driver(`${scheme}://${host}:${port}`);
}

return neo4j.driver(`${scheme}://${host}:${port}`, neo4j.auth.basic(username, password), config);
};

/**
* Establish a connection to Neo4j with the specified credentials. Open/close the relevant windows when connection is made (un)successfully.
* @param protocol - the neo4j protocol (e.g. bolt, bolt+s, neo4j+s, ...)
Expand All @@ -105,24 +62,14 @@ export const createDriver = (
* @param database - the Neo4j database to connect to.
* @param username - Neo4j username.
* @param password - Neo4j password.
* @param SSOProviders - List of available SSO providers
*/
export const createConnectionThunk =
(protocol, url, port, database, username, password, SSOProviders = []) =>
(dispatch: any, getState: any) => {
(protocol, url, port, database, username, password) => (dispatch: any, getState: any) => {
const loggingState = getState();
const loggingSettings = applicationGetLoggingSettings(loggingState);
const neodashMode = applicationIsStandalone(loggingState) ? 'Standalone' : 'Editor';
try {
const driver = createDriver(
protocol,
url,
port,
username,
password,
{ userAgent: `neodash/v${version}` },
SSOProviders
);
const driver = createDriver(protocol, url, port, username, password, { userAgent: `neodash/v${version}` });
// eslint-disable-next-line no-console
console.log('Attempting to connect...');
const validateConnection = (records) => {
Expand Down Expand Up @@ -561,7 +508,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
dispatch(setAboutModalOpen(false));
dispatch(setConnected(false));
dispatch(setWelcomeScreenOpen(false));
const success = await initializeSSO(state.application.cachedSSODiscoveryUrl, (credentials, ssoProviders) => {
const success = await initializeSSO(state.application.cachedSSODiscoveryUrl, (credentials) => {
if (standalone) {
// Redirected from SSO and running in viewer mode, merge retrieved config with hardcoded credentials.
dispatch(
Expand All @@ -571,8 +518,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
config.standalonePort,
config.standaloneDatabase,
credentials.username,
credentials.password,
ssoProviders
credentials.password
)
);
dispatch(
Expand All @@ -582,8 +528,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
config.standalonePort,
config.standaloneDatabase,
credentials.username,
credentials.password,
ssoProviders
credentials.password
)
);
} else {
Expand All @@ -595,8 +540,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
state.application.connection.port,
state.application.connection.database,
credentials.username,
credentials.password,
ssoProviders
credentials.password
)
);
dispatch(setConnected(true));
Expand Down
4 changes: 2 additions & 2 deletions src/chart/ChartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function valueIsObject(value) {
}

export function toNumber(ref) {
if (ref === undefined) {
if (ref === undefined || typeof ref === 'number') {
return ref;
}
let { low, high } = ref;
Expand Down Expand Up @@ -172,7 +172,7 @@ export const downloadCSV = (rows) => {
});
csv += '\n';
});
const file = new Blob([`\ufeff${ csv}`], { type: 'text/plain;charset=utf8' });
const file = new Blob([`\ufeff${csv}`], { type: 'text/plain;charset=utf8' });
element.href = URL.createObjectURL(file);
element.download = 'table.csv';
document.body.appendChild(element); // Required for this to work in FireFox
Expand Down
10 changes: 7 additions & 3 deletions src/chart/graph/util/RecordUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { evaluateRulesOnNode, evaluateRulesOnLink } from '../../../extensions/styling/StyleRuleEvaluator';
import { extractNodePropertiesFromRecords, mergeNodePropsFieldsLists } from '../../../report/ReportRecordProcessing';
import { valueIsArray, valueIsNode, valueIsRelationship, valueIsPath } from '../../ChartUtils';
import { valueIsArray, valueIsNode, valueIsRelationship, valueIsPath, toNumber } from '../../ChartUtils';
import { GraphChartVisualizationProps } from '../GraphChartVisualization';
import { assignCurvatureToLink } from './RelUtils';
import { isNode } from 'neo4j-driver-core/lib/graph-types.js';
Expand Down Expand Up @@ -49,7 +49,9 @@ function extractGraphEntitiesFromField(
nodes[value.identity.low] = {
id: value.identity.low,
labels: value.labels,
size: value.properties[nodeSizeProperty] ? value.properties[nodeSizeProperty] : defaultNodeSize,
size: !Number.isNaN(value.properties[nodeSizeProperty])
? toNumber(value.properties[nodeSizeProperty])
: defaultNodeSize,
properties: value.properties,
mainLabel: value.labels[value.labels.length - 1],
};
Expand All @@ -67,7 +69,9 @@ function extractGraphEntitiesFromField(
source: value.start.low,
target: value.end.low,
type: value.type,
width: value.properties[relWidthProperty] ? value.properties[relWidthProperty] : defaultRelWidth,
width: !Number.isNaN(value.properties[relWidthProperty])
? toNumber(value.properties[relWidthProperty])
: defaultRelWidth,
color: value.properties[relColorProperty] ? value.properties[relColorProperty] : defaultRelColor,
properties: value.properties,
});
Expand Down
2 changes: 1 addition & 1 deletion src/component/sso/SSOUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const initializeSSO = async (cachedSSODiscoveryUrl, _setCredentials) => {
// Successful credentials retrieval.
// Log in at the Neo4j dbms now using the Neo4j (js) driver.
//
_setCredentials(credentials, mergedSSOProviders);
_setCredentials(credentials);

// Exemplifying retrieval of stored URL paramenters
_retrieveAdditionalURLParameters();
Expand Down
7 changes: 2 additions & 5 deletions src/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import NeoPage from '../page/Page';
import NeoDashboardHeader from './header/DashboardHeader';
import NeoDashboardTitle from './header/DashboardTitle';
import NeoDashboardHeaderPageList from './header/DashboardHeaderPageList';
import { Neo4jProvider } from 'use-neo4j';
import { createDriver, Neo4jProvider } from 'use-neo4j';
import { applicationGetConnection, applicationGetStandaloneSettings } from '../application/ApplicationSelectors';
import { connect } from 'react-redux';
import NeoDashboardConnectionUpdateHandler from '../component/misc/DashboardConnectionUpdateHandler';
import { forceRefreshPage } from '../page/PageActions';
import { getPageNumber } from '../settings/SettingsSelectors';
import { createNotificationThunk } from '../page/PageThunks';
import { version } from '../modal/AboutModal';
import { createDriver } from '../application/ApplicationThunks';
import NeoDashboardSidebar from './sidebar/DashboardSidebar';

const Dashboard = ({
Expand All @@ -33,10 +32,8 @@ const Dashboard = ({
connection.port,
connection.username,
connection.password,
{ userAgent: `neodash/v${version}` },
connection.ssoProviders
{ userAgent: `neodash/v${version}` }
);
// @ts-ignore wrong driver version
setDriver(newDriver);
}
const content = (
Expand Down
8 changes: 5 additions & 3 deletions src/extensions/advancedcharts/chart/gantt/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { toNumber } from '../../../../chart/ChartUtils';
import { buildGraphVisualizationObjectFromRecords } from '../../../../chart/graph/util/RecordUtils';
import date_utils from './frappe/lib/date_utils';

Expand Down Expand Up @@ -97,9 +98,9 @@ export function createTasksList(
return undefined;
}
}
return {
start: new Date(neoStartDate.year, neoStartDate.month, neoStartDate.day),
end: new Date(neoEndDate.year, neoEndDate.month, neoEndDate.day),
let res = {
start: new Date(toNumber(neoStartDate.year), toNumber(neoStartDate.month), toNumber(neoStartDate.day)),
end: new Date(toNumber(neoEndDate.year), toNumber(neoEndDate.month), toNumber(neoEndDate.day)),
name: name || '(undefined)',
labels: n.labels,
dependencies: dependencies[n.id],
Expand All @@ -112,6 +113,7 @@ export function createTasksList(
isDisabled: true,
styles: { progressColor: '#ffbb54', progressSelectedColor: '#ff9e0d' },
};
return res;
})
.filter((i) => i !== undefined);
}
2 changes: 1 addition & 1 deletion src/extensions/forms/FormsReportConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const FORMS = {
label: 'Clear parameters after submit',
type: SELECTION_TYPES.LIST,
values: [true, false],
default: false,
default: true,
},
hasResetButton: {
label: 'Has Reset Button',
Expand Down
Loading

0 comments on commit 31ccf16

Please sign in to comment.