diff --git a/scm-ui/public/locales/en/groups.json b/scm-ui/public/locales/en/groups.json index 3484134901..4f2cdbac92 100644 --- a/scm-ui/public/locales/en/groups.json +++ b/scm-ui/public/locales/en/groups.json @@ -30,7 +30,9 @@ "label": "Edit" }, "group-form": { - "submit": "Submit" + "submit": "Submit", + "name-error": "Group name is invalid", + "description-error": "Description is invalid" }, "delete-group-button": { "label": "Delete", diff --git a/scm-ui/src/components/Paginator.js b/scm-ui/src/components/Paginator.js index 5b306b8240..8ec05adec9 100644 --- a/scm-ui/src/components/Paginator.js +++ b/scm-ui/src/components/Paginator.js @@ -93,8 +93,9 @@ class Paginator extends React.Component { if (page + 1 < pageTotal) { links.push(this.renderPageButton(page + 1, "next")); - links.push(this.seperator()); } + if(page+2 < pageTotal) //if there exists pages between next and last + links.push(this.seperator()); if (page < pageTotal) { links.push(this.renderLastButton()); } diff --git a/scm-ui/src/groups/components/GroupForm.js b/scm-ui/src/groups/components/GroupForm.js index 924c0bdee3..fca001a65f 100644 --- a/scm-ui/src/groups/components/GroupForm.js +++ b/scm-ui/src/groups/components/GroupForm.js @@ -44,19 +44,25 @@ class GroupForm extends React.Component { } } - onSubmit = (event: Event) => { - event.preventDefault(); - this.props.submitForm(this.state.group); - }; + isFalsy(value) { + if (!value) { + return true; + } + return false; + } isValid = () => { const group = this.state.group; - return !(this.state.nameValidationError || group.name); + return !( + this.state.nameValidationError || + this.isFalsy(group.name) || + this.isFalsy(group.description) + ); }; submit = (event: Event) => { event.preventDefault(); - if (this.isValid) { + if (this.isValid()) { this.props.submitForm(this.state.group); } }; @@ -69,24 +75,25 @@ class GroupForm extends React.Component { nameField = ( ); } - return ( -
+ + return ( + {nameField} - + ); }