diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-03 17:37:00 +0000 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-03 17:37:00 +0000 |
commit | b4045e997feae2043965706ae9f89ce6221a3792 (patch) | |
tree | 41d9fc9aa03482c1297b2a96a0bad7ec5abd9f62 /spec | |
parent | 651bdd7c34c9ebf686b8357d8fc3ca4d0a58792e (diff) | |
parent | b8b3f919fd37abddf082e0af22bc28b0c3d7c1b2 (diff) | |
download | gitlab-ce-b4045e997feae2043965706ae9f89ce6221a3792.tar.gz |
Merge branch 'group-name-validation' into 'master'
Adds JavaScript validation for group path editing
## What does this MR do?
- Prevents group_edit form submission when special characters are included in the new group name
- Enhances gl_field_errors to support this use case and be more re-usable.
## Are there points in the code the reviewer needs to double check?
**The implementation of validation is here: https://gitlab.com/gitlab-org/gitlab-ce/commit/73d997046cac376ccdbcaac6f183002bc19b9a1f**
The rest of the diff for this MR is augmenting gl_field_errors
## Why was this MR needed?
- Currently we allow submission and a 500 error is returned.
## Screenshots (if relevant)
![2016-10-21_14.11.21](/uploads/2bef5764d3f2429dd0f900661153eef7/2016-10-21_14.11.21.gif)
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/23564, https://gitlab.com/gitlab-org/gitlab-ce/issues/19756, https://gitlab.com/gitlab-org/gitlab-ce/issues/19736, https://gitlab.com/gitlab-org/gitlab-ce/issues/23922
See merge request !7041
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/fixtures/gl_field_errors.html.haml | 4 | ||||
-rw-r--r-- | spec/javascripts/gl_field_errors_spec.js.es6 | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/javascripts/fixtures/gl_field_errors.html.haml b/spec/javascripts/fixtures/gl_field_errors.html.haml index 2526e5e33a5..69445b61367 100644 --- a/spec/javascripts/fixtures/gl_field_errors.html.haml +++ b/spec/javascripts/fixtures/gl_field_errors.html.haml @@ -1,4 +1,4 @@ -%form.show-gl-field-errors{action: 'submit', method: 'post'} +%form.gl-show-field-errors{action: 'submit', method: 'post'} .form-group %input.required-text{required: true, type: 'text'} Text .form-group @@ -10,6 +10,6 @@ .form-group %input.hidden{ type:'hidden' } .form-group - %input.custom.no-gl-field-errors{ type:'text' } Custom, do not validate + %input.custom.gl-field-error-ignore{ type:'text' } Custom, do not validate .form-group %input.submit{type: 'submit'} Submit diff --git a/spec/javascripts/gl_field_errors_spec.js.es6 b/spec/javascripts/gl_field_errors_spec.js.es6 index 4bdd72800ea..0713e30e485 100644 --- a/spec/javascripts/gl_field_errors_spec.js.es6 +++ b/spec/javascripts/gl_field_errors_spec.js.es6 @@ -8,7 +8,7 @@ describe('GL Style Field Errors', function() { beforeEach(function() { fixture.load('gl_field_errors.html'); - const $form = this.$form = $('form.show-gl-field-errors'); + const $form = this.$form = $('form.gl-show-field-errors'); this.fieldErrors = new global.GlFieldErrors($form); }); @@ -21,7 +21,7 @@ }); it('should ignore elements with custom error handling', function() { - const customErrorFlag = 'no-gl-field-errors'; + const customErrorFlag = 'gl-field-error-ignore'; const customErrorElem = $(`.${customErrorFlag}`); expect(customErrorElem.length).toBe(1); |