Commit 185da5f9 authored by Marin Jankovski's avatar Marin Jankovski

Make sure that at mentioning all properly notifies.

parent 63c1cdce
......@@ -130,7 +130,7 @@ class ProjectsController < ApplicationController
[]
end
team_members = sorted(@project.team.members)
participants = [{ username: "all", name: "Group Members" }] + team_members + participating
participants = [{ username: "all", name: "Project and Group Members" }] + team_members + participating
@suggestions = {
emojis: Emoji.names.map { |e| { name: e, path: view_context.image_url("emoji/#{e}.png") } },
issues: @project.issues.select([:iid, :title, :description]),
......
......@@ -49,6 +49,9 @@ module Mentionable
matches = mentionable_text.scan(/@[a-zA-Z][a-zA-Z0-9_\-\.]*/)
matches.each do |match|
identifier = match.delete "@"
if identifier == "all"
users += project.team.members.flatten
else
if has_project
id = project.team.members.find_by(username: identifier).try(:id)
else
......@@ -56,6 +59,7 @@ module Mentionable
end
users << User.find(id) unless id.blank?
end
end
users.uniq
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