UX: Add descriptions to auto groups and auto group indicator (#28630)

This commit adds a description for all the auto groups
which will be shown in the group list and show group
pages, which will help admins understand their purpose
better.

Also adds an indicator with a tooltip to explain what
the auto groups are on the group show page.
This commit is contained in:
Martin Brennan 2024-08-30 10:52:34 +10:00 committed by GitHub
parent daa06a1c00
commit ca26099a8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 53 additions and 3 deletions

View File

@ -40,6 +40,18 @@
{{this.model.name}}
</div>
{{/if}}
{{#if this.model.automatic}}
<DTooltip class="admin-group-automatic-tooltip">
<:trigger>
{{d-icon "cog"}}
{{i18n "admin.groups.manage.membership.automatic"}}
</:trigger>
<:content>
{{i18n "admin.groups.manage.membership.automatic_tooltip"}}
</:content>
</DTooltip>
{{/if}}
</div>
<div class="group-details-button">
@ -95,6 +107,7 @@
<p>{{html-safe this.model.bio_cooked}}</p>
</div>
{{/if}}
</div>
<div class="user-content-wrapper">

View File

@ -179,3 +179,19 @@
}
}
}
.admin-group-automatic-tooltip {
align-items: center;
font-size: var(--font-down-2);
padding: 0.2em 1em;
background-color: var(--primary-low);
border-radius: var(--d-button-border-radius);
.fk-d-tooltip__trigger-container {
align-items: center;
.d-icon {
margin-right: 0.25em;
}
}
}

View File

@ -44,10 +44,16 @@ class BasicGroupSerializer < ApplicationSerializer
end
end
def bio_excerpt
if object.bio_cooked.present?
PrettyText.excerpt(object.bio_cooked, 110, keep_emoji_images: true)
def bio_cooked
if object.automatic
return I18n.t("groups.default_descriptions.#{Group::AUTO_GROUP_IDS[object.id]}")
end
object.bio_cooked
end
def bio_excerpt
PrettyText.excerpt(bio_cooked, 200, keep_emoji_images: true) if bio_cooked.present?
end
def include_incoming_email?

View File

@ -5200,6 +5200,7 @@ en:
membership:
automatic: Automatic
automatic_tooltip: "This group is automatic, you cannot delete it and members are added and removed automatically"
trust_levels_title: "Trust level automatically granted to members when they're added:"
effects: Effects
trust_levels_none: "None"

View File

@ -639,6 +639,20 @@ en:
trust_level_2: "trust_level_2"
trust_level_3: "trust_level_3"
trust_level_4: "trust_level_4"
default_descriptions:
everyone: "Automatic group including all members"
staff: "Automatic group including admins and moderators"
admins: "Responsible for configuring and maintaining this site, with access to all member and activity data"
moderators: "Responsible for responding to flags, moderating discussions, and helping members with their accounts"
trust_level_0: "New members with limited abilities, who are learning community norms and functionality"
trust_level_1: "Members with more trust, who have shown initial engagement by reading hand can now access more functions. All members of this group are also members of the trust_level_0 group."
trust_level_2: "Active members who have consistently contributed overtime and gained full citizenship privileges. All members of this group are also members of the trust_level_1 and trust_level_0 groups."
trust_level_3: "Highly engaged, long-term contributors, who form the backbone of the community and have gained limited moderation privileges. All members of this group are also members of the trust_level_2, trust_level_1 and trust_level_0 groups."
trust_level_4: "Manually promoted members, recognized by their exemplary contributions and entrusted with additional moderation privileges. All members of this group are also members of the trust_level_3, trust_level_2, trust_level_1 and trust_level_0 groups."
request_membership_pm:
title: "Membership Request for @%{group_name}"
request_accepted_pm: