diff --git a/scm-ui/public/locales/de/groups.json b/scm-ui/public/locales/de/groups.json index 897cab02d3..bb8eda1cf2 100644 --- a/scm-ui/public/locales/de/groups.json +++ b/scm-ui/public/locales/de/groups.json @@ -10,7 +10,8 @@ }, "groups": { "title": "Gruppen", - "subtitle": "Verwaltung der Gruppen" + "subtitle": "Verwaltung der Gruppen", + "noGroups": "Keine Gruppen gefunden." }, "singleGroup": { "errorTitle": "Fehler", diff --git a/scm-ui/public/locales/en/groups.json b/scm-ui/public/locales/en/groups.json index a54249988a..aff350a458 100644 --- a/scm-ui/public/locales/en/groups.json +++ b/scm-ui/public/locales/en/groups.json @@ -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", diff --git a/scm-ui/src/groups/containers/Groups.js b/scm-ui/src/groups/containers/Groups.js index 78e373e261..8315614b4c 100644 --- a/scm-ui/src/groups/containers/Groups.js +++ b/scm-ui/src/groups/containers/Groups.js @@ -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 { loading={loading || !groups} error={error} > - - {this.renderPaginator()} + {this.renderGroupTable()} {this.renderCreateButton()} {this.renderPageActionCreateButton()} ); } + renderGroupTable() { + const { groups, t } = this.props; + if (groups && groups.length > 0) { + return ( + <> + + {this.renderPaginator()} + + ); + } + return {t("groups.noGroups")}; + } + renderPaginator() { const { list } = this.props; if (list) { @@ -93,12 +106,9 @@ class Groups extends React.Component { renderCreateButton() { if (this.props.canAddGroups) { - return ( - - ); - } else { - return; + return ; } + return null; } renderPageActionCreateButton() { @@ -112,9 +122,8 @@ class Groups extends React.Component { /> ); - } else { - return; } + return null; } }