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