Commit 8f4f04c2 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

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

parent f243f1b2
/* 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
// 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
// datepicker, and make clicking on that element clear the field.
//
window.gl = window.gl || {};
gl.MemberExpirationDate = (selector = '.js-access-expiration-date') => {
function toggleClearInput() {
$(this).closest('.clearable-input').toggleClass('has-value', $(this).val() !== '');
}
var inputs = $(selector);
const inputs = $(selector);
inputs.datepicker({
dateFormat: 'yy-mm-dd',
minDate: 1,
onSelect: function () {
onSelect: () => {
$(this).trigger('change');
toggleClearInput.call(this);
}
},
});
inputs.next('.js-clear-input').on('click', (event) => {
event.preventDefault();
var input = $(this).closest('.clearable-input').find(selector);
const input = $(this).closest('.clearable-input').find(selector);
input.datepicker('setDate', null)
.trigger('change');
toggleClearInput.call(input);
......
......@@ -59,7 +59,7 @@ module SelectsHelper
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,
any_user: opts[:any_user] || false,
email_user: opts[:email_user] || false,
......
......@@ -8,7 +8,7 @@
.col-lg-9
%h5.prepend-top-0
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
= label_tag :link_group_id, "Group", class: "label-light"
= groups_select_tag(:link_group_id, data: { skip_groups: @skip_groups }, required: true)
......
= form_for @project_member, as: :project_member, url: namespace_project_project_members_path(@project.namespace, @project), html: { class: 'users-project-form' } do |f|
.row
.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
Search for members by name, username, or email, or invite new ones using their email address.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment