mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Merge pull request #4534 from okriuchykhin/ok_SCI_7338
Fix user role selection when inviting new users [SCI-7338]
This commit is contained in:
commit
4cee224180
3 changed files with 4 additions and 4 deletions
|
@ -70,7 +70,7 @@
|
|||
});
|
||||
});
|
||||
|
||||
dropdownSelector.init('#role', {
|
||||
dropdownSelector.init(roleInput, {
|
||||
noEmptyOption: true,
|
||||
singleSelect: true,
|
||||
closeOnSelect: true,
|
||||
|
@ -138,7 +138,7 @@
|
|||
var data = {
|
||||
emails: dropdownSelector.getValues(emailsInput),
|
||||
team_ids: dropdownSelector.getValues(teamsInput),
|
||||
role: dropdownSelector.getValues(roleInput),
|
||||
role_id: dropdownSelector.getValues(roleInput),
|
||||
'g-recaptcha-response': $('.g-recaptcha-response').val()
|
||||
};
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ module Users
|
|||
end
|
||||
|
||||
if @teams.any? && user
|
||||
@user_role ||= UserRole.find_by(name: UserRole.public_send('normal_user_role').name)
|
||||
@user_role ||= UserRole.find_predefined_normal_user_role
|
||||
@teams.each do |team|
|
||||
if team.user_assignments.exists?(user: user)
|
||||
result[:status] = :user_exists_and_in_team
|
||||
|
|
|
@ -114,7 +114,7 @@ invite_with_team_selector = type.in?(%w(invite_new_members invite_with_team_sele
|
|||
</h4>
|
||||
<div class="form-select">
|
||||
<% normal_user_role = UserRole.find_predefined_normal_user_role %>
|
||||
<%= select_tag "role",
|
||||
<%= select_tag "role-id",
|
||||
options_for_select(
|
||||
team_user_roles_for_select
|
||||
.map { |name, id| [id == normal_user_role.id ? "#{name} (#{t('invite_users.default')})" : name, id] },
|
||||
|
|
Loading…
Reference in a new issue