Skip to content

Commit 5b47a54

Browse files
Merge pull request #867 from neo4j-labs/develop
Release 2.4.5
2 parents 31ccf16 + f6e2333 commit 5b47a54

19 files changed

+98
-52
lines changed

.github/workflows/master-deployment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
build: yarn run build
3333
start: yarn run dev
34-
wait-on: "http://localhost:3000"
34+
wait-on: 'http://localhost:3000'
3535
browser: chrome
3636
build-s3:
3737
needs: build-test
@@ -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.4
82+
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.4.5
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.4
106+
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.4.5
107107
deploy-gallery:
108108
runs-on: neodash-runners
109109
strategy:

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ WORKDIR /usr/local/src/neodash
1010

1111
# Copy sources and install/build
1212
COPY ./package.json /usr/local/src/neodash/package.json
13+
COPY ./yarn.lock /usr/local/src/neodash/yarn.lock
1314

1415
RUN yarn install
1516
COPY ./ /usr/local/src/neodash
@@ -43,4 +44,4 @@ USER nginx
4344
EXPOSE $NGINX_PORT
4445

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

changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## NeoDash 2.4.5
2+
This is a small release containing a few fixes:
3+
- Fixed rendering of string arrays inside tables, report titles, and report action buttons [849](https://github.com/neo4j-labs/neodash/pull/849)
4+
- Allowed text to wrap in tables, preserving the number of rows [852](https://github.com/neo4j-labs/neodash/pull/852)
5+
- Disabled auto-sorting of Cypher query-based Parameter Select ; use Cypher ORDER BY to control result order [857](https://github.com/neo4j-labs/neodash/pull/857)
6+
- Updated role selector menu, and made user updates more robust [854](https://github.com/neo4j-labs/neodash/pull/854)
7+
8+
Thanks to all the contributors for this release:
9+
- [MariusC](https://github.com/mariusconjeaud),
10+
- [LiamEdwardsLamarche](https://github.com/LiamEdwardsLamarche),
11+
- [AleSim94](https://github.com/AleSim94)
12+
113
## NeoDash 2.4.4
214
This is a hotfix release fixing some breaking issues in the 2.4.3:
315
- Fixed number parsing using newer versions of the Neo4j driver. [811](https://github.com/neo4j-labs/neodash/pull/811)

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.4 username@host:/usr/share/nginx/html
40+
scp neodash-2.4.5 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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "neodash",
3-
"version": "2.4.4",
3+
"version": "2.4.5",
44
"description": "NeoDash - Neo4j Dashboard Builder",
55
"neo4jDesktop": {
66
"apiVersion": "^1.2.0"
@@ -65,6 +65,7 @@
6565
"d3-scale-chromatic": "^3.0.0",
6666
"dayjs": "^1.11.7",
6767
"dom-to-image": "^2.6.0",
68+
"dompurify": "^3.1.0",
6869
"leaflet": "^1.7.1",
6970
"lodash.debounce": "^4.0.8",
7071
"lodash.isequal": "^4.5.0",

public/style.css

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,13 @@
125125
margin-top: -10px;
126126
}
127127

128-
.MuiDataGrid-virtualScroller {
129-
overflow-y: hidden !important;
130-
}
131-
132-
.MuiDataGrid-panel{
128+
.MuiDataGrid-panel {
133129
translate: 0px -152%;
134130
}
135131

136132
.MuiCard-root {
137-
box-shadow: 0 0 #0000,0 0 #0000,var(--tw-shadow) !important;
138-
box-shadow: var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow) !important;
133+
box-shadow: 0 0 #0000, 0 0 #0000, var(--tw-shadow) !important;
134+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
139135
}
140136

141137
.white-text {
@@ -188,7 +184,6 @@
188184
text-align: center;
189185
}
190186

191-
192187
.card-view.expanded {
193188
position: absolute;
194189
top: 0;
@@ -218,24 +213,23 @@
218213

219214
.card-view .MuiTablePagination-root {
220215
margin-top: 0px;
221-
222216
}
223217

224218
@keyframes pulse {
225-
0% {
226-
transform: scale(0.95);
227-
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
228-
}
219+
0% {
220+
transform: scale(0.95);
221+
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
222+
}
229223

230-
70% {
231-
transform: scale(1);
232-
box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
233-
}
224+
70% {
225+
transform: scale(1);
226+
box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
227+
}
234228

235-
100% {
236-
transform: scale(0.95);
237-
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
238-
}
229+
100% {
230+
transform: scale(0.95);
231+
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
232+
}
239233
}
240234

241235
/* Workaround for Needle not handling menu placement of dropdowns on modals */
@@ -247,14 +241,14 @@
247241
/* End workaround */
248242

249243
/* Workaround for cleaning the Gantt chart UI */
250-
.gantt-wrapper > div > div:first-child > div:first-child > div:first-child > div> div:not(:first-child) {
244+
.gantt-wrapper > div > div:first-child > div:first-child > div:first-child > div > div:not(:first-child) {
251245
display: none;
252246
}
253-
.gantt-wrapper > div > div > div > div> div> div> div:not(:first-child) {
247+
.gantt-wrapper > div > div > div > div > div > div > div:not(:first-child) {
254248
display: none;
255249
}
256250
/* End Gantt chart workaround */
257251

258252
.markdown-widget a {
259253
text-decoration: underline;
260-
}
254+
}

release-notes.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
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)
1+
## NeoDash 2.4.5
2+
This is a small release containing a few fixes:
3+
- Fixed rendering of string arrays inside tables, report titles, and report action buttons [849](https://github.com/neo4j-labs/neodash/pull/849)
4+
- Allowed text to wrap in tables, preserving the number of rows [852](https://github.com/neo4j-labs/neodash/pull/852)
5+
- Disabled auto-sorting of Cypher query-based Parameter Select ; use Cypher ORDER BY to control result order [857](https://github.com/neo4j-labs/neodash/pull/857)
6+
- Updated role selector menu, and made user updates more robust [854](https://github.com/neo4j-labs/neodash/pull/854)
77

8-
If you are currently using NeoDash version 2.4.3, we recommend updating as soon as possible.
8+
Thanks to all the contributors for this release:
9+
- [MariusC](https://github.com/mariusconjeaud),
10+
- [LiamEdwardsLamarche](https://github.com/LiamEdwardsLamarche),
11+
- [AleSim94](https://github.com/AleSim94)

src/chart/ChartUtils.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,14 @@ export function replaceDashboardParameters(str, parameters) {
218218
let param = _.replace(`$`, '').trim();
219219
let val = parameters?.[param] || null;
220220
let type = getRecordType(val);
221-
let valueRender = type === 'string' || type == 'link' ? val : RenderSubValue(val);
222-
return valueRender;
221+
222+
// Arrays weren't playing nicely with RenderSubValue(). Each object would be passed separately and return [oject Object].
223+
if (type === 'string' || type == 'link' ) {
224+
return val;
225+
} else if (type === 'array') {
226+
return RenderSubValue(val.join(', '));
227+
}
228+
return RenderSubValue(val);
223229
};
224230

225231
let newString = str.replace(rx, parameterElementReplacer).replace(rxSimple, parameterSimpleReplacer);

src/chart/graph/component/GraphEntityInspectionTable.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ import React from 'react';
22
import ShowMoreText from 'react-show-more-text';
33
import { Checkbox, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material';
44
import { TextLink } from '@neo4j-ndl/react';
5+
// import DOMPurify from 'dompurify';
56

67
export const formatProperty = (property) => {
7-
if (property.startsWith('http://') || property.startsWith('https://')) {
8+
const str = property?.toString() || '';
9+
if (str.startsWith('http://') || str.startsWith('https://')) {
810
return (
9-
<TextLink externalLink href={property}>
10-
{property}
11+
<TextLink externalLink href={str}>
12+
{str}
1113
</TextLink>
1214
);
1315
}
14-
return property;
16+
return str;
1517
};
1618

1719
/**
@@ -88,7 +90,7 @@ export const GraphEntityInspectionTable = ({
8890
{key}
8991
</TableCell>
9092
<TableCell align={'left'} style={{ color: tableTextColor }}>
91-
<ShowMoreText lines={2}>{formatProperty(entity && entity.properties[key].toString())}</ShowMoreText>
93+
<ShowMoreText lines={2}>{formatProperty(entity?.properties[key])}</ShowMoreText>
9294
</TableCell>
9395
{checklistEnabled ? (
9496
<TableCell align={'center'}>

src/chart/parameter/ParameterSelectionChart.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
9494
compatibilityMode={compatibilityMode}
9595
multiSelector={multiSelector}
9696
manualParameterSave={manualParameterSave}
97+
autoSort={true}
9798
/>
9899
);
99100
} else if (type == 'Relationship Property') {
@@ -112,6 +113,7 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
112113
compatibilityMode={compatibilityMode}
113114
multiSelector={multiSelector}
114115
manualParameterSave={manualParameterSave}
116+
autoSort={true}
115117
/>
116118
);
117119
} else if (type == 'Date Picker') {
@@ -147,6 +149,7 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
147149
compatibilityMode={compatibilityMode}
148150
multiSelector={multiSelector}
149151
manualParameterSave={manualParameterSave}
152+
autoSort={false}
150153
/>
151154
);
152155
}

src/chart/parameter/component/NodePropertyParameterSelect.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,14 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
165165
/>
166166
);
167167
}
168+
let options = extraRecords?.map((r) => r?._fields?.[displayValueRowIndex] || '(no data)');
169+
options = props.autoSort ? options.sort() : options;
168170
return (
169171
<div className={'n-flex n-flex-row n-flex-wrap n-items-center'}>
170172
<Autocomplete
171173
id='autocomplete'
172174
multiple={multiSelector}
173-
options={extraRecords?.map((r) => r?._fields?.[displayValueRowIndex] || '(no data)').sort()}
175+
options={options}
174176
disabled={disabled}
175177
limitTags={multiSelectLimit}
176178
style={{
@@ -198,7 +200,8 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
198200
if (autoSelectFirstValue && paramValueDisplayLocal == '') {
199201
debouncedQueryCallback(props.query, { input: '', ...allParameters }, (records) => {
200202
if (records && records.length > 0 && records[0] && records[0]._fields) {
201-
const values = records?.map((r) => r?._fields?.[displayValueRowIndex] || '(no data)').sort();
203+
let values = records?.map((r) => r?._fields?.[displayValueRowIndex] || '(no data)');
204+
values = props.autoSort ? values.sort() : values;
202205
setExtraRecords(records);
203206
propagateSelection(undefined, values[0]);
204207
}

src/chart/parameter/component/ParameterSelect.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,8 @@ export interface ParameterSelectProps {
6262
* Add the possibility for manual selection confirmation
6363
*/
6464
manualParameterSave?: boolean;
65+
/**
66+
* Pass true if results should be sorted automatically
67+
*/
68+
autoSort?: boolean;
6569
}

src/chart/parameter/component/QueryParameterSelect.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const QueryParameterSelectComponent = (props: ParameterSelectProps) => {
1717
allParameters={props.allParameters}
1818
compatibilityMode={props.compatibilityMode}
1919
multiSelector={props.multiSelector}
20+
autoSort={props.autoSort}
2021
/>
2122
);
2223
};

src/chart/table/TableChart.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function renderAsButtonWrapper(renderer) {
5050
style={{ width: '100%', marginLeft: '5px', marginRight: '5px' }}
5151
variant='contained'
5252
color='primary'
53-
>{`${outputValue}`}</Button>
53+
>{outputValue}</Button>
5454
);
5555
};
5656
}
@@ -262,7 +262,8 @@ export const NeoTableChart = (props: ChartProps) => {
262262
<DataGrid
263263
key={'tableKey'}
264264
headerHeight={32}
265-
rowHeight={tableRowHeight}
265+
density={compact ? 'compact' : 'standard'}
266+
getRowHeight={() => 'auto'}
266267
rows={rows}
267268
columns={columns}
268269
columnVisibilityModel={columnVisibilityModel}
@@ -305,6 +306,13 @@ export const NeoTableChart = (props: ChartProps) => {
305306
})
306307
.join(' ');
307308
}}
309+
sx={{
310+
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell': { py: '3px' },
311+
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell:has(button)': { py: '0px' },
312+
'&.MuiDataGrid-root--densityStandard .MuiDataGrid-cell': { py: '15px' },
313+
'&.MuiDataGrid-root--densityComfortable .MuiDataGrid-cell': { py: '22px' },
314+
'&.MuiDataGrid-root .MuiDataGrid-cell': { wordBreak: 'break-word' },
315+
}}
308316
/>
309317
</div>
310318
</ThemeProvider>

src/extensions/rbac/RBACManagementMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const RBACManagementMenu = ({ anchorEl, MenuOpen, handleClose, createNoti
6464
onClose={handleClose}
6565
size='small'
6666
>
67-
<MenuItems>
67+
<MenuItems className='n-overflow-y-scroll n-h-44'>
6868
{roles.map((role) => (
6969
<MenuItem key={role} onClick={() => handleRoleClicked(role)} icon={<UserIconOutline />} title={role} />
7070
))}

src/extensions/rbac/RBACUtils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,11 @@ export function retrieveDatabaseList(driver, setDatabases: React.Dispatch<React.
258258
export async function updateUsers(driver, currentRole, allUsers, selectedUsers, onSuccess, onFail) {
259259
// 1. Build the query that removes all users from the role.
260260
let globalStatus = -1;
261+
const escapedAllUsers = allUsers.map((user) => `\`${user}\``).join(',');
261262
await runCypherQuery(
262263
driver,
263264
'system',
264-
`REVOKE ROLE ${currentRole} FROM ${allUsers.join(',')}`,
265+
`REVOKE ROLE ${currentRole} FROM ${escapedAllUsers}`,
265266
{},
266267
1000,
267268
(status) => {
@@ -277,10 +278,11 @@ export async function updateUsers(driver, currentRole, allUsers, selectedUsers,
277278
// TODO: Neo4j is very slow in updating after the previous query, even though it is technically a finished query.
278279
// We build in an artificial delay...
279280
if (selectedUsers.length > 0) {
281+
const escapedSelectedUsers = selectedUsers.map((user) => `\`${user}\``).join(',');
280282
await runCypherQuery(
281283
driver,
282284
'system',
283-
`GRANT ROLE ${currentRole} TO ${selectedUsers.join(',')}`,
285+
`GRANT ROLE ${currentRole} TO ${escapedSelectedUsers}`,
284286
{},
285287
1000,
286288
(status) => {

src/modal/AboutModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Button, Dialog, TextLink } from '@neo4j-ndl/react';
33
import { BookOpenIconOutline, BeakerIconOutline } from '@neo4j-ndl/react/icons';
44
import { Section, SectionTitle, SectionContent } from './ModalUtils';
55

6-
export const version = '2.4.4';
6+
export const version = '2.4.5';
77

88
export const NeoAboutModal = ({ open, handleClose, getDebugState }) => {
99
const downloadDebugFile = () => {

src/report/ReportRecordProcessing.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
valueIsPath,
1111
valueIsRelationship,
1212
} from '../chart/ChartUtils';
13+
// import DOMPurify from 'dompurify';
1314

1415
/**
1516
* Collects all node labels and node properties in a set of Neo4j records.

0 commit comments

Comments
 (0)