Commit 18f80c55 authored by Douwe Maan's avatar Douwe Maan

Fix rendering of deleted blocking/blocked-on statuses.

parent bc2dd5e7
...@@ -276,11 +276,18 @@ module Gitlab ...@@ -276,11 +276,18 @@ module Gitlab
if raw_updates.has_key?("blockedOn") if raw_updates.has_key?("blockedOn")
blocked_ons = raw_updates["blockedOn"].map do |raw_blocked_on| blocked_ons = raw_updates["blockedOn"].map do |raw_blocked_on|
name, id = raw_blocked_on.split(":", 2) name, id = raw_blocked_on.split(":", 2)
deleted = name.start_with?("-")
name = name[1..-1] if deleted
text =
if name == project.import_source if name == project.import_source
"##{id}" "##{id}"
else else
"#{project.namespace.path}/#{name}##{id}" "#{project.namespace.path}/#{name}##{id}"
end end
text = "~~#{text}~~" if deleted
text
end end
updates << "*Blocked on: #{blocked_ons.join(", ")}*" updates << "*Blocked on: #{blocked_ons.join(", ")}*"
end end
...@@ -288,11 +295,18 @@ module Gitlab ...@@ -288,11 +295,18 @@ module Gitlab
if raw_updates.has_key?("blocking") if raw_updates.has_key?("blocking")
blockings = raw_updates["blocking"].map do |raw_blocked_on| blockings = raw_updates["blocking"].map do |raw_blocked_on|
name, id = raw_blocked_on.split(":", 2) name, id = raw_blocked_on.split(":", 2)
deleted = name.start_with?("-")
name = name[1..-1] if deleted
text =
if name == project.import_source if name == project.import_source
"##{id}" "##{id}"
else else
"#{project.namespace.path}/#{name}##{id}" "#{project.namespace.path}/#{name}##{id}"
end end
text = "~~#{text}~~" if deleted
text
end end
updates << "*Blocking: #{blockings.join(", ")}*" updates << "*Blocking: #{blockings.join(", ")}*"
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