diff --git a/app/assets/javascripts/users/settings/teams/invite_users_modal.js b/app/assets/javascripts/users/settings/teams/invite_users_modal.js index f89a5deff..6d0b95a40 100644 --- a/app/assets/javascripts/users/settings/teams/invite_users_modal.js +++ b/app/assets/javascripts/users/settings/teams/invite_users_modal.js @@ -84,6 +84,10 @@ inviteBtn.hide(); inviteWithRoleDiv.show(); break; + case 'invite_new_members': + inviteBtn.show(); + inviteWithRoleDiv.hide(); + break; default: break; } diff --git a/app/assets/stylesheets/themes/scinote.scss b/app/assets/stylesheets/themes/scinote.scss index ab5d80afc..c7c635a00 100644 --- a/app/assets/stylesheets/themes/scinote.scss +++ b/app/assets/stylesheets/themes/scinote.scss @@ -1317,6 +1317,8 @@ body > .loading-overlay { } .modal-invite-users { + overflow: hidden; + .bootstrap-tagsinput { min-width: 450px; width: 100%; @@ -1343,13 +1345,27 @@ body > .loading-overlay { } } - .dropdown-selector-container { - margin-bottom: 20px; - } - .g-recaptcha { margin-top: 20px; } + + h4 { + font-size: 14px; + margin-bottom: 5px; + } + + .select-container--with-blank { + overflow: hidden; + + .search-field::placeholder { + color: $color-black; + opacity: 1; + } + + .search-field:focus::placeholder { + opacity: 0; + } + } } // Disable textarea resizing throughout application @@ -1493,13 +1509,34 @@ a.disabled-with-click-events { } .form-select { - border: 1px solid $color-silver-chalice; - border-radius: 4px; - color: $color-emperor; - display: block; - font-size: 14px; - min-height: 36px; - outline: 0; - padding: 8px 42px 3px 3px; - width: 100%; + position: relative; + + select { + appearance: none; + border: 1px solid $color-silver-chalice; + border-radius: 4px; + color: $color-emperor; + display: block; + font-size: 14px; + min-height: 36px; + outline: 0; + padding: 8px 42px 3px 3px; + width: 100%; + } + + &::after { + color: $color-silver-chalice; + content: "\f0d7"; + font-family: "Font Awesome 5 Free"; + font-weight: 900; + height: 100%; + padding: 12px 8px; + pointer-events: none; + position: absolute; + right: -6px; + text-align: center; + top: -6px; + width: 10%; + z-index: 1; + } } diff --git a/app/controllers/users/invitations_controller.rb b/app/controllers/users/invitations_controller.rb index af3b16aba..606b9513b 100644 --- a/app/controllers/users/invitations_controller.rb +++ b/app/controllers/users/invitations_controller.rb @@ -165,7 +165,10 @@ module Users .joins(:user_teams) .where('user_teams.role': UserTeam.roles[:admin]) .distinct - .select { |team| can_invite_team_users?(team) } + + teams = teams.where_attributes_like(:name, params[:query]) if params[:query].present? + + teams.select { |team| can_invite_team_users?(team) } render json: teams.map { |t| { value: t.id, label: t.name } }.to_json end diff --git a/app/views/shared/_invite_users_modal.html.erb b/app/views/shared/_invite_users_modal.html.erb index c92171852..1959b6e6f 100644 --- a/app/views/shared/_invite_users_modal.html.erb +++ b/app/views/shared/_invite_users_modal.html.erb @@ -23,6 +23,7 @@ text_title ||= nil text_invite_heading ||= nil invite_to_team = type.in?(%w(invite_to_team invite_to_team_with_role)) +invite_with_team_selector = type.in?(%w(invite_new_members invite_with_team_selector invite_with_team_selector_and_role)) %>
<%= t('invite_users.new_members.description') %>
+<%= t('invite_users.new_members.input_subtitle') %>
+