Commit 7292b771 authored by Fabio Huser's avatar Fabio Huser

refactor(user-parser): apply merge request review comments

parent ceb49508
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
= f.check_box :mentions_disabled, checked: @group.mentions_disabled?, class: 'form-check-input' = f.check_box :mentions_disabled, checked: @group.mentions_disabled?, class: 'form-check-input'
= f.label :mentions_disabled, class: 'form-check-label' do = f.label :mentions_disabled, class: 'form-check-label' do
%span.d-block= s_('GroupSettings|Disable group mentions') %span.d-block= s_('GroupSettings|Disable group mentions')
%span.text-muted= s_('GroupSettings|This setting will prevent group members from getting notified if the group is mentioned.') %span.text-muted= s_('GroupSettings|This setting will prevent group members from being notified if the group is mentioned.')
= render_if_exists 'groups/settings/ip_restriction', f: f, group: @group = render_if_exists 'groups/settings/ip_restriction', f: f, group: @group
= render_if_exists 'groups/settings/allowed_email_domain', f: f, group: @group = render_if_exists 'groups/settings/allowed_email_domain', f: f, group: @group
......
# frozen_string_literal: true # frozen_string_literal: true
class AddMentionsDisabledToNamespaces < ActiveRecord::Migration[5.2] class AddMentionsDisabledToNamespaces < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false DOWNTIME = false
def change def change
......
...@@ -436,11 +436,11 @@ To enable this feature: ...@@ -436,11 +436,11 @@ To enable this feature:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/21301) in GitLab 12.6. > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/21301) in GitLab 12.6.
You can prevent users from being added to a conversation and getting notified when You can prevent users from being added to a conversation and getting notified when
one mentions a group in which those users are members. anyone mentions a group in which those users are members.
Groups with disabled mentions are visualised accordingly in the auto-completion menu. Groups with disabled mentions are visualized accordingly in the autocompletion dropdown.
This is particularly helpful, if a group has large amount of users. This is particularly helpful for groups with a large number of users.
To enable this feature: To enable this feature:
......
...@@ -98,7 +98,7 @@ module Banzai ...@@ -98,7 +98,7 @@ module Banzai
return [] if ids.empty? return [] if ids.empty?
User.joins(:group_members).where(members: { User.joins(:group_members).where(members: {
source_id: Namespace.where(id: ids, mentions_disabled: [false, nil]).select(:id) source_id: Namespace.where(id: ids).where('mentions_disabled IS NOT TRUE').select(:id)
}).to_a }).to_a
end end
......
...@@ -8911,7 +8911,7 @@ msgstr "" ...@@ -8911,7 +8911,7 @@ msgstr ""
msgid "GroupSettings|This setting will override user notification preferences for all members of the group, subgroups, and projects." msgid "GroupSettings|This setting will override user notification preferences for all members of the group, subgroups, and projects."
msgstr "" msgstr ""
msgid "GroupSettings|This setting will prevent group members from getting notified if the group is mentioned." msgid "GroupSettings|This setting will prevent group members from being notified if the group is mentioned."
msgstr "" msgstr ""
msgid "GroupSettings|Transfer group" msgid "GroupSettings|Transfer group"
......
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