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

Sprint 44 Prod Deployment #172

Merged
merged 9 commits into from
Jan 7, 2025
Merged
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
Loading