diff --git a/app/assets/javascripts/dispatcher.js.es6 b/app/assets/javascripts/dispatcher.js.es6 index ff8b8f6d0aea200d3ccf03c6d42f128f501faffc..8e4fd1f19ba396682acf6dbdbe6bfc88787ebf98 100644 --- a/app/assets/javascripts/dispatcher.js.es6 +++ b/app/assets/javascripts/dispatcher.js.es6 @@ -299,7 +299,7 @@ }; Dispatcher.prototype.initFieldErrors = function() { - $('.show-gl-field-errors').each((i, form) => { + $('.gl-show-field-errors').each((i, form) => { new gl.GlFieldErrors(form); }); }; diff --git a/app/assets/javascripts/gl_field_error.js.es6 b/app/assets/javascripts/gl_field_error.js.es6 index 9047de645f58161ea347275f73d717f3dfcf9529..12ea69da165c65266376a888c25c4e6c7ae5bc59 100644 --- a/app/assets/javascripts/gl_field_error.js.es6 +++ b/app/assets/javascripts/gl_field_error.js.es6 @@ -3,7 +3,7 @@ /* * This class overrides the browser's validation error bubbles, displaying custom * error messages for invalid fields instead. To begin validating any form, add the - * class `show-gl-field-errors` to the form element, and ensure error messages are + * class `gl-show-field-errors` to the form element, and ensure error messages are * declared in each inputs' `title` attribute. If no title is declared for an invalid * field the user attempts to submit, "This field is required." will be shown by default. * @@ -16,13 +16,13 @@ * * Basic: * - * <form class='show-gl-field-errors'> + * <form class='gl-show-field-errors'> * <input type='text' name='username' title='Username is required.'/> * </form> * * Ignore specific inputs (e.g. UsernameValidator): * - * <form class='show-gl-field-errors'> + * <form class='gl-show-field-errors'> * <div class="form-group> * <input type='text' class='gl-field-errors-ignore' pattern='[a-zA-Z0-9-_]+'/> * </div> @@ -33,7 +33,7 @@ * * Custom Error Anchor (allows error message to be injected after specified element): * - * <form class='show-gl-field-errors'> + * <form class='gl-show-field-errors'> * <div class="form-group gl-field-error-anchor"> * <input type='text' name='username' title='Username is required.'/> * // Error message typically injected here diff --git a/app/assets/stylesheets/framework/forms.scss b/app/assets/stylesheets/framework/forms.scss index 514d0868ba14eae823c03c128b1b08460e8035f1..f0727e9688ae58d315b10fa26552fbc27956c4ac 100644 --- a/app/assets/stylesheets/framework/forms.scss +++ b/app/assets/stylesheets/framework/forms.scss @@ -136,7 +136,7 @@ label { color: $red-normal; } -.show-gl-field-errors { +.gl-show-field-errors { .gl-field-success-outline { border: 1px solid $green-normal; diff --git a/app/views/admin/appearances/preview.html.haml b/app/views/admin/appearances/preview.html.haml index acbe17036f78333b2fa36a938c37b1ca3f91721d..1af7dd5bb67f8f63488ada530f7a2e8f2efd127c 100644 --- a/app/views/admin/appearances/preview.html.haml +++ b/app/views/admin/appearances/preview.html.haml @@ -1,6 +1,6 @@ = render 'devise/shared/tab_single', tab_title: 'Sign in preview' .login-box - %form.show-gl-field-errors + %form.gl-show-field-errors .form-group = label_tag :login = text_field_tag :login, nil, class: "form-control top", title: 'Please provide your username or email address.' diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index 5d25dd398d6a9741b6f38aa87f8f47c047d49877..73e70dc63e56355e8310582acafb6d7642699a9b 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -1,7 +1,7 @@ = render 'devise/shared/tab_single', tab_title: 'Resend confirmation instructions' .login-box .login-body - = form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post, class: 'show-gl-field-errors' }) do |f| + = form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post, class: 'gl-show-field-errors' }) do |f| .devise-errors = devise_error_messages! .form-group diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index b518fae7c9598b2c722e45b3f8e4e817853123c3..5e189e6dc544af58514ed2ae1654d5262e0d83c0 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,7 +1,7 @@ = render 'devise/shared/tab_single', tab_title:'Change your password' .login-box .login-body - = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: 'show-gl-field-errors' }) do |f| + = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: 'gl-show-field-errors' }) do |f| .devise-errors = devise_error_messages! = f.hidden_field :reset_password_token diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index 1fcfd06419a55679799f8045c35c9059262acc7b..99ce13adf7408f47e00a27c2e32b5b00396ec0be 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,7 +1,7 @@ = render 'devise/shared/tab_single', tab_title: 'Reset Password' .login-box .login-body - = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: 'show-gl-field-errors' }) do |f| + = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: 'gl-show-field-errors' }) do |f| .devise-errors = devise_error_messages! .form-group diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml index 5fd896f6835db349c665e3d165e528fd07cb77f6..21b895808189e9210f319f786d71b91606922b3b 100644 --- a/app/views/devise/sessions/_new_base.html.haml +++ b/app/views/devise/sessions/_new_base.html.haml @@ -1,4 +1,4 @@ -= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'new_user show-gl-field-errors', 'aria-live' => 'assertive'}) do |f| += form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'new_user gl-show-field-errors', 'aria-live' => 'assertive'}) do |f| %div.form-group = f.label "Username or email", for: :login = f.text_field :login, class: "form-control top", autofocus: "autofocus", autocapitalize: "off", autocorrect: "off", required: true, title: "This field is required." diff --git a/app/views/devise/sessions/_new_crowd.html.haml b/app/views/devise/sessions/_new_crowd.html.haml index 1d381ad78932a6a1bd623a9ea2982efedd5b9c7d..a6cadbcbdff8470a95fb20b355eb6fce02e308bd 100644 --- a/app/views/devise/sessions/_new_crowd.html.haml +++ b/app/views/devise/sessions/_new_crowd.html.haml @@ -1,4 +1,4 @@ -= form_tag(omniauth_authorize_path(:user, :crowd), id: 'new_crowd_user', class: 'show-gl-field-errors') do += form_tag(omniauth_authorize_path(:user, :crowd), id: 'new_crowd_user', class: 'gl-show-field-errors') do .form-group = label_tag :username, 'Username or email' = text_field_tag :username, nil, {class: "form-control top", title: "This field is required", autofocus: "autofocus", required: true } diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index c18bc2ac413feeee93f03f1b195fae9f4132f911..3ab5461f92933087e768d77953b5ec0e216f4e4c 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -1,4 +1,4 @@ -= form_tag(omniauth_callback_path(:user, server['provider_name']), id: 'new_ldap_user', class: "show-gl-field-errors") do += form_tag(omniauth_callback_path(:user, server['provider_name']), id: 'new_ldap_user', class: "gl-show-field-errors") do .form-group = label_tag :username, "#{server['label']} Username" = text_field_tag :username, nil, {class: "form-control top", title: "This field is required.", autofocus: "autofocus", required: true } diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml index fd77cdbee2e186a6e7e6916e6c98c2e56bc2c543..2cadc424668a022e05099a8962f7968fe934171f 100644 --- a/app/views/devise/sessions/two_factor.html.haml +++ b/app/views/devise/sessions/two_factor.html.haml @@ -7,7 +7,7 @@ .login-box .login-body - if @user.two_factor_otp_enabled? - = form_for(resource, as: resource_name, url: session_path(resource_name), method: :post, html: { class: 'edit_user show-gl-field-errors' }) do |f| + = form_for(resource, as: resource_name, url: session_path(resource_name), method: :post, html: { class: 'edit_user gl-show-field-errors' }) do |f| - resource_params = params[resource_name].presence || params = f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0) %div diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 99cde88fb08ad7bd3022ad063bb16d68e4c02a39..7c68e3266e5177ffecbdf37e516d4e05af76fefb 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -1,6 +1,6 @@ #register-pane.login-box{ role: 'tabpanel', class: 'tab-pane' } .login-body - = form_for(resource, as: "new_#{resource_name}", url: registration_path(resource_name), html: { class: "new_new_user show-gl-field-errors", "aria-live" => "assertive" }) do |f| + = form_for(resource, as: "new_#{resource_name}", url: registration_path(resource_name), html: { class: "new_new_user gl-show-field-errors", "aria-live" => "assertive" }) do |f| .devise-errors = devise_error_messages! %div.form-group diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml index 49b2f77111fc4c039b80a20146a8d031b67eeedb..b2f48a4e0bf252cec61cb132c0a2055d1094595d 100644 --- a/app/views/devise/unlocks/new.html.haml +++ b/app/views/devise/unlocks/new.html.haml @@ -1,7 +1,7 @@ = render 'devise/shared/tab_single', tab_title: 'Resend unlock instructions' .login-box .login-body - = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post, class: 'show-gl-field-errors' }) do |f| + = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post, class: 'gl-show-field-errors' }) do |f| .devise-errors = devise_error_messages! .form-group.append-bottom-20 diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index db04ab0e980ae9372c98bdaff0f6608104fadac5..88eddad5ebe618efc1a1112db3f377fb35831c34 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -2,7 +2,7 @@ .panel-heading Group settings .panel-body - = form_for @group, html: { multipart: true, class: "form-horizontal show-gl-field-errors" }, authenticity_token: true do |f| + = form_for @group, html: { multipart: true, class: "form-horizontal gl-show-field-errors" }, authenticity_token: true do |f| = form_errors(@group) = render 'shared/group_form', f: f diff --git a/spec/javascripts/fixtures/gl_field_errors.html.haml b/spec/javascripts/fixtures/gl_field_errors.html.haml index 3026af8856dcfec2dea13fab622dedc8143429d1..69445b61367c201cf050864a6c1e17248e32d108 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 diff --git a/spec/javascripts/gl_field_errors_spec.js.es6 b/spec/javascripts/gl_field_errors_spec.js.es6 index 220e8c32447b117c13fc8243212ef3e043ff66d6..0713e30e485692b48e9ceb5fe9f098c47daf85ce 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); });