Merge with 2.0.0-m3

This commit is contained in:
René Pfeuffer
2018-12-20 10:44:44 +01:00
28 changed files with 313 additions and 146 deletions

View File

@@ -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,
@@ -9,14 +10,25 @@ type Props = {
};
class ErrorNotification extends React.Component<Props> {
render() {
const { t, error } = this.props;
if (error) {
return (
<Notification type="danger">
<strong>{t("error-notification.prefix")}:</strong> {error.message}
</Notification>
);
if (error === UNAUTHORIZED_ERROR) {
return (
<Notification type="danger">
<strong>{t("error-notification.prefix")}:</strong> {t("error-notification.timeout")}
{" "}
<a href="javascript:window.location.reload(true)">{t("error-notification.loginLink")}</a>
</Notification>
);
} else {
return (
<Notification type="danger">
<strong>{t("error-notification.prefix")}:</strong> {error.message}
</Notification>
);
}
}
return null;
}

View File

@@ -63,8 +63,9 @@ class ConfigurationBinder {
// route for global configuration, passes the current repository to component
const RepoRoute = ({ url, repository }) => {
return this.route(url + to, <RepositoryComponent repository={repository}/>);
const RepoRoute = ({url, repository}) => {
const link = repository._links[linkName].href
return this.route(url + to, <RepositoryComponent repository={repository} link={link}/>);
};
// bind config route to extension point