...
After the groups have been selected from the suggestion list in the channel textbox, we need to notify their members about the mention.
Design
TODO - Describe Notifications phase designThe flow of notifying group members will use the existing SendNotifications
function and insert checks for groups where needed.
The first step added will be to check if the user creating the post and has access to
PERMISSION_USE_GROUP_MENTIONS
, if not then the behaviour ofSendNotifications
will be unchangedIf group mentions are enabled then all groups that have
AllowReference = 1
will be added to memoryThe
ExplicitMentions
struct will have a new attributeGroupMentions
to store the groups mentioned by thePost.Message
.Once all groups are added to the
GroupMentions
map, group members that exist in the channel will be added to theMentions
map as confirmed mentions in the channel.Group members that exist in the
team
but not in thechannel
will be added toOtherPotentialMentions
and will have an invite message generated for them using the existing logic.If there are no group members in the team that the message is sent to a system message will return letting the user know that the group mentioned has no members in the current team.
Warning Modal
in the notification phase, when the aggregated number of group members to mention is above a certain threshold, we are showing a warning modal (see wireframe), the text message in the modal includes the user count from the largest group in the collection. This is a compromise solution, due to performance constraints - fetching the accurate count, including membership overlaps, from the server would introduce a delay in sending the notification.
Future work: Investigate a better solution?
UI/X(Webapp)TODO - Describe Notifications phase design
The
markdown
component will be modified to usegetAllUserMentionKeys
which contains the union of `getCurrentUserMentionKeys
andgetCurrentUserGroupMentionKeys.
This will ensure that group names will be highlighted for the user as expected.
UI/X(Redux)TODO - Describe Notifications phase design
A new selector will be added to get the list of groups that the current user can be mentioned by:
getCurrentUserGroupMentionKeys
this will be used to determine which @group mentions should be highlighted in the chat facing UI. This selector will be used inside ofgetAllUserMentionKeys
to return the result merged withgetCurrentUserMentionKeys
(which contains regular mentions such as first name / user name etc).
REST API
we will add the following new endpoints:
...
GetMemberCountsByGroup
- returns a slice of ChannelMemberCountByGroup
for a given channel which contains the number of channel members for each group and optionally the number of unique timezones present for each group in the channel
GetMemberUsersInTeam
- returns a slice of users that are members of a group and exist in a team. The intersection of (users in team) & (users in group)
GetMemberUsersNotInChannel
- returns a slice of users that are members of a group that exist in the team that the channel belongs to but do not exist in the channel. The intersection of (users in team) & (users in group) & (users not in channel)
Tickets
Group Mentions - Show a confirmation dialog when mentioning a group with too many users
...