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,12 +49,16 @@ module Mentionable
matches = mentionable_text.scan(/@[a-zA-Z][a-zA-Z0-9_\-\.]*/)
matches.each do |match|
identifier = match.delete "@"
if has_project
id = project.team.members.find_by(username: identifier).try(:id)
if identifier == "all"
users += project.team.members.flatten
else
id = User.where(username: identifier).pluck(:id).first
if has_project
id = project.team.members.find_by(username: identifier).try(:id)
else
id = User.where(username: identifier).pluck(:id).first
end
users << User.find(id) unless id.blank?
end
users << User.find(id) unless id.blank?
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