mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
added no repositories found notification
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
"overview": {
|
||||
"title": "Repositories",
|
||||
"subtitle": "Übersicht aller verfügbaren Repositories",
|
||||
"noRepositories": "Keine Repositories gefunden.",
|
||||
"createButton": "Repository erstellen"
|
||||
},
|
||||
"create": {
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"overview": {
|
||||
"title": "Repositories",
|
||||
"subtitle": "Overview of available repositories",
|
||||
"noRepositories": "No repositories found.",
|
||||
"createButton": "Create Repository"
|
||||
},
|
||||
"create": {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { translate } from "react-i18next";
|
||||
import type { Group } from "@scm-manager/ui-types";
|
||||
import type { PagedCollection } from "@scm-manager/ui-types";
|
||||
import type { Group, PagedCollection } from "@scm-manager/ui-types";
|
||||
import type { History } from "history";
|
||||
import {
|
||||
Page,
|
||||
PageActions,
|
||||
Button,
|
||||
Notification,
|
||||
Paginator
|
||||
} from "@scm-manager/ui-components";
|
||||
import { GroupTable } from "./../components/table";
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
selectListAsCollection
|
||||
} from "../modules/groups";
|
||||
import { getGroupsLink } from "../../modules/indexResource";
|
||||
import Notification from "@scm-manager/ui-components/src/Notification";
|
||||
|
||||
type Props = {
|
||||
groups: Group[],
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
PageActions,
|
||||
Button,
|
||||
CreateButton,
|
||||
Notification,
|
||||
Paginator
|
||||
} from "@scm-manager/ui-components";
|
||||
import RepositoryList from "../components/list";
|
||||
@@ -72,19 +73,34 @@ class Overview extends React.Component<Props> {
|
||||
loading={loading}
|
||||
error={error}
|
||||
>
|
||||
{this.renderList()}
|
||||
{this.renderOverview()}
|
||||
{this.renderPageActionCreateButton()}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
renderList() {
|
||||
const { collection, fetchReposByLink } = this.props;
|
||||
renderRepositoryList() {
|
||||
const { collection, fetchReposByLink, t } = this.props;
|
||||
|
||||
if (collection._embedded && collection._embedded.repositories.length > 0) {
|
||||
return (
|
||||
<>
|
||||
<RepositoryList repositories={collection._embedded.repositories} />
|
||||
<Paginator collection={collection} onPageChange={fetchReposByLink} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Notification type="info">{t("overview.noRepositories")}</Notification>
|
||||
);
|
||||
}
|
||||
|
||||
renderOverview() {
|
||||
const { collection } = this.props;
|
||||
if (collection) {
|
||||
return (
|
||||
<div>
|
||||
<RepositoryList repositories={collection._embedded.repositories} />
|
||||
<Paginator collection={collection} onPageChange={fetchReposByLink} />
|
||||
{this.renderRepositoryList()}
|
||||
{this.renderCreateButton()}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user