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": {
|
"users": {
|
||||||
"title": "Benutzer",
|
"title": "Benutzer",
|
||||||
"subtitle": "Verwaltung der Benutzer",
|
"subtitle": "Verwaltung der Benutzer",
|
||||||
|
"noUsers": "Keine Benutzer gefunden.",
|
||||||
"createButton": "Benutzer erstellen"
|
"createButton": "Benutzer erstellen"
|
||||||
},
|
},
|
||||||
"singleUser": {
|
"singleUser": {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
"users": {
|
"users": {
|
||||||
"title": "Users",
|
"title": "Users",
|
||||||
"subtitle": "Create, read, update and delete users",
|
"subtitle": "Create, read, update and delete users",
|
||||||
|
"noUsers": "No users found.",
|
||||||
"createButton": "Create User"
|
"createButton": "Create User"
|
||||||
},
|
},
|
||||||
"singleUser": {
|
"singleUser": {
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ import {
|
|||||||
PageActions,
|
PageActions,
|
||||||
Button,
|
Button,
|
||||||
CreateButton,
|
CreateButton,
|
||||||
Paginator
|
Paginator,
|
||||||
|
Notification
|
||||||
} from "@scm-manager/ui-components";
|
} from "@scm-manager/ui-components";
|
||||||
import { UserTable } from "./../components/table";
|
import { UserTable } from "./../components/table";
|
||||||
import type { User, PagedCollection } from "@scm-manager/ui-types";
|
import type { User, PagedCollection } from "@scm-manager/ui-types";
|
||||||
@@ -75,14 +76,26 @@ class Users extends React.Component<Props> {
|
|||||||
loading={loading || !users}
|
loading={loading || !users}
|
||||||
error={error}
|
error={error}
|
||||||
>
|
>
|
||||||
<UserTable users={users} />
|
{this.renderUserTable()}
|
||||||
{this.renderPaginator()}
|
|
||||||
{this.renderCreateButton()}
|
{this.renderCreateButton()}
|
||||||
{this.renderPageActionCreateButton()}
|
{this.renderPageActionCreateButton()}
|
||||||
</Page>
|
</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() {
|
renderPaginator() {
|
||||||
const { list } = this.props;
|
const { list } = this.props;
|
||||||
if (list) {
|
if (list) {
|
||||||
|
|||||||
Reference in New Issue
Block a user