added no users found notification

This commit is contained in:
Florian Scholdei
2019-04-09 14:59:19 +02:00
parent 24da17e0a9
commit a05fa8d46f
3 changed files with 18 additions and 3 deletions

View File

@@ -24,6 +24,7 @@
"users": {
"title": "Benutzer",
"subtitle": "Verwaltung der Benutzer",
"noUsers": "Keine Benutzer gefunden.",
"createButton": "Benutzer erstellen"
},
"singleUser": {

View File

@@ -24,6 +24,7 @@
"users": {
"title": "Users",
"subtitle": "Create, read, update and delete users",
"noUsers": "No users found.",
"createButton": "Create User"
},
"singleUser": {

View File

@@ -19,7 +19,8 @@ import {
PageActions,
Button,
CreateButton,
Paginator
Paginator,
Notification
} from "@scm-manager/ui-components";
import { UserTable } from "./../components/table";
import type { User, PagedCollection } from "@scm-manager/ui-types";
@@ -75,14 +76,26 @@ class Users extends React.Component<Props> {
loading={loading || !users}
error={error}
>
<UserTable users={users} />
{this.renderPaginator()}
{this.renderUserTable()}
{this.renderCreateButton()}
{this.renderPageActionCreateButton()}
</Page>
);
}
renderUserTable() {
const { users, t } = this.props;
if (users && users.length > 0) {
return (
<>
<UserTable users={users} />
{this.renderPaginator()}
</>
);
}
return <Notification type="info">{t("users.noUsers")}</Notification>;
}
renderPaginator() {
const { list } = this.props;
if (list) {