Commit 2d07b8d2 authored by Georges Racinet's avatar Georges Racinet 🌳
Browse files

Fixing Repository Graph view

Heptapod 0.17 introduced the VCS-agnostic commit
"display id", but was overly optimistic it could replace
the commit ids in the JSON that is returned for
client-side graph rendering. Indeed that JSON uses the
plain ids to represent relationships.

The right thing to do here is to get back to the anterior
way of doing, just using the neutral method that will work
for all types of repositories.

Closes #385

--HG--
branch : heptapod-stable
parent abd2b0306a8c
Pipeline #14729 skipped with stages
...@@ -4,7 +4,7 @@ Raphael.prototype.commitTooltip = function commitTooltip(x, y, commit) { ...@@ -4,7 +4,7 @@ Raphael.prototype.commitTooltip = function commitTooltip(x, y, commit) {
const boxWidth = 300; const boxWidth = 300;
const icon = this.image(gon.relative_url_root + commit.author.icon, x, y, 20, 20); const icon = this.image(gon.relative_url_root + commit.author.icon, x, y, 20, 20);
const nameText = this.text(x + 25, y + 10, commit.author.name); const nameText = this.text(x + 25, y + 10, commit.author.name);
const idText = this.text(x, y + 35, commit.id); const idText = this.text(x, y + 35, commit.hpd_display_id);
const messageText = this.text(x, y + 50, commit.message.replace(/\r?\n/g, ' \n ')); const messageText = this.text(x, y + 50, commit.message.replace(/\r?\n/g, ' \n '));
const textSet = this.set(icon, nameText, idText, messageText).attr({ const textSet = this.set(icon, nameText, idText, messageText).attr({
'text-anchor': 'start', 'text-anchor': 'start',
......
...@@ -28,5 +28,9 @@ def space ...@@ -28,5 +28,9 @@ def space
def parents(map) def parents(map)
map.values_at(*@commit.parent_ids).compact map.values_at(*@commit.parent_ids).compact
end end
def hpd_display_id
@commit.hpd_display_id
end
end end
end end
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
time: c.time, time: c.time,
space: c.spaces.first, space: c.spaces.first,
refs: refs(@graph.repo, c), refs: refs(@graph.repo, c),
id: c.hpd_display_id, id: c.id,
hpd_display_id: c.hpd_display_id,
date: c.date, date: c.date,
message: c.message, message: c.message,
} }
......
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