#10742 closed enhancement (fixed)
Comment TracLinks without a ticket id should not be shown in strikethrough
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.2 |
| Component: | rendering | Version: | 0.12-stable |
| Severity: | minor | Keywords: | bitesized, traclinks |
| Cc: | Branch: | ||
| Release Notes: |
Ticket comment TracLinks are only rendered as followable when the resource exists and the user has permission to view the resource. Comment TracLinks are not rendered with strikethrough font when the context is the resource to which they refer. |
||
| API Changes: | |||
| Internal Changes: | |||
Description
As originally discussed in ticket:9981, TracLinks within a ticket such as comment:1 should not be shown in strike-through font. Links pointing to other tickets, such as comment:1ticket:9981, should be shown in strike-through font, which was the intent of #9981.
Attachments (3)
Change History (20)
follow-ups: 7 8 comment:1 by , 13 years ago
by , 13 years ago
| Attachment: | t10742-r11086-1.patch added |
|---|
Patch again r11086 of the trunk to address items (1) through (3).
comment:2 by , 13 years ago
The second patch I'm posting addresses items (1) through (5). I plan to spend some more time with it tomorrow evening, but it is currently passing the unit tests, so I thought it would be worthwhile to post it for feedback.
by , 13 years ago
| Attachment: | t10742-r11086-2.patch added |
|---|
Patch again r11086 of the trunk to address items (1) through (5).
comment:3 by , 13 years ago
| Keywords: | bitesized added; bitsized removed |
|---|
comment:5 by , 13 years ago
| Milestone: | next-stable-1.0.x → 1.0.2 |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
comment:6 by , 12 years ago
| Keywords: | traclinks added |
|---|---|
| Owner: | changed from to |
| Reporter: | changed from to |
by , 12 years ago
| Attachment: | t10742-r12011-1.patch added |
|---|
comment:7 by , 12 years ago
Replying to Ryan J Ollos <ryano@…>:
I added and modified some tests in trunk/trac/ticket/tests/wikisyntax.py. As best I could determine though, without significant modifications to trunk/trac/wiki/tests/formatter.py it would not be possible to add a test for a comment:N link in
wikisyntax.pysince the tests are setup and executed in a wikipage. The comment here might be relevant, but I don't understand it.
It seems that TracLinks of the form comment:N can easily be tested by using the context parameter with formatter.suite.
follow-up: 12 comment:8 by , 12 years ago
Replying to Ryan J Ollos <ryano@…>:
comment:Nandcomment:N:ticket:Mshould display with classmissing commentwhen ticket M does exist and the user has permission to view ticket M, but comment N does not exist. For example, compare: comment:1 vs comment:100000 and comment:1:ticket:1 vs comment:10000:ticket:1 - the latter in both comparisons the latter example should display as a missing link.
The comment class can't be used for TracLinks since it is already used on the ticket page for the div that encloses the comment text. I've added the class ticket-comment instead. I wonder though whether there is any value in adding this class, or whether I should just use the ticket class for TracLinks prefixed with ticket: or comment:.
I plan to give this another thorough review in the next day or so, but the latest proposed changes can be found in rjollos.git:t10742.
comment:9 by , 12 years ago
LGTM except 416c4e86/rjollos.git. Many suite.addTest() lines in functionalSuite are commented out.
comment:10 by , 12 years ago
Thanks. Someday maybe I will investigate a way to allow running a single test in a module without resulting to commenting out all of the other tests. I'm bound to make this mistake again!
comment:11 by , 12 years ago
comment:12 by , 12 years ago
Replying to rjollos:
I've added the class
ticket-commentinstead. I wonder though whether there is any value in adding this class, or whether I should just use theticketclass for TracLinks prefixed withticket:orcomment:.
The latest proposed changes can be found in log:rjollos.git:t10742.2. The ticket-comment class has been removed and a test case has been fixed.
comment:13 by , 12 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Committed with minor changes to 1.0-stable in [12126:12135] and merged to trunk in [12136]
comment:14 by , 12 years ago
In case anyone is able to cleanup the commit log messages, [12126] should be prefixed with 1.0.2dev, not 0.0.2dev.
comment:15 by , 12 years ago
| Keywords: | bitesized traclinks → bitesized, traclinks |
|---|
comment:16 by , 12 years ago
| Keywords: | traclink added; traclinks removed |
|---|
comment:17 by , 12 years ago
| Keywords: | traclinks added; traclink removed |
|---|



The patch attempts to resolve a couple of issues:
comment:Nare no longer shown in strike-through font when the enclosing ticket is closed (and neither are TracLinks of the formcomment:N:ticket:M, when present in ticket M).class_=statuswas added to the HTML generated for TracLinks in the comment realm, but that was inconsistent withclass_='%s ticket' % statusthat is applied in_format_linkto the HTML generated for TracLinks in the ticket realm. It doesn't appear this presented any immediate problems.closed ticket, but the test was still passing despite issue (2) because it was testing the markupticket:%s#comment:1, which was actually testing a code pathway through_format_link, not_format_comment_link.I added and modified some tests in trunk/trac/ticket/tests/wikisyntax.py. As best I could determine though, without significant modifications to trunk/trac/wiki/tests/formatter.py it would not be possible to add a test for a comment:N link in
wikisyntax.pysince the tests are setup and executed in a wikipage. The comment here might be relevant, but I don't understand it.Here are some issues I'm considering addressing in a follow-on patch:
comment:N:ticket:Mshould display with classmissing ticketwhen ticket M does not exist or the user doesn't have permission to view ticket M. For example, compare: ticket:100000 vs comment:1:ticket:100000 - the latter should display as a missing link.comment:Nandcomment:N:ticket:Mshould display with classmissing commentwhen ticket M does exist and the user has permission to view ticket M, but comment N does not exist. For example, compare: comment:1 vs comment:100000 and comment:1:ticket:1 vs comment:10000:ticket:1 - the latter in both comparisons the latter example should display as a missing link.