Skip to content

Commit

Permalink
Merge pull request #172 from mercedes-benz/develop
Browse files Browse the repository at this point in the history
Sprint 44 Prod Deployment
  • Loading branch information
m-o-n-i-s-h authored Jan 7, 2025
2 parents 4a22eb3 + 4f08f5b commit 1130f3e
Show file tree
Hide file tree
Showing 3 changed files with 5,722 additions and 5,770 deletions.
21 changes: 18 additions & 3 deletions src/application/ApplicationThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,21 @@ export const createConnectionThunk =
// eslint-disable-next-line no-console
console.log('Confirming connection was established...');
if (records && records[0] && records[0].error) {
dispatch(createNotificationThunk('Unable to establish connection', records[0].error));
if (
records[0].error.startsWith('The client is unauthorized due to authentication failure') ||
records[0].error.startsWith(
'The client has provided incorrect authentication details too many times in a row.'
)
) {
dispatch(
createNotificationThunk(
'Something went wrong!',
'We are working on it. You can try to reload without cache.'
)
);
} else {
dispatch(createNotificationThunk('Unable to establish connection', records[0].error));
}
if (loggingSettings.loggingMode > '0') {
dispatch(
createLogThunk(
Expand All @@ -93,6 +107,7 @@ export const createConnectionThunk =
);
}
} else if (records && records[0] && records[0].keys[0] == 'connected') {
dispatch(clearNotification());
dispatch(setConnectionProperties(protocol, url, port, database, username, password));
dispatch(setConnectionModalOpen(false));
dispatch(setConnected(true));
Expand Down Expand Up @@ -170,7 +185,7 @@ export const createConnectionThunk =
query,
parameters,
1,
() => { },
() => {},
(records) => validateConnection(records)
);
} catch (e) {
Expand Down Expand Up @@ -420,7 +435,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
standaloneUsername: '',
standalonePassword: '',
skipConfirmation: false,
skipAddDashErrorPopup: false
skipAddDashErrorPopup: false,
};
try {
config = await (await fetch('config.json')).json();
Expand Down
13 changes: 12 additions & 1 deletion src/modal/NotificationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '../application/ApplicationSelectors';
import { clearNotification, setConnectionModalOpen } from '../application/ApplicationActions';
import { Dialog } from '@neo4j-ndl/react';
import { Button, DialogActions } from '@mui/material';

/**
* A modal to save a dashboard as a JSON text string.
Expand All @@ -24,6 +25,9 @@ export const NeoNotificationModal = ({
setConnectionModalOpen,
onNotificationClose,
}) => {
const handleReload = () => {
window.location.reload();
};
return (
<div>
<Dialog
Expand All @@ -42,7 +46,14 @@ export const NeoNotificationModal = ({
>
<Dialog.Header id='form-dialog-title'>{title}</Dialog.Header>

<Dialog.Content style={{ minWidth: '300px' }}>{text && text.toString()}</Dialog.Content>
<Dialog.Content style={{ minWidth: '300px' }}>
{text && text.toString()}
<DialogActions>
<Button onClick={handleReload} autoFocus variant='contained'>
Reload without cache
</Button>
</DialogActions>
</Dialog.Content>
</Dialog>
</div>
);
Expand Down
Loading

0 comments on commit 1130f3e

Please sign in to comment.