mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-09 22:00:20 +01:00
added no groups found notification
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
},
|
||||
"groups": {
|
||||
"title": "Gruppen",
|
||||
"subtitle": "Verwaltung der Gruppen"
|
||||
"subtitle": "Verwaltung der Gruppen",
|
||||
"noGroups": "Keine Gruppen gefunden."
|
||||
},
|
||||
"singleGroup": {
|
||||
"errorTitle": "Fehler",
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
},
|
||||
"groups": {
|
||||
"title": "Groups",
|
||||
"subtitle": "Create, read, update and delete groups"
|
||||
"subtitle": "Create, read, update and delete groups",
|
||||
"noGroups": "No groups found."
|
||||
},
|
||||
"singleGroup": {
|
||||
"errorTitle": "Error",
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
selectListAsCollection
|
||||
} from "../modules/groups";
|
||||
import { getGroupsLink } from "../../modules/indexResource";
|
||||
import Notification from "@scm-manager/ui-components/src/Notification";
|
||||
|
||||
type Props = {
|
||||
groups: Group[],
|
||||
@@ -75,14 +76,26 @@ class Groups extends React.Component<Props> {
|
||||
loading={loading || !groups}
|
||||
error={error}
|
||||
>
|
||||
<GroupTable groups={groups} />
|
||||
{this.renderPaginator()}
|
||||
{this.renderGroupTable()}
|
||||
{this.renderCreateButton()}
|
||||
{this.renderPageActionCreateButton()}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
renderGroupTable() {
|
||||
const { groups, t } = this.props;
|
||||
if (groups && groups.length > 0) {
|
||||
return (
|
||||
<>
|
||||
<GroupTable groups={groups} />
|
||||
{this.renderPaginator()}
|
||||
</>
|
||||
);
|
||||
}
|
||||
return <Notification type="info">{t("groups.noGroups")}</Notification>;
|
||||
}
|
||||
|
||||
renderPaginator() {
|
||||
const { list } = this.props;
|
||||
if (list) {
|
||||
@@ -93,12 +106,9 @@ class Groups extends React.Component<Props> {
|
||||
|
||||
renderCreateButton() {
|
||||
if (this.props.canAddGroups) {
|
||||
return (
|
||||
<CreateGroupButton />
|
||||
);
|
||||
} else {
|
||||
return;
|
||||
return <CreateGroupButton />;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
renderPageActionCreateButton() {
|
||||
@@ -112,9 +122,8 @@ class Groups extends React.Component<Props> {
|
||||
/>
|
||||
</PageActions>
|
||||
);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user