Skip to content

Commit 2fc0983

Browse files
nielsdejongmariusconjeaudMarius Conjeaud
authored
2.4.6 Release (#878)
* Make wrapping in table optional, enabled by default (#872) * Make wrapping in table optional, enabled by default * Make wrapping disabled by default --------- Co-authored-by: Marius Conjeaud <[email protected]> * Fix bad wrapping for arrays (#868) * Fix bad wrapping for arrays * Add space for array display --------- Co-authored-by: Marius Conjeaud <[email protected]> * Fixed issues where cross database dashboard sharing always reverted back to the default database (#873) * Fixed issues where cross database dashboard sharing always reverted back to the default database * Fix code smell from SonarQube * Added option to define style config using environment variables for the NeoDash docker image (#876) * Added release notes for 2.4.6 (#877) * Added release notes for 2.4.6 * Removed one PR from the release notes * Fixed typo in release notes --------- Co-authored-by: MariusC <[email protected]> Co-authored-by: Marius Conjeaud <[email protected]>
1 parent 5b47a54 commit 2fc0983

File tree

14 files changed

+126
-84
lines changed

14 files changed

+126
-84
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.5
82+
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.4.6
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.5
106+
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.4.6
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
@@ -44,4 +44,4 @@ USER nginx
4444
EXPOSE $NGINX_PORT
4545

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

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## NeoDash 2.4.6
2+
This is a minor release containing a few critical fixes and some extra style customizations:
3+
4+
- Fix bad text wrapping for arrays in tables ([868](https://github.com/neo4j-labs/neodash/pull/868)).
5+
- Make wrapping in table optional, disabled by default ([872](https://github.com/neo4j-labs/neodash/pull/872)).
6+
- Fixed issues where cross database dashboard sharing always reverted back to the default database ([873](https://github.com/neo4j-labs/neodash/pull/873)).
7+
- Added option to define style config using environment variables for the Docker image ([876](https://github.com/neo4j-labs/neodash/pull/876)).
8+
19
## NeoDash 2.4.5
210
This is a small release containing a few fixes:
311
- Fixed rendering of string arrays inside tables, report titles, and report action buttons [849](https://github.com/neo4j-labs/neodash/pull/849)

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.5 username@host:/usr/share/nginx/html
40+
scp neodash-2.4.6 username@host:/usr/share/nginx/html
4141
```
4242

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

docs/modules/ROOT/pages/developer-guide/style-configuration.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ link:https://cdn.jsdelivr.net/npm/@neo4j-ndl/[email protected]/lib/tokens/css/tokens.cs
66

77
For a simple (non-Dockerized) deployment, these configuration parameters
88
can be changed by modifying `dist/style.config.json` after you have built the
9-
application. When Docker image, these can not be passed as environment
10-
variables.
9+
application. When using the NeoDash Docker image, these can be passed as environment
10+
variables. For example:
1111

12+
....
13+
docker run -p 5005:5005 \
14+
-e DASHBOARD_HEADER_BRAND_LOGO=https://picsum.photos/500/100 \
15+
neo4jlabs/neodash
16+
....
17+
1218
An example configuration for NeoDash
1319

1420
....

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "neodash",
3-
"version": "2.4.5",
3+
"version": "2.4.6",
44
"description": "NeoDash - Neo4j Dashboard Builder",
55
"neo4jDesktop": {
66
"apiVersion": "^1.2.0"

release-notes.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
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)
1+
## NeoDash 2.4.6
2+
This is a minor release containing a few critical fixes and some extra style customizations:
73

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)
4+
- Fix bad text wrapping for arrays in tables ([868](https://github.com/neo4j-labs/neodash/pull/868)).
5+
- Make wrapping in table optional, disabled by default ([872](https://github.com/neo4j-labs/neodash/pull/872)).
6+
- Fixed issues where cross database dashboard sharing always reverted back to the default database ([873](https://github.com/neo4j-labs/neodash/pull/873)).
7+
- Added option to define style config using environment variables for the Docker image ([876](https://github.com/neo4j-labs/neodash/pull/876)).

scripts/config-entrypoint.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,17 @@ echo " \
2727
\"customHeader\": \"${customHeader:=}\" \
2828
}" > /usr/share/nginx/html/config.json
2929

30-
echo "${styleConfigJson:={\}}" > /usr/share/nginx/html/style.config.json
30+
echo " \
31+
{ \
32+
\"DASHBOARD_HEADER_BRAND_LOGO\": \"${DASHBOARD_HEADER_BRAND_LOGO:=}\", \
33+
\"DASHBOARD_HEADER_COLOR\" : \"${DASHBOARD_HEADER_COLOR:=}\", \
34+
\"DASHBOARD_HEADER_BUTTON_COLOR\" : \"${DASHBOARD_HEADER_BUTTON_COLOR:=}\", \
35+
\"DASHBOARD_HEADER_TITLE_COLOR\" : \"${DASHBOARD_HEADER_TITLE_COLOR:=}\", \
36+
\"DASHBOARD_PAGE_LIST_COLOR\" : \"${DASHBOARD_PAGE_LIST_COLOR:=}\", \
37+
\"DASHBOARD_PAGE_LIST_ACTIVE_COLOR\": \"${DASHBOARD_PAGE_LIST_ACTIVE_COLOR:=}\", \
38+
\"style\": { \
39+
\"--palette-light-neutral-bg-weak\": \"${STYLE_PALETTE_LIGHT_NEUTRAL_BG_WEAK:=}\" \
40+
} \
41+
}" > /usr/share/nginx/html/style.config.json
42+
43+

src/application/ApplicationActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export const setStandaloneEnabled = (
178178

179179
export const SET_STANDALONE_MODE = 'APPLICATION/SET_STANDALONE_MODE';
180180
export const setStandaloneMode = (standalone: boolean) => ({
181-
type: SET_STANDALONE_ENABLED,
181+
type: SET_STANDALONE_MODE,
182182
payload: { standalone },
183183
});
184184

src/application/ApplicationThunks.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ export const handleSharedDashboardsThunk = () => (dispatch: any) => {
259259
const skipConfirmation = urlParams.get('skipConfirmation') == 'Yes';
260260

261261
const dashboardDatabase = urlParams.get('dashboardDatabase');
262-
dispatch(setStandaloneDashboardDatabase(dashboardDatabase));
262+
if (dashboardDatabase) {
263+
dispatch(setStandaloneDashboardDatabase(dashboardDatabase));
264+
}
265+
263266
if (urlParams.get('credentials')) {
264267
setWelcomeScreenOpen(false);
265268
const connection = decodeURIComponent(urlParams.get('credentials'));
@@ -363,6 +366,8 @@ export const onConfirmLoadSharedDashboardThunk = () => (dispatch: any, getState:
363366

364367
if (shareDetails.dashboardDatabase) {
365368
dispatch(setStandaloneDashboardDatabase(shareDetails.dashboardDatabase));
369+
} else if (!state.application.standaloneDashboardDatabase) {
370+
// No standalone dashboard database configured, fall back to default
366371
dispatch(setStandaloneDashboardDatabase(shareDetails.database));
367372
}
368373
if (shareDetails.url) {
@@ -452,6 +457,9 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
452457
dispatch(setSSOProviders(config.ssoProviders));
453458

454459
const { standalone } = config;
460+
// if a dashboard database was previously set, remember to use it.
461+
const dashboardDatabase = state.application.standaloneDashboardDatabase;
462+
455463
dispatch(
456464
setStandaloneEnabled(
457465
standalone,
@@ -460,7 +468,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
460468
config.standalonePort,
461469
config.standaloneDatabase,
462470
config.standaloneDashboardName,
463-
config.standaloneDashboardDatabase,
471+
dashboardDatabase || config.standaloneDashboardDatabase,
464472
config.standaloneDashboardURL,
465473
config.standaloneUsername,
466474
config.standalonePassword,

src/chart/table/TableChart.tsx

Lines changed: 62 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ function renderAsButtonWrapper(renderer) {
4646
return <></>;
4747
}
4848
return (
49-
<Button
50-
style={{ width: '100%', marginLeft: '5px', marginRight: '5px' }}
51-
variant='contained'
52-
color='primary'
53-
>{outputValue}</Button>
49+
<Button style={{ width: '100%', marginLeft: '5px', marginRight: '5px' }} variant='contained' color='primary'>
50+
{outputValue}
51+
</Button>
5452
);
5553
};
5654
}
@@ -73,6 +71,7 @@ export const generateSafeColumnKey = (key) => {
7371

7472
export const NeoTableChart = (props: ChartProps) => {
7573
const transposed = props.settings && props.settings.transposed ? props.settings.transposed : false;
74+
const wrapContent = props.settings && props.settings.wrapContent ? props.settings.wrapContent : false;
7675
const allowDownload =
7776
props.settings && props.settings.allowDownload !== undefined ? props.settings.allowDownload : false;
7877

@@ -214,6 +213,49 @@ export const NeoTableChart = (props: ChartProps) => {
214213
: Math.floor(availableRowHeight) - pageSizeReducer;
215214

216215
const pageNames = getPageNumbersAndNamesList();
216+
const commonGridProps = {
217+
key: 'tableKey',
218+
headerHeight: 32,
219+
density: compact ? 'compact' : 'standard',
220+
rows: rows,
221+
columns: columns,
222+
columnVisibilityModel: columnVisibilityModel,
223+
onColumnVisibilityModelChange: (newModel) => setColumnVisibilityModel(newModel),
224+
onCellClick: (e) => performActionOnElement(e, actionsRules, { ...props, pageNames: pageNames }, 'Click', 'Table'),
225+
onCellDoubleClick: (e) => {
226+
let rules = getRule(e, actionsRules, 'doubleClick');
227+
if (rules !== null) {
228+
rules.forEach((rule) => executeActionRule(rule, e, { ...props, pageNames: pageNames }, 'table'));
229+
} else {
230+
setNotificationOpen(true);
231+
navigator.clipboard.writeText(e.value);
232+
}
233+
},
234+
checkboxSelection: hasCheckboxes(actionsRules),
235+
selectionModel: getCheckboxes(actionsRules, rows, props.getGlobalParameter),
236+
onSelectionModelChange: (selection) => updateCheckBoxes(actionsRules, rows, selection, props.setGlobalParameter),
237+
pageSize: tablePageSize > 0 ? tablePageSize : 5,
238+
rowsPerPageOptions: rows.length < 5 ? [rows.length, 5] : [5],
239+
disableSelectionOnClick: true,
240+
components: {
241+
ColumnSortedDescendingIcon: () => <></>,
242+
ColumnSortedAscendingIcon: () => <></>,
243+
},
244+
getRowClassName: (params) => {
245+
return ['row color', 'row text color']
246+
.map((e) => {
247+
return `rule${evaluateRulesOnDict(params.row, styleRules, [e])}`;
248+
})
249+
.join(' ');
250+
},
251+
getCellClassName: (params) => {
252+
return ['cell color', 'cell text color']
253+
.map((e) => {
254+
return `rule${evaluateRulesOnDict({ [params.field]: params.value }, styleRules, [e])}`;
255+
})
256+
.join(' ');
257+
},
258+
};
217259

218260
return (
219261
<ThemeProvider theme={theme}>
@@ -259,61 +301,21 @@ export const NeoTableChart = (props: ChartProps) => {
259301
<></>
260302
)}
261303

262-
<DataGrid
263-
key={'tableKey'}
264-
headerHeight={32}
265-
density={compact ? 'compact' : 'standard'}
266-
getRowHeight={() => 'auto'}
267-
rows={rows}
268-
columns={columns}
269-
columnVisibilityModel={columnVisibilityModel}
270-
onColumnVisibilityModelChange={(newModel) => setColumnVisibilityModel(newModel)}
271-
onCellClick={(e) =>
272-
performActionOnElement(e, actionsRules, { ...props, pageNames: pageNames }, 'Click', 'Table')
273-
}
274-
onCellDoubleClick={(e) => {
275-
let rules = getRule(e, actionsRules, 'doubleClick');
276-
if (rules !== null) {
277-
rules.forEach((rule) => executeActionRule(rule, e, { ...props, pageNames: pageNames }, 'table'));
278-
} else {
279-
setNotificationOpen(true);
280-
navigator.clipboard.writeText(e.value);
281-
}
282-
}}
283-
checkboxSelection={hasCheckboxes(actionsRules)}
284-
selectionModel={getCheckboxes(actionsRules, rows, props.getGlobalParameter)}
285-
onSelectionModelChange={(selection) =>
286-
updateCheckBoxes(actionsRules, rows, selection, props.setGlobalParameter)
287-
}
288-
pageSize={tablePageSize > 0 ? tablePageSize : 5}
289-
rowsPerPageOptions={rows.length < 5 ? [rows.length, 5] : [5]}
290-
disableSelectionOnClick
291-
components={{
292-
ColumnSortedDescendingIcon: () => <></>,
293-
ColumnSortedAscendingIcon: () => <></>,
294-
}}
295-
getRowClassName={(params) => {
296-
return ['row color', 'row text color']
297-
.map((e) => {
298-
return `rule${evaluateRulesOnDict(params.row, styleRules, [e])}`;
299-
})
300-
.join(' ');
301-
}}
302-
getCellClassName={(params) => {
303-
return ['cell color', 'cell text color']
304-
.map((e) => {
305-
return `rule${evaluateRulesOnDict({ [params.field]: params.value }, styleRules, [e])}`;
306-
})
307-
.join(' ');
308-
}}
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-
}}
316-
/>
304+
{wrapContent ? (
305+
<DataGrid
306+
{...commonGridProps}
307+
getRowHeight={() => 'auto'}
308+
sx={{
309+
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell': { py: '3px' },
310+
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell:has(button)': { py: '0px' },
311+
'&.MuiDataGrid-root--densityStandard .MuiDataGrid-cell': { py: '15px' },
312+
'&.MuiDataGrid-root--densityComfortable .MuiDataGrid-cell': { py: '22px' },
313+
'&.MuiDataGrid-root .MuiDataGrid-cell': { wordBreak: 'break-word' },
314+
}}
315+
/>
316+
) : (
317+
<DataGrid {...commonGridProps} rowHeight={tableRowHeight} />
318+
)}
317319
</div>
318320
</ThemeProvider>
319321
);

src/config/ReportConfig.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ const _REPORT_TYPES = {
4646
values: [true, false],
4747
default: false,
4848
},
49+
wrapContent: {
50+
label: 'Wrap overflowing content',
51+
type: SELECTION_TYPES.LIST,
52+
values: [true, false],
53+
default: false,
54+
},
4955
columnWidthsType: {
5056
label: 'Column Widths Specification',
5157
type: SELECTION_TYPES.LIST,

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.5';
6+
export const version = '2.4.6';
77

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

src/report/ReportRecordProcessing.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,15 @@ function RenderPath(value) {
247247
}
248248

249249
function RenderArray(value) {
250+
if (value.length > 0 && !valueIsNode(value[0]) && !valueIsRelationship(value[0])) {
251+
return RenderString(value.join(', '));
252+
}
250253
const mapped = value.map((v, i) => {
251254
return (
252-
<div key={String(`k${i}`) + v}>
255+
<span key={String(`k${i}`) + v}>
253256
{RenderSubValue(v)}
254257
{i < value.length - 1 && !valueIsNode(v) && !valueIsRelationship(v) ? <span>,&nbsp;</span> : <></>}
255-
</div>
258+
</span>
256259
);
257260
});
258261
return mapped;

0 commit comments

Comments
 (0)