Commit ceb49508 authored by Fabio Huser's avatar Fabio Huser

refactor(group): rename "group mentionings" to "group mentions"

parent acbb4a3c
......@@ -193,7 +193,7 @@ class GfmAutoComplete {
return m;
}
title = m.name;
if (m.count && !m.mentioningsDisabled) {
if (m.count && !m.mentionsDisabled) {
title += ` (${m.count})`;
}
......@@ -204,7 +204,7 @@ class GfmAutoComplete {
const rectAvatarClass = m.type === GROUP_TYPE ? 'rect-avatar' : '';
const imgAvatar = `<img src="${m.avatar_url}" alt="${m.username}" class="avatar ${rectAvatarClass} avatar-inline center s26"/>`;
const txtAvatar = `<div class="avatar ${rectAvatarClass} center avatar-inline s26">${autoCompleteAvatar}</div>`;
const avatarIcon = m.mentioningsDisabled ? '<i class="fa fa-bell-slash"></i>' : '';
const avatarIcon = m.mentionsDisabled ? '<i class="fa fa-bell-slash"></i>' : '';
return {
username: m.username,
......
......@@ -181,7 +181,7 @@ class GroupsController < Groups::ApplicationController
:avatar,
:description,
:emails_disabled,
:mentionings_disabled,
:mentions_disabled,
:lfs_enabled,
:name,
:path,
......
......@@ -56,7 +56,7 @@ module Users
name: group.full_name,
avatar_url: group.avatar_url,
count: group_counts.fetch(group.id, 0),
mentioningsDisabled: group.mentionings_disabled
mentionsDisabled: group.mentions_disabled
}
end
end
......
......@@ -25,9 +25,9 @@
.form-group.append-bottom-default
.form-check
= f.check_box :mentionings_disabled, checked: @group.mentionings_disabled?, class: 'form-check-input'
= f.label :mentionings_disabled, class: 'form-check-label' do
%span.d-block= s_('GroupSettings|Disable group mentionings')
= f.check_box :mentions_disabled, checked: @group.mentions_disabled?, class: 'form-check-input'
= f.label :mentions_disabled, class: 'form-check-label' do
%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.')
= render_if_exists 'groups/settings/ip_restriction', f: f, group: @group
......
# frozen_string_literal: true
class AddMentioningsDisabledToNamespaces < ActiveRecord::Migration[5.2]
class AddMentionsDisabledToNamespaces < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
add_column :namespaces, :mentionings_disabled, :boolean
add_column :namespaces, :mentions_disabled, :boolean
end
end
......@@ -2603,7 +2603,7 @@ ActiveRecord::Schema.define(version: 2019_11_25_140458) do
t.boolean "emails_disabled"
t.integer "max_pages_size"
t.integer "max_artifacts_size"
t.boolean "mentionings_disabled"
t.boolean "mentions_disabled"
t.index ["created_at"], name: "index_namespaces_on_created_at"
t.index ["custom_project_templates_group_id", "type"], name: "index_namespaces_on_custom_project_templates_group_id_and_type", where: "(custom_project_templates_group_id IS NOT NULL)"
t.index ["file_template_project_id"], name: "index_namespaces_on_file_template_project_id"
......
......@@ -431,21 +431,21 @@ To enable this feature:
1. Expand the **Permissions, LFS, 2FA** section, and select **Disable email notifications**.
1. Click **Save changes**.
#### Disabling group mentionings
#### Disabling group mentions
> [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
one mentions a group in which those users are members.
Groups with disabled mentionings are visualised accordingly in the auto-completion menu.
Groups with disabled mentions are visualised accordingly in the auto-completion menu.
This is particularly helpful, if a group has large amount of users.
To enable this feature:
1. Navigate to the group's **Settings > General** page.
1. Expand the **Permissions, LFS, 2FA** section, and select **Disable group mentionings**.
1. Expand the **Permissions, LFS, 2FA** section, and select **Disable group mentions**.
1. Click **Save changes**.
### Advanced settings
......
......@@ -98,7 +98,7 @@ module Banzai
return [] if ids.empty?
User.joins(:group_members).where(members: {
source_id: Namespace.where(id: ids, mentionings_disabled: [false, nil]).select(:id)
source_id: Namespace.where(id: ids, mentions_disabled: [false, nil]).select(:id)
}).to_a
end
......
......@@ -8860,7 +8860,7 @@ msgstr ""
msgid "GroupSettings|Disable email notifications"
msgstr ""
msgid "GroupSettings|Disable group mentionings"
msgid "GroupSettings|Disable group mentions"
msgstr ""
msgid "GroupSettings|If the parent group's visibility is lower than the group current visibility, visibility levels for subgroups and projects will be changed to match the new parent group's visibility."
......
......@@ -30,8 +30,8 @@ describe Banzai::ReferenceParser::UserParser do
expect(subject.referenced_by([link])).to eq([user])
end
it 'returns an empty Array when the group has mentionings disabled' do
group.update!(mentionings_disabled: true)
it 'returns an empty Array when the group has mentions disabled' do
group.update!(mentions_disabled: true)
expect(subject.referenced_by([link])).to eq([])
end
......
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