Skip to content

Commit

Permalink
Revert "Fixed error message on timeout"
Browse files Browse the repository at this point in the history
This reverts commit 7d792b2.
  • Loading branch information
rmathis committed Oct 25, 2021
1 parent 7d792b2 commit e0b2022
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
1 change: 0 additions & 1 deletion backend/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ message.invalid-signing=Unless the response or the assertions are signed, SAML s

message.session-timeout-heading=Session timed out
message.session-timeout-body=Your session has timed out. Please login again.
message.session-timeout=An error has occurred while saving. Your session may have timed out.

tooltip.entity-id=Entity ID
tooltip.service-provider-name=Service Provider Name (Dashboard Display Only)
Expand Down
14 changes: 3 additions & 11 deletions ui/src/app/metadata/view/MetadataWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import { Wizard } from '../wizard/Wizard';
import { useMetadataEntity } from '../hooks/api';
import { createNotificationAction, NotificationTypes, useNotificationDispatcher } from '../../notifications/hoc/Notifications';
import { Prompt, useHistory } from 'react-router';
import { useTranslator } from '../../i18n/hooks';

export function MetadataWizard ({type, data, onCallback}) {

const history = useHistory();
const translator = useTranslator();

const { post, loading, response } = useMetadataEntity(type === 'source' ? 'source' : 'provider');

Expand All @@ -21,21 +19,15 @@ export function MetadataWizard ({type, data, onCallback}) {
const [blocking, setBlocking] = React.useState(false);

async function save(metadata) {
console.log(metadata);
await post('', metadata);
if (response.ok) {
setBlocking(false);
history.push(`/dashboard/metadata/manager/${type === 'source' ? 'resolvers' : 'providers'}`);
} else {
let msg;
if (response.status) {
const { errorCode, errorMessage, cause } = response.data;
msg = `${errorCode}: ${errorMessage} ${cause ? `-${cause}` : ''}`;
} else {
msg = translator('message.session-timeout');
}

const { errorCode, errorMessage, cause } = response.data;
notificationDispatch(createNotificationAction(
msg,
`${errorCode}: ${errorMessage} ${cause ? `-${cause}` : ''}`,
NotificationTypes.ERROR
));
}
Expand Down

0 comments on commit e0b2022

Please sign in to comment.