Skip to content

Commit 1130f3e

Browse files
authored
Merge pull request #172 from mercedes-benz/develop
Sprint 44 Prod Deployment
2 parents 4a22eb3 + 4f08f5b commit 1130f3e

File tree

3 files changed

+5722
-5770
lines changed

3 files changed

+5722
-5770
lines changed

src/application/ApplicationThunks.ts

+18-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,21 @@ export const createConnectionThunk =
7575
// eslint-disable-next-line no-console
7676
console.log('Confirming connection was established...');
7777
if (records && records[0] && records[0].error) {
78-
dispatch(createNotificationThunk('Unable to establish connection', records[0].error));
78+
if (
79+
records[0].error.startsWith('The client is unauthorized due to authentication failure') ||
80+
records[0].error.startsWith(
81+
'The client has provided incorrect authentication details too many times in a row.'
82+
)
83+
) {
84+
dispatch(
85+
createNotificationThunk(
86+
'Something went wrong!',
87+
'We are working on it. You can try to reload without cache.'
88+
)
89+
);
90+
} else {
91+
dispatch(createNotificationThunk('Unable to establish connection', records[0].error));
92+
}
7993
if (loggingSettings.loggingMode > '0') {
8094
dispatch(
8195
createLogThunk(
@@ -93,6 +107,7 @@ export const createConnectionThunk =
93107
);
94108
}
95109
} else if (records && records[0] && records[0].keys[0] == 'connected') {
110+
dispatch(clearNotification());
96111
dispatch(setConnectionProperties(protocol, url, port, database, username, password));
97112
dispatch(setConnectionModalOpen(false));
98113
dispatch(setConnected(true));
@@ -170,7 +185,7 @@ export const createConnectionThunk =
170185
query,
171186
parameters,
172187
1,
173-
() => { },
188+
() => {},
174189
(records) => validateConnection(records)
175190
);
176191
} catch (e) {
@@ -420,7 +435,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
420435
standaloneUsername: '',
421436
standalonePassword: '',
422437
skipConfirmation: false,
423-
skipAddDashErrorPopup: false
438+
skipAddDashErrorPopup: false,
424439
};
425440
try {
426441
config = await (await fetch('config.json')).json();

src/modal/NotificationModal.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from '../application/ApplicationSelectors';
1111
import { clearNotification, setConnectionModalOpen } from '../application/ApplicationActions';
1212
import { Dialog } from '@neo4j-ndl/react';
13+
import { Button, DialogActions } from '@mui/material';
1314

1415
/**
1516
* A modal to save a dashboard as a JSON text string.
@@ -24,6 +25,9 @@ export const NeoNotificationModal = ({
2425
setConnectionModalOpen,
2526
onNotificationClose,
2627
}) => {
28+
const handleReload = () => {
29+
window.location.reload();
30+
};
2731
return (
2832
<div>
2933
<Dialog
@@ -42,7 +46,14 @@ export const NeoNotificationModal = ({
4246
>
4347
<Dialog.Header id='form-dialog-title'>{title}</Dialog.Header>
4448

45-
<Dialog.Content style={{ minWidth: '300px' }}>{text && text.toString()}</Dialog.Content>
49+
<Dialog.Content style={{ minWidth: '300px' }}>
50+
{text && text.toString()}
51+
<DialogActions>
52+
<Button onClick={handleReload} autoFocus variant='contained'>
53+
Reload without cache
54+
</Button>
55+
</DialogActions>
56+
</Dialog.Content>
4657
</Dialog>
4758
</div>
4859
);

0 commit comments

Comments
 (0)