added no changesets found notification

This commit is contained in:
Florian Scholdei
2019-04-09 15:19:43 +02:00
parent df7c915363
commit 818076ac6f
3 changed files with 16 additions and 4 deletions

View File

@@ -69,6 +69,7 @@
"changesets": {
"errorTitle": "Fehler",
"errorSubtitle": "Changesets konnten nicht abgerufen werden",
"noChangesets": "Keine Changesets gefunden.",
"branchSelectorLabel": "Branches"
},
"changeset": {

View File

@@ -69,6 +69,7 @@
"changesets": {
"errorTitle": "Error",
"errorSubtitle": "Could not fetch changesets",
"noChangesets": "No changesets found.",
"branchSelectorLabel": "Branches"
},
"changeset": {

View File

@@ -22,9 +22,11 @@ import {
getPageFromMatch,
LinkPaginator,
ChangesetList,
Loading
Loading,
Notification
} from "@scm-manager/ui-components";
import { compose } from "redux";
import { translate } from "react-i18next";
type Props = {
repository: Repository,
@@ -41,7 +43,8 @@ type Props = {
fetchChangesets: (Repository, Branch, number) => void,
// context props
match: any
match: any,
t: string => string
};
class Changesets extends React.Component<Props> {
@@ -52,7 +55,7 @@ class Changesets extends React.Component<Props> {
}
render() {
const { changesets, loading, error } = this.props;
const { changesets, loading, error, t } = this.props;
if (error) {
return <ErrorNotification error={error} />;
@@ -63,7 +66,13 @@ class Changesets extends React.Component<Props> {
}
if (!changesets || changesets.length === 0) {
return null;
return (
<div className="panel-block">
<Notification type="info">
{t("changesets.noChangesets")}
</Notification>
</div>
);
}
return (
<>
@@ -115,6 +124,7 @@ const mapStateToProps = (state: any, ownProps: Props) => {
};
export default compose(
translate("repos"),
withRouter,
connect(
mapStateToProps,