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