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

Collection of bug fixes for the 2.4.2 release #744

Merged
merged 23 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
31044c1
Fixed issue where table action rule creation modal displayed invalid …
nielsdejong Jan 3, 2024
b6b36f2
Add support for links in table actions, as well as improved rendering…
nielsdejong Jan 3, 2024
78a56fd
No longer rendering empty buttons for missing values in table actions
nielsdejong Jan 3, 2024
3b71740
Fix number formatting to always use en-US locale
nielsdejong Jan 4, 2024
3f173ce
Fixed issue where dashboard database was not set correctly for share …
nielsdejong Jan 4, 2024
013344c
Fixed dashboard title visibility in sidebar
nielsdejong Jan 4, 2024
468540c
Added missing setting to pie chart configuration
nielsdejong Jan 4, 2024
3e0e1ad
Clean up code, remove old console.log statements
nielsdejong Jan 5, 2024
86dca1b
Stability and UX for table checkbox actiosn
nielsdejong Jan 10, 2024
333f9e2
Handling shared dashboards in standalone mode
nielsdejong Jan 10, 2024
17c27f6
Fixed sharing logic in both standalone and editor modes
nielsdejong Jan 10, 2024
fdc3be2
Added hidden setting for hiding the plaintext password warning. Fixed…
nielsdejong Jan 11, 2024
2cf2ade
Merge branch 'develop' into feature/2.4.2-bug-fix-collection
nielsdejong Jan 11, 2024
3cd49c5
Style tweaks for reports without footers
nielsdejong Jan 11, 2024
a803f5f
Fixed styling defaults for bar chart
nielsdejong Jan 11, 2024
2797f57
Fixed fullscreen views
nielsdejong Jan 12, 2024
21efb64
Freetext parameter with manual save style fixes
nielsdejong Jan 12, 2024
f105717
clean up graph editing modal
nielsdejong Jan 12, 2024
7f90d56
Merge branch 'develop' into feature/2.4.2-bug-fix-collection
nielsdejong Jan 12, 2024
7fd6998
Correction to release notes
nielsdejong Jan 12, 2024
080fe49
Merge branch 'develop' into feature/2.4.2-bug-fix-collection
nielsdejong Jan 12, 2024
ec7835f
Robustness of actions rule create modal
nielsdejong Jan 12, 2024
910da66
Improved comments
nielsdejong Jan 12, 2024
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
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ This is a release with a large amount of quality of life improvements, as well a
- Added parameter select setting for autopopulating first selector value. [#746](https://github.com/neo4j-labs/neodash/pull/746)
- Improved UX for editing page names & dashboard titles. [#743](https://github.com/neo4j-labs/neodash/pull/743)
- Unified common settings for each report type. [#724](https://github.com/neo4j-labs/neodash/pull/724)
- SSO auth tokens are now automatically refreshed on expiry. [#611](https://github.com/neo4j-labs/neodash/pull/611)
- Title of the browser tab NeoDash runs on is now automatically set to the dashboard name. [#708](https://github.com/neo4j-labs/neodash/pull/708)
- Fixed issue where invisible table columns were not handled correctly. [#695](https://github.com/neo4j-labs/neodash/pull/695)
- Miscellaneous bug fixes, style improvements & stability fixes. [#744](https://github.com/neo4j-labs/neodash/pull/744)


## NeoDash 2.4.1
This is a patch release following 2.4.0. It contains several new features for self-hosted (standalone) NeoDash deployments, as well as a variety of UX improvements for dashboard editors.

Expand Down
9 changes: 7 additions & 2 deletions public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
}

.react-resizable-handle {
bottom: 1px !important;
bottom: 4px !important;
right: -2px !important;
opacity: 0.5;
color: rgb(222, 222, 222);
}
Expand Down Expand Up @@ -216,7 +217,7 @@
}

.card-view .MuiTablePagination-root {
margin-top: -40px;
margin-top: 0px;

}

Expand Down Expand Up @@ -253,3 +254,7 @@
display: none;
}
/* End Gantt chart workaround */

.markdown-widget a {
text-decoration: underline;
}
1 change: 0 additions & 1 deletion release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ This is a release with a large amount of quality of life improvements, as well a
- Added parameter select setting for autopopulating first selector value. [#746](https://github.com/neo4j-labs/neodash/pull/746)
- Improved UX for editing page names & dashboard titles. [#743](https://github.com/neo4j-labs/neodash/pull/743)
- Unified common settings for each report type. [#724](https://github.com/neo4j-labs/neodash/pull/724)
- SSO auth tokens are now automatically refreshed on expiry. [#611](https://github.com/neo4j-labs/neodash/pull/611)
- Title of the browser tab NeoDash runs on is now automatically set to the dashboard name. [#708](https://github.com/neo4j-labs/neodash/pull/708)
- Fixed issue where invisible table columns were not handled correctly. [#695](https://github.com/neo4j-labs/neodash/pull/695)
- Miscellaneous bug fixes, style improvements & stability fixes. [#744](https://github.com/neo4j-labs/neodash/pull/744)
2 changes: 2 additions & 0 deletions src/application/ApplicationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export const setStandaloneEnabled = (
standaloneDashboardURL: string,
standaloneUsername: string,
standalonePassword: string,
standalonePasswordWarningHidden: boolean,
standaloneAllowLoad: boolean,
standaloneLoadFromOtherDatabases: boolean,
standaloneMultiDatabase: boolean,
Expand All @@ -167,6 +168,7 @@ export const setStandaloneEnabled = (
standaloneDashboardURL,
standaloneUsername,
standalonePassword,
standalonePasswordWarningHidden,
standaloneAllowLoad,
standaloneLoadFromOtherDatabases,
standaloneMultiDatabase,
Expand Down
2 changes: 2 additions & 0 deletions src/application/ApplicationReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
standaloneDashboardURL,
standaloneUsername,
standalonePassword,
standalonePasswordWarningHidden,
standaloneAllowLoad,
standaloneLoadFromOtherDatabases,
standaloneMultiDatabase,
Expand All @@ -211,6 +212,7 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
standaloneDashboardURL: standaloneDashboardURL,
standaloneUsername: standaloneUsername,
standalonePassword: standalonePassword,
standalonePasswordWarningHidden: standalonePasswordWarningHidden,
standaloneAllowLoad: standaloneAllowLoad,
standaloneLoadFromOtherDatabases: standaloneLoadFromOtherDatabases,
standaloneMultiDatabase: standaloneMultiDatabase,
Expand Down
1 change: 1 addition & 0 deletions src/application/ApplicationSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const applicationGetStandaloneSettings = (state: any) => {
standaloneDashboardURL: state.application.standaloneDashboardURL,
standaloneUsername: state.application.standaloneUsername,
standalonePassword: state.application.standalonePassword,
standalonePasswordWarningHidden: state.application.standalonePasswordWarningHidden,
standaloneAllowLoad: state.application.standaloneAllowLoad,
standaloneLoadFromOtherDatabases: state.application.standaloneLoadFromOtherDatabases,
standaloneMultiDatabase: state.application.standaloneMultiDatabase,
Expand Down
43 changes: 30 additions & 13 deletions src/application/ApplicationThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,26 +259,42 @@
const skipConfirmation = urlParams.get('skipConfirmation') == 'Yes';

const dashboardDatabase = urlParams.get('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 266 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 267 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 268 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 269 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 270 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 271 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.

dispatch(resetShareDetails());
dispatch(setConnectionProperties(protocol, url, port, database, username.split('@')[0], ''));
dispatch(setWelcomeScreenOpen(false));
dispatch(setConnectionModalOpen(true));
// window.history.pushState({}, document.title, "/");
return;
}
// 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.
// dispatch(setConnectionProperties(protocol, url, port, database, username.split('@')[0], ''));
// dispatch(
// setShareDetailsFromUrl(
// type,
// id,
// standalone,
// protocol,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commented code is needed?

// url,
// port,
// database,
// username.split('@')[0],
// '',
// dashboardDatabase,
// true
// )
// );
// setDashboardToLoadAfterConnecting(id);
// window.history.pushState({}, document.title, window.location.pathname);
// dispatch(setConnectionModalOpen(true));
// dispatch(setWelcomeScreenOpen(false));
// // window.history.pushState({}, document.title, "/");
// return;
// }

dispatch(setConnectionModalOpen(false));
dispatch(
Expand Down Expand Up @@ -448,6 +464,7 @@
config.standaloneDashboardURL,
config.standaloneUsername,
config.standalonePassword,
config.standalonePasswordWarningHidden,
config.standaloneAllowLoad,
config.standaloneLoadFromOtherDatabases,
config.standaloneMultiDatabase,
Expand Down Expand Up @@ -558,7 +575,7 @@
dispatch(initializeApplicationAsEditorThunk(config, paramsToSetAfterConnecting));
}
} catch (e) {
console.log(e);

Check warning on line 578 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 Expand Up @@ -605,7 +622,6 @@
(config, paramsToSetAfterConnecting) => (dispatch: any, getState: any) => {
const clearNotificationAfterLoad = true;
const state = getState();

// If we are running in standalone mode, auto-set the connection details that are configured.
dispatch(
setConnectionProperties(
Expand Down Expand Up @@ -648,4 +664,5 @@
} else {
dispatch(setConnectionModalOpen(true));
}
dispatch(handleSharedDashboardsThunk());
};
2 changes: 1 addition & 1 deletion src/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const NeoCard = ({
if (expanded) {
return (
<Dialog open={expanded} aria-labelledby='form-dialog-title' className='dialog-xxl'>
<Dialog.Content style={{ height: document.documentElement.clientHeight }}>{component}</Dialog.Content>
<Dialog.Content style={{ height: document.documentElement.clientHeight - 200 }}>{component}</Dialog.Content>
</Dialog>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/card/settings/CardSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const NeoCardSettings = ({
expanded,
onToggleCardExpand,
}) => {
const reportHeight = heightPx - CARD_HEADER_HEIGHT + 24;
const reportHeight = heightPx - CARD_HEADER_HEIGHT + 19;

const cardSettingsHeader = (
<NeoCardSettingsHeader
Expand Down
14 changes: 7 additions & 7 deletions src/card/view/CardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const NeoCardView = ({
expanded,
onToggleCardExpand,
}) => {
const reportHeight = heightPx - CARD_FOOTER_HEIGHT - CARD_HEADER_HEIGHT + 22;
const reportHeight = heightPx - CARD_FOOTER_HEIGHT - CARD_HEADER_HEIGHT + 20;
const cardHeight = heightPx - CARD_FOOTER_HEIGHT + 23;
const ref = React.useRef();

Expand Down Expand Up @@ -137,10 +137,10 @@ const NeoCardView = ({

const localParameters = { ...getLocalParameters(query), ...getLocalParameters(settings.drilldownLink) };
const reportTypes = getReportTypes(extensions);
const withoutFooter =
reportTypes[type] && reportTypes[type].withoutFooter
? reportTypes[type].withoutFooter
: (reportTypes[type] && !reportTypes[type].selection) || (settings && settings.hideSelections);
const reportTypeHasNoFooter = reportTypes[type] && reportTypes[type].withoutFooter;
const withoutFooter = reportTypeHasNoFooter
? reportTypes[type].withoutFooter
: (reportTypes[type] && !reportTypes[type].selection) || (settings && settings.hideSelections);

const getGlobalParameter = (key: string): unknown => {
return globalParameters ? globalParameters[key] : undefined;
Expand Down Expand Up @@ -170,13 +170,13 @@ const NeoCardView = ({
paddingRight: '0px',
paddingTop: '0px',
width: '100%',
marginTop: '-3px',
marginTop: '-9px',
height: expanded
? withoutFooter
? '100%'
: `calc(100% - ${CARD_FOOTER_HEIGHT}px)`
: withoutFooter
? `${reportHeight + CARD_FOOTER_HEIGHT}px`
? `${reportHeight + CARD_FOOTER_HEIGHT - (reportTypeHasNoFooter ? 0 : 20)}px`
: `${reportHeight}px`,
overflow: 'auto',
};
Expand Down
5 changes: 4 additions & 1 deletion src/chart/ChartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export function replaceDashboardParameters(str, parameters) {
let param = _.replace(`$`, '').trim();
let val = parameters?.[param] || null;
let type = getRecordType(val);
let valueRender = type === 'string' ? val : RenderSubValue(val);
let valueRender = type === 'string' || type == 'link' ? val : RenderSubValue(val);
return valueRender;
};

Expand Down Expand Up @@ -406,6 +406,9 @@ export const isEmptyObject = (obj: object) => {
* @returns True if it's an object castable to date
*/
export function isCastableToNeo4jDate(value: object) {
if (value == null || value == undefined) {
return false;
}
let keys = Object.keys(value);
return keys.length == 3 && keys.includes('day') && keys.includes('month') && keys.includes('year');
}
Expand Down
2 changes: 1 addition & 1 deletion src/chart/bar/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const NeoBarChart = (props: ChartProps) => {
const customDimensions = settings.customDimensions ? settings.customDimensions : false;
const legendWidth = settings.legendWidth ? settings.legendWidth : 128;
const marginTop = settings.marginTop ? settings.marginTop : 24;
const marginBottom = settings.marginBottom ? settings.marginBottom : 60;
const marginBottom = settings.marginBottom ? settings.marginBottom : 30;
const legend = settings.legend ? settings.legend : false;
const labelRotation = settings.labelRotation != undefined ? settings.labelRotation : 45;
const barWidth = settings.barWidth ? settings.barWidth : 10;
Expand Down
15 changes: 13 additions & 2 deletions src/chart/graph/component/GraphChartCanvas.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import React from 'react';

const canvasStyle = { paddingLeft: '10px', position: 'relative', overflow: 'hidden', width: '100%', height: '100%' };
const canvasStyle = {
paddingLeft: '10px',
marginBottom: 5,
position: 'relative',
overflow: 'hidden',
width: '100%',
height: '100%',
};

/**
* Renders the canvas on which the graph visualization is projected.
*/
export const NeoGraphChartCanvas = ({ children }) => {
return <div style={canvasStyle}>{children}</div>;
return (
<div className='graph-chart-canvas' style={canvasStyle}>
{children}
</div>
);
};
1 change: 0 additions & 1 deletion src/chart/graph/component/GraphChartEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export const GraphChartEditModal = (props: GraphChartEditorVisualizationProps) =
</tr>
</tbody>
</table>
<hr />
<Button
key={'btnEditProp'}
style={{ marginBottom: '10px' }}
Expand Down
5 changes: 4 additions & 1 deletion src/chart/markdown/MarkdownChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const NeoMarkdownChart = (props: ChartProps) => {
const modifiedMarkdown = replaceGlobalParameters ? replaceDashboardParameters(markdown, parameters) : markdown;
// TODO: we should check if the gfm plugin has an impact on the standard security provided by ReactMarkdown
return (
<div style={{ marginTop: '0px', marginLeft: '15px', marginRight: '15px', marginBottom: '0px' }}>
<div
className='markdown-widget'
style={{ marginTop: '0px', marginLeft: '15px', marginRight: '15px', marginBottom: '0px' }}
>
<base target='_blank' /> <ReactMarkdown remarkPLugins={[gfm]} children={modifiedMarkdown} />
</div>
);
Expand Down
6 changes: 5 additions & 1 deletion src/chart/parameter/component/FreeTextParameterSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ const FreeTextParameterSelectComponent = (props: ParameterSelectProps) => {
}}
/>
{manualParameterSave ? <SelectionConfirmationButton onClick={() => manualHandleParametersUpdate()} /> : <></>}
{running ? <CircularProgress size={18} style={{ position: 'absolute', right: '20px' }} /> : <></>}
{running && !manualParameterSave ? (
<CircularProgress size={18} style={{ position: 'absolute', right: '20px' }} />
) : (
<></>
)}
</div>
);
};
Expand Down
14 changes: 10 additions & 4 deletions src/chart/table/TableChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@ const fallbackRenderer = (value) => {

function renderAsButtonWrapper(renderer) {
return function renderAsButton(value) {
const outputValue = renderer(value, true);
// If there's nothing to be rendered, there's no button needed.
if (outputValue == '') {
return <></>;
}
return (
<Button
style={{ width: '100%', marginLeft: '5px', marginRight: '5px' }}
variant='contained'
color='primary'
>{`${renderer(value)}`}</Button>
>{`${outputValue}`}</Button>
);
};
}
Expand Down Expand Up @@ -107,8 +112,7 @@ export const NeoTableChart = (props: ChartProps) => {
return key != 'id' ? key : `${key} `;
};

const actionableFields = actionsRules.map((r) => r.field);

const actionableFields = actionsRules.filter((r) => r.condition !== 'rowCheck').map((r) => r.field);
const columns = transposed
? [records[0].keys[0]].concat(records.map((record) => record._fields[0]?.toString() || '')).map((key, i) => {
const uniqueKey = `${String(key)}_${i}`;
Expand All @@ -126,7 +130,9 @@ export const NeoTableChart = (props: ChartProps) => {
actionableFields.includes(key)
);
})
: records[0].keys.map((key, i) => {
: records[0] &&
records[0].keys &&
records[0].keys.map((key, i) => {
const value = records[0].get(key);
if (columnWidthsType == 'Relative (%)') {
return ApplyColumnType(
Expand Down
2 changes: 1 addition & 1 deletion src/config/ReportConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ const _REPORT_TYPES = {
marginBottom: {
label: 'Margin Bottom',
type: SELECTION_TYPES.NUMBER,
default: 45,
default: 30,
},
legendWidth: {
label: 'Legend Width',
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const Dashboard = ({
);
setDriver(newDriver);
}

const content = (
<Neo4jProvider driver={driver}>
<NeoDashboardConnectionUpdateHandler
Expand Down Expand Up @@ -81,7 +80,8 @@ const Dashboard = ({
{/* The main content of the page */}

<div>
{standaloneSettings.standalonePassword ? (
{standaloneSettings.standalonePassword &&
standaloneSettings.standalonePasswordWarningHidden !== true ? (
<div style={{ textAlign: 'center', color: 'red', paddingTop: 60, marginBottom: -50 }}>
Warning: NeoDash is running with a plaintext password in config.json.
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/DashboardThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ export const loadDashboardFromNeo4jByNameThunk =
if (records.length == 0) {
dispatch(
createNotificationThunk(
'Unable to load dashboard.',
`Unable to load dashboard "${name}".`,
'A dashboard with the provided name could not be found.'
)
);
Expand All @@ -429,7 +429,7 @@ export const loadDashboardFromNeo4jByNameThunk =
}

if (records[0].error) {
dispatch(createNotificationThunk('Unable to load dashboard.', records[0].error));
dispatch(createNotificationThunk(`Unable to load dashboard "${name}".`, records[0].error));
if (loggingSettings.loggingMode > '1') {
dispatch(
createLogThunk(
Expand Down
Loading
Loading