Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4.6 Release #878

Merged
merged 5 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.5
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.4.6
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.5
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.4.6
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 @@ -44,4 +44,4 @@ USER nginx
EXPOSE $NGINX_PORT

HEALTHCHECK cmd curl --fail "http://localhost:$NGINX_PORT" || exit 1
LABEL version="2.4.5"
LABEL version="2.4.6"
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## NeoDash 2.4.6
This is a minor release containing a few critical fixes and some extra style customizations:

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

## NeoDash 2.4.5
This is a small release containing a few fixes:
- Fixed rendering of string arrays inside tables, report titles, and report action buttons [849](https://github.com/neo4j-labs/neodash/pull/849)
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.5 username@host:/usr/share/nginx/html
scp neodash-2.4.6 username@host:/usr/share/nginx/html
```

NeoDash should now be visible by visiting your (sub)domain in the browser.
Expand Down
10 changes: 8 additions & 2 deletions docs/modules/ROOT/pages/developer-guide/style-configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ link:https://cdn.jsdelivr.net/npm/@neo4j-ndl/[email protected]/lib/tokens/css/tokens.cs

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

....
docker run -p 5005:5005 \
-e DASHBOARD_HEADER_BRAND_LOGO=https://picsum.photos/500/100 \
neo4jlabs/neodash
....

An example configuration for NeoDash

....
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neodash",
"version": "2.4.5",
"version": "2.4.6",
"description": "NeoDash - Neo4j Dashboard Builder",
"neo4jDesktop": {
"apiVersion": "^1.2.0"
Expand Down
16 changes: 6 additions & 10 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
## NeoDash 2.4.5
This is a small release containing a few fixes:
- Fixed rendering of string arrays inside tables, report titles, and report action buttons [849](https://github.com/neo4j-labs/neodash/pull/849)
- Allowed text to wrap in tables, preserving the number of rows [852](https://github.com/neo4j-labs/neodash/pull/852)
- 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)
- Updated role selector menu, and made user updates more robust [854](https://github.com/neo4j-labs/neodash/pull/854)
## NeoDash 2.4.6
This is a minor release containing a few critical fixes and some extra style customizations:

Thanks to all the contributors for this release:
- [MariusC](https://github.com/mariusconjeaud),
- [LiamEdwardsLamarche](https://github.com/LiamEdwardsLamarche),
- [AleSim94](https://github.com/AleSim94)
- Fix bad text wrapping for arrays in tables ([868](https://github.com/neo4j-labs/neodash/pull/868)).
- Make wrapping in table optional, disabled by default ([872](https://github.com/neo4j-labs/neodash/pull/872)).
- Fixed issues where cross database dashboard sharing always reverted back to the default database ([873](https://github.com/neo4j-labs/neodash/pull/873)).
- Added option to define style config using environment variables for the Docker image ([876](https://github.com/neo4j-labs/neodash/pull/876)).
15 changes: 14 additions & 1 deletion scripts/config-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,17 @@ echo " \
\"customHeader\": \"${customHeader:=}\" \
}" > /usr/share/nginx/html/config.json

echo "${styleConfigJson:={\}}" > /usr/share/nginx/html/style.config.json
echo " \
{ \
\"DASHBOARD_HEADER_BRAND_LOGO\": \"${DASHBOARD_HEADER_BRAND_LOGO:=}\", \
\"DASHBOARD_HEADER_COLOR\" : \"${DASHBOARD_HEADER_COLOR:=}\", \
\"DASHBOARD_HEADER_BUTTON_COLOR\" : \"${DASHBOARD_HEADER_BUTTON_COLOR:=}\", \
\"DASHBOARD_HEADER_TITLE_COLOR\" : \"${DASHBOARD_HEADER_TITLE_COLOR:=}\", \
\"DASHBOARD_PAGE_LIST_COLOR\" : \"${DASHBOARD_PAGE_LIST_COLOR:=}\", \
\"DASHBOARD_PAGE_LIST_ACTIVE_COLOR\": \"${DASHBOARD_PAGE_LIST_ACTIVE_COLOR:=}\", \
\"style\": { \
\"--palette-light-neutral-bg-weak\": \"${STYLE_PALETTE_LIGHT_NEUTRAL_BG_WEAK:=}\" \
} \
}" > /usr/share/nginx/html/style.config.json


2 changes: 1 addition & 1 deletion src/application/ApplicationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const setStandaloneEnabled = (

export const SET_STANDALONE_MODE = 'APPLICATION/SET_STANDALONE_MODE';
export const setStandaloneMode = (standalone: boolean) => ({
type: SET_STANDALONE_ENABLED,
type: SET_STANDALONE_MODE,
payload: { standalone },
});

Expand Down
12 changes: 10 additions & 2 deletions src/application/ApplicationThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,19 @@
const skipConfirmation = urlParams.get('skipConfirmation') == 'Yes';

const dashboardDatabase = urlParams.get('dashboardDatabase');
dispatch(setStandaloneDashboardDatabase(dashboardDatabase));
if (dashboardDatabase) {
dispatch(setStandaloneDashboardDatabase(dashboardDatabase));
}

if (urlParams.get('credentials')) {
setWelcomeScreenOpen(false);
const connection = decodeURIComponent(urlParams.get('credentials'));
const protocol = connection.split('://')[0];

Check warning on line 269 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring

Check warning on line 269 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring
const username = connection.split('://')[1].split(':')[0];

Check warning on line 270 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring

Check warning on line 270 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring
const password = connection.split('://')[1].split(':')[1].split('@')[0];

Check warning on line 271 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring

Check warning on line 271 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring
const database = connection.split('@')[1].split(':')[0];

Check warning on line 272 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring

Check warning on line 272 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring
const url = connection.split('@')[1].split(':')[1];

Check warning on line 273 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring

Check warning on line 273 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring
const port = connection.split('@')[1].split(':')[2];

Check warning on line 274 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring

Check warning on line 274 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Use array destructuring
// if (url == password) {
// // Special case where a connect link is generated without a password.
// // Here, the format is parsed incorrectly and we open the connection window instead.
Expand Down Expand Up @@ -363,6 +366,8 @@

if (shareDetails.dashboardDatabase) {
dispatch(setStandaloneDashboardDatabase(shareDetails.dashboardDatabase));
} else if (!state.application.standaloneDashboardDatabase) {
// No standalone dashboard database configured, fall back to default
dispatch(setStandaloneDashboardDatabase(shareDetails.database));
}
if (shareDetails.url) {
Expand Down Expand Up @@ -452,6 +457,9 @@
dispatch(setSSOProviders(config.ssoProviders));

const { standalone } = config;
// if a dashboard database was previously set, remember to use it.
const dashboardDatabase = state.application.standaloneDashboardDatabase;

dispatch(
setStandaloneEnabled(
standalone,
Expand All @@ -460,7 +468,7 @@
config.standalonePort,
config.standaloneDatabase,
config.standaloneDashboardName,
config.standaloneDashboardDatabase,
dashboardDatabase || config.standaloneDashboardDatabase,
config.standaloneDashboardURL,
config.standaloneUsername,
config.standalonePassword,
Expand Down Expand Up @@ -575,7 +583,7 @@
dispatch(initializeApplicationAsEditorThunk(config, paramsToSetAfterConnecting));
}
} catch (e) {
console.log(e);

Check warning on line 586 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Unexpected console statement

Check warning on line 586 in src/application/ApplicationThunks.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Unexpected console statement
dispatch(setWelcomeScreenOpen(false));
dispatch(
createNotificationThunk(
Expand Down
122 changes: 62 additions & 60 deletions src/chart/table/TableChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ function renderAsButtonWrapper(renderer) {
return <></>;
}
return (
<Button
style={{ width: '100%', marginLeft: '5px', marginRight: '5px' }}
variant='contained'
color='primary'
>{outputValue}</Button>
<Button style={{ width: '100%', marginLeft: '5px', marginRight: '5px' }} variant='contained' color='primary'>
{outputValue}
</Button>
);
};
}
Expand All @@ -73,6 +71,7 @@ export const generateSafeColumnKey = (key) => {

export const NeoTableChart = (props: ChartProps) => {
const transposed = props.settings && props.settings.transposed ? props.settings.transposed : false;
const wrapContent = props.settings && props.settings.wrapContent ? props.settings.wrapContent : false;
const allowDownload =
props.settings && props.settings.allowDownload !== undefined ? props.settings.allowDownload : false;

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

const pageNames = getPageNumbersAndNamesList();
const commonGridProps = {
key: 'tableKey',
headerHeight: 32,
density: compact ? 'compact' : 'standard',
rows: rows,
columns: columns,
columnVisibilityModel: columnVisibilityModel,
onColumnVisibilityModelChange: (newModel) => setColumnVisibilityModel(newModel),
onCellClick: (e) => performActionOnElement(e, actionsRules, { ...props, pageNames: pageNames }, 'Click', 'Table'),
onCellDoubleClick: (e) => {
let rules = getRule(e, actionsRules, 'doubleClick');
if (rules !== null) {
rules.forEach((rule) => executeActionRule(rule, e, { ...props, pageNames: pageNames }, 'table'));
} else {
setNotificationOpen(true);
navigator.clipboard.writeText(e.value);
}
},
checkboxSelection: hasCheckboxes(actionsRules),
selectionModel: getCheckboxes(actionsRules, rows, props.getGlobalParameter),
onSelectionModelChange: (selection) => updateCheckBoxes(actionsRules, rows, selection, props.setGlobalParameter),
pageSize: tablePageSize > 0 ? tablePageSize : 5,
rowsPerPageOptions: rows.length < 5 ? [rows.length, 5] : [5],
disableSelectionOnClick: true,
components: {
ColumnSortedDescendingIcon: () => <></>,
ColumnSortedAscendingIcon: () => <></>,
},
getRowClassName: (params) => {
return ['row color', 'row text color']
.map((e) => {
return `rule${evaluateRulesOnDict(params.row, styleRules, [e])}`;
})
.join(' ');
},
getCellClassName: (params) => {
return ['cell color', 'cell text color']
.map((e) => {
return `rule${evaluateRulesOnDict({ [params.field]: params.value }, styleRules, [e])}`;
})
.join(' ');
},
};

return (
<ThemeProvider theme={theme}>
Expand Down Expand Up @@ -259,61 +301,21 @@ export const NeoTableChart = (props: ChartProps) => {
<></>
)}

<DataGrid
key={'tableKey'}
headerHeight={32}
density={compact ? 'compact' : 'standard'}
getRowHeight={() => 'auto'}
rows={rows}
columns={columns}
columnVisibilityModel={columnVisibilityModel}
onColumnVisibilityModelChange={(newModel) => setColumnVisibilityModel(newModel)}
onCellClick={(e) =>
performActionOnElement(e, actionsRules, { ...props, pageNames: pageNames }, 'Click', 'Table')
}
onCellDoubleClick={(e) => {
let rules = getRule(e, actionsRules, 'doubleClick');
if (rules !== null) {
rules.forEach((rule) => executeActionRule(rule, e, { ...props, pageNames: pageNames }, 'table'));
} else {
setNotificationOpen(true);
navigator.clipboard.writeText(e.value);
}
}}
checkboxSelection={hasCheckboxes(actionsRules)}
selectionModel={getCheckboxes(actionsRules, rows, props.getGlobalParameter)}
onSelectionModelChange={(selection) =>
updateCheckBoxes(actionsRules, rows, selection, props.setGlobalParameter)
}
pageSize={tablePageSize > 0 ? tablePageSize : 5}
rowsPerPageOptions={rows.length < 5 ? [rows.length, 5] : [5]}
disableSelectionOnClick
components={{
ColumnSortedDescendingIcon: () => <></>,
ColumnSortedAscendingIcon: () => <></>,
}}
getRowClassName={(params) => {
return ['row color', 'row text color']
.map((e) => {
return `rule${evaluateRulesOnDict(params.row, styleRules, [e])}`;
})
.join(' ');
}}
getCellClassName={(params) => {
return ['cell color', 'cell text color']
.map((e) => {
return `rule${evaluateRulesOnDict({ [params.field]: params.value }, styleRules, [e])}`;
})
.join(' ');
}}
sx={{
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell': { py: '3px' },
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell:has(button)': { py: '0px' },
'&.MuiDataGrid-root--densityStandard .MuiDataGrid-cell': { py: '15px' },
'&.MuiDataGrid-root--densityComfortable .MuiDataGrid-cell': { py: '22px' },
'&.MuiDataGrid-root .MuiDataGrid-cell': { wordBreak: 'break-word' },
}}
/>
{wrapContent ? (
<DataGrid
{...commonGridProps}
getRowHeight={() => 'auto'}
sx={{
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell': { py: '3px' },
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell:has(button)': { py: '0px' },
'&.MuiDataGrid-root--densityStandard .MuiDataGrid-cell': { py: '15px' },
'&.MuiDataGrid-root--densityComfortable .MuiDataGrid-cell': { py: '22px' },
'&.MuiDataGrid-root .MuiDataGrid-cell': { wordBreak: 'break-word' },
}}
/>
) : (
<DataGrid {...commonGridProps} rowHeight={tableRowHeight} />
)}
</div>
</ThemeProvider>
);
Expand Down
6 changes: 6 additions & 0 deletions src/config/ReportConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ const _REPORT_TYPES = {
values: [true, false],
default: false,
},
wrapContent: {
label: 'Wrap overflowing content',
type: SELECTION_TYPES.LIST,
values: [true, false],
default: false,
},
columnWidthsType: {
label: 'Column Widths Specification',
type: SELECTION_TYPES.LIST,
Expand Down
2 changes: 1 addition & 1 deletion src/modal/AboutModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button, Dialog, TextLink } from '@neo4j-ndl/react';
import { BookOpenIconOutline, BeakerIconOutline } from '@neo4j-ndl/react/icons';
import { Section, SectionTitle, SectionContent } from './ModalUtils';

export const version = '2.4.5';
export const version = '2.4.6';

export const NeoAboutModal = ({ open, handleClose, getDebugState }) => {
const downloadDebugFile = () => {
Expand Down
7 changes: 5 additions & 2 deletions src/report/ReportRecordProcessing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,15 @@ function RenderPath(value) {
}

function RenderArray(value) {
if (value.length > 0 && !valueIsNode(value[0]) && !valueIsRelationship(value[0])) {
return RenderString(value.join(', '));
}
const mapped = value.map((v, i) => {
return (
<div key={String(`k${i}`) + v}>
<span key={String(`k${i}`) + v}>
{RenderSubValue(v)}
{i < value.length - 1 && !valueIsNode(v) && !valueIsRelationship(v) ? <span>,&nbsp;</span> : <></>}
</div>
</span>
);
});
return mapped;
Expand Down
Loading