mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
added no users found notification
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
"users": {
|
||||
"title": "Benutzer",
|
||||
"subtitle": "Verwaltung der Benutzer",
|
||||
"noUsers": "Keine Benutzer gefunden.",
|
||||
"createButton": "Benutzer erstellen"
|
||||
},
|
||||
"singleUser": {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
"users": {
|
||||
"title": "Users",
|
||||
"subtitle": "Create, read, update and delete users",
|
||||
"noUsers": "No users found.",
|
||||
"createButton": "Create User"
|
||||
},
|
||||
"singleUser": {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user