mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-10 22:30:20 +01:00
added no branches found notification
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
"branches": {
|
||||
"overview": {
|
||||
"title": "Übersicht aller verfügbaren Branches",
|
||||
"noBranches": "Keine Branches gefunden.",
|
||||
"createButton": "Branch erstellen"
|
||||
},
|
||||
"table": {
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
"branches": {
|
||||
"overview": {
|
||||
"title": "Overview of all branches",
|
||||
"noBranches": "No branches found.",
|
||||
"createButton": "Create Branch"
|
||||
},
|
||||
"table": {
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
CreateButton,
|
||||
ErrorNotification,
|
||||
Loading,
|
||||
Notification,
|
||||
Subtitle
|
||||
} from "@scm-manager/ui-components";
|
||||
import BranchTable from "../components/BranchTable";
|
||||
@@ -44,7 +45,7 @@ class BranchesOverview extends React.Component<Props> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { baseUrl, loading, error, branches, t } = this.props;
|
||||
const { loading, error, branches, t } = this.props;
|
||||
|
||||
if (error) {
|
||||
return <ErrorNotification error={error} />;
|
||||
@@ -54,17 +55,24 @@ class BranchesOverview extends React.Component<Props> {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
orderBranches(branches);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Subtitle subtitle={t("branches.overview.title")} />
|
||||
<BranchTable baseUrl={baseUrl} branches={branches} />
|
||||
{this.renderBranchesTable()}
|
||||
{this.renderCreateButton()}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
renderBranchesTable() {
|
||||
const { baseUrl, branches, t } = this.props;
|
||||
if (branches && branches.length > 0) {
|
||||
orderBranches(branches);
|
||||
return <BranchTable baseUrl={baseUrl} branches={branches} />;
|
||||
}
|
||||
return <Notification type="info">{t("branches.overview.noBranches")}</Notification>;
|
||||
}
|
||||
|
||||
renderCreateButton() {
|
||||
const { showCreateButton, t } = this.props;
|
||||
if (showCreateButton || true) {
|
||||
|
||||
Reference in New Issue
Block a user