Skip to content

Commit fdc3be2

Browse files
committed
Added hidden setting for hiding the plaintext password warning. Fixed issue with casting null dates
1 parent 17c27f6 commit fdc3be2

File tree

6 files changed

+11
-3
lines changed

6 files changed

+11
-3
lines changed

src/application/ApplicationActions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export const setStandaloneEnabled = (
150150
standaloneDashboardURL: string,
151151
standaloneUsername: string,
152152
standalonePassword: string,
153+
standalonePasswordWarningHidden: boolean,
153154
standaloneAllowLoad: boolean,
154155
standaloneLoadFromOtherDatabases: boolean,
155156
standaloneMultiDatabase: boolean,
@@ -167,6 +168,7 @@ export const setStandaloneEnabled = (
167168
standaloneDashboardURL,
168169
standaloneUsername,
169170
standalonePassword,
171+
standalonePasswordWarningHidden,
170172
standaloneAllowLoad,
171173
standaloneLoadFromOtherDatabases,
172174
standaloneMultiDatabase,

src/application/ApplicationReducer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
195195
standaloneDashboardURL,
196196
standaloneUsername,
197197
standalonePassword,
198+
standalonePasswordWarningHidden,
198199
standaloneAllowLoad,
199200
standaloneLoadFromOtherDatabases,
200201
standaloneMultiDatabase,
@@ -211,6 +212,7 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
211212
standaloneDashboardURL: standaloneDashboardURL,
212213
standaloneUsername: standaloneUsername,
213214
standalonePassword: standalonePassword,
215+
standalonePasswordWarningHidden: standalonePasswordWarningHidden,
214216
standaloneAllowLoad: standaloneAllowLoad,
215217
standaloneLoadFromOtherDatabases: standaloneLoadFromOtherDatabases,
216218
standaloneMultiDatabase: standaloneMultiDatabase,

src/application/ApplicationSelectors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export const applicationGetStandaloneSettings = (state: any) => {
9494
standaloneDashboardURL: state.application.standaloneDashboardURL,
9595
standaloneUsername: state.application.standaloneUsername,
9696
standalonePassword: state.application.standalonePassword,
97+
standalonePasswordWarningHidden: state.application.standalonePasswordWarningHidden,
9798
standaloneAllowLoad: state.application.standaloneAllowLoad,
9899
standaloneLoadFromOtherDatabases: state.application.standaloneLoadFromOtherDatabases,
99100
standaloneMultiDatabase: state.application.standaloneMultiDatabase,

src/application/ApplicationThunks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
464464
config.standaloneDashboardURL,
465465
config.standaloneUsername,
466466
config.standalonePassword,
467+
config.standalonePasswordWarningHidden,
467468
config.standaloneAllowLoad,
468469
config.standaloneLoadFromOtherDatabases,
469470
config.standaloneMultiDatabase,
@@ -621,7 +622,6 @@ export const initializeApplicationAsStandaloneThunk =
621622
(config, paramsToSetAfterConnecting) => (dispatch: any, getState: any) => {
622623
const clearNotificationAfterLoad = true;
623624
const state = getState();
624-
625625
// If we are running in standalone mode, auto-set the connection details that are configured.
626626
dispatch(
627627
setConnectionProperties(

src/chart/ChartUtils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ export const isEmptyObject = (obj: object) => {
406406
* @returns True if it's an object castable to date
407407
*/
408408
export function isCastableToNeo4jDate(value: object) {
409+
if (value == null || value == undefined) {
410+
return false;
411+
}
409412
let keys = Object.keys(value);
410413
return keys.length == 3 && keys.includes('day') && keys.includes('month') && keys.includes('year');
411414
}

src/dashboard/Dashboard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const Dashboard = ({
3636
);
3737
setDriver(newDriver);
3838
}
39-
4039
const content = (
4140
<Neo4jProvider driver={driver}>
4241
<NeoDashboardConnectionUpdateHandler
@@ -81,7 +80,8 @@ const Dashboard = ({
8180
{/* The main content of the page */}
8281

8382
<div>
84-
{standaloneSettings.standalonePassword ? (
83+
{standaloneSettings.standalonePassword &&
84+
standaloneSettings.standalonePasswordWarningHidden !== true ? (
8585
<div style={{ textAlign: 'center', color: 'red', paddingTop: 60, marginBottom: -50 }}>
8686
Warning: NeoDash is running with a plaintext password in config.json.
8787
</div>

0 commit comments

Comments
 (0)