mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
implemented unauthorized error message and link to reload page
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import Notification from "./Notification";
|
||||
import { UNAUTHORIZED_ERROR } from "./apiclient";
|
||||
|
||||
type Props = {
|
||||
t: string => string,
|
||||
@@ -12,12 +13,20 @@ class ErrorNotification extends React.Component<Props> {
|
||||
render() {
|
||||
const { t, error } = this.props;
|
||||
if (error) {
|
||||
if (error == UNAUTHORIZED_ERROR) {
|
||||
return (
|
||||
<Notification type="danger">
|
||||
<strong>{t("error-notification.prefix")}:</strong> {t("error-notification.timeout")} <Link to={"/login"}>Login</Link>
|
||||
</Notification>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<Notification type="danger">
|
||||
<strong>{t("error-notification.prefix")}:</strong> {error.message}
|
||||
</Notification>
|
||||
);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
}
|
||||
},
|
||||
"error-notification": {
|
||||
"prefix": "Error"
|
||||
"prefix": "Error",
|
||||
"timeout": "The session has expired. Please login again."
|
||||
},
|
||||
"loading": {
|
||||
"alt": "Loading ..."
|
||||
|
||||
Reference in New Issue
Block a user