Fixed es6 lint errors, and reverted a change to a helper

This commit is contained in:
Jose Ivan Vargas 2017-01-03 12:55:36 -06:00
parent f243f1b2b9
commit 8f4f04c238
4 changed files with 8 additions and 9 deletions

View File

@ -1,30 +1,29 @@
/* eslint-disable func-names, space-before-function-paren, vars-on-top, no-var, object-shorthand, comma-dangle, max-len */
(() => { (() => {
// Add datepickers to all `js-access-expiration-date` elements. If those elements are // Add datepickers to all `js-access-expiration-date` elements. If those elements are
// children of an element with the `clearable-input` class, and have a sibling // children of an element with the `clearable-input` class, and have a sibling
// `js-clear-input` element, then show that element when there is a value in the // `js-clear-input` element, then show that element when there is a value in the
// datepicker, and make clicking on that element clear the field. // datepicker, and make clicking on that element clear the field.
// //
window.gl = window.gl || {};
gl.MemberExpirationDate = (selector = '.js-access-expiration-date') => { gl.MemberExpirationDate = (selector = '.js-access-expiration-date') => {
function toggleClearInput() { function toggleClearInput() {
$(this).closest('.clearable-input').toggleClass('has-value', $(this).val() !== ''); $(this).closest('.clearable-input').toggleClass('has-value', $(this).val() !== '');
} }
const inputs = $(selector);
var inputs = $(selector);
inputs.datepicker({ inputs.datepicker({
dateFormat: 'yy-mm-dd', dateFormat: 'yy-mm-dd',
minDate: 1, minDate: 1,
onSelect: function () { onSelect: () => {
$(this).trigger('change'); $(this).trigger('change');
toggleClearInput.call(this); toggleClearInput.call(this);
} },
}); });
inputs.next('.js-clear-input').on('click', (event) => { inputs.next('.js-clear-input').on('click', (event) => {
event.preventDefault(); event.preventDefault();
var input = $(this).closest('.clearable-input').find(selector); const input = $(this).closest('.clearable-input').find(selector);
input.datepicker('setDate', null) input.datepicker('setDate', null)
.trigger('change'); .trigger('change');
toggleClearInput.call(input); toggleClearInput.call(input);

View File

@ -59,7 +59,7 @@ module SelectsHelper
def users_select_data_attributes(opts) def users_select_data_attributes(opts)
{ {
placeholder: opts[:placeholder] || 'Search for members to update or invite', placeholder: opts[:placeholder] || 'Search for a user',
null_user: opts[:null_user] || false, null_user: opts[:null_user] || false,
any_user: opts[:any_user] || false, any_user: opts[:any_user] || false,
email_user: opts[:email_user] || false, email_user: opts[:email_user] || false,

View File

@ -8,7 +8,7 @@
.col-lg-9 .col-lg-9
%h5.prepend-top-0 %h5.prepend-top-0
Set a group to share Set a group to share
= form_tag namespace_project_group_links_path(@project.namespace, @project), class: 'js-requires-input', method: :post, namespace: 'GROUPS' do = form_tag namespace_project_group_links_path(@project.namespace, @project), class: 'js-requires-input', method: :post do
.form-group .form-group
= label_tag :link_group_id, "Group", class: "label-light" = label_tag :link_group_id, "Group", class: "label-light"
= groups_select_tag(:link_group_id, data: { skip_groups: @skip_groups }, required: true) = groups_select_tag(:link_group_id, data: { skip_groups: @skip_groups }, required: true)

View File

@ -1,7 +1,7 @@
= form_for @project_member, as: :project_member, url: namespace_project_project_members_path(@project.namespace, @project), html: { class: 'users-project-form' } do |f| = form_for @project_member, as: :project_member, url: namespace_project_project_members_path(@project.namespace, @project), html: { class: 'users-project-form' } do |f|
.row .row
.col-md-5.col-lg-5 .col-md-5.col-lg-5
= users_select_tag(:user_ids, multiple: true, class: "input-clamp", scope: :all, email_user: true) = users_select_tag(:user_ids, multiple: true, class: "input-clamp", scope: :all, email_user: true, placeholder: "Search for members to update or invite")
.help-block.append-bottom-10 .help-block.append-bottom-10
Search for members by name, username, or email, or invite new ones using their email address. Search for members by name, username, or email, or invite new ones using their email address.