Add missing anchors and hover links when publishing draft replies.
Review Request #11287 — Created Nov. 18, 2020 and submitted
Review Board 3.0 introduced standardized anchors for comments and handy
icons for getting the link to the comment when hovering over, helping
reviewers point to specific comments without digging through the HTML.These were only provided when loading a page, though. When publishing a
draft reply, those anchors and hover links wouldn't be made available.
Although reloading the page would make them appear, it was an annoying
oversight.This change adds in the HTML for these when publishing a reply. To keep
the JavaScript side's logic fairly minimal, we inject the namespaced
prefixes specific to certain types of replies (diff comments, header
replies, etc.) for the anchor in the HTML as a new data attribute, and
fetch that out on the client side. This lets us keep all our logic for
differentiating anchors solely in the server-side templates and template
tags, so that we won't have to further rework the client-side code as we
introduce new types of replies.
JavaScript and Python unit tests passed.
Created replies for reviews headers and footers, diff comments, general
comments, and file attachment comments. Verified that the anchors worked
and that the links took me to the right spot. Also verified that they
matched the anchor names on page reload.
Summary | ID |
---|---|
8c7aced8b6ffb348cdb6a58c8108c58740a8bc81 |
Description | From | Last Updated |
---|---|---|
Since this isn't an es6 file here, we shouldn't have the trailing comma. |
david |