#10642 closed defect (fixed)
Rendered ticket action hints don't end with a fullstop
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | lowest | Milestone: | 1.0.2 |
Component: | ticket system | Version: | 0.13dev |
Severity: | minor | Keywords: | grammar |
Cc: | osimons | Branch: | |
Release Notes: |
Add a trailing period to the ticket action hint rendered in the workflow Action box, in the case that the hint is not empty. |
||
API Changes: | |||
Internal Changes: |
Description
The default configuration of Trac trunk renders the hints for a ticket action without a trailing fullstop i.e.
The resolution will be set. Next status will be 'closed'
rather than
The resolution will be set. Next status will be 'closed'.
- ITicketActionController.render_ticket_action_control() documents a single hint should be returned for the action
- [ConfigurableTicketWorkflow.render_ticket_action_control() source:trunk/trac/ticket/default_workflow.py#L329] joins it's multiple hints into one string by performing
'. '.join(hints)
- [Ticket.html source:trunk/trac/ticket/templates/ticket.html#L316] combines multiple hints (presumably in case more that one controller provides an action) by rendering each in a <span>
Ideally the displayed hint(s) would have a fullstop, since they're complete sentences. However th:XmlRpcPlugin currently joins the hints from multiple ITicketActionController by performing ". ".join(hints) + '.'
- so having ConfigurableTicketWorkflow return "The resolution will be set. Next status will be 'closed'." would result in XmlRpcPlugin rendering a double fullstop.
Attachments (0)
Change History (10)
comment:1 by , 13 years ago
Cc: | added |
---|
comment:2 by , 12 years ago
Milestone: | → next-stable-1.0.x |
---|
comment:3 by , 12 years ago
Owner: | set to |
---|
-
trac/ticket/default_workflow.py
diff --git a/trac/ticket/default_workflow.py b/trac/ticket/default_workflow.py index b18336a..0a2bde9 100644
a b Read TracWorkflow for more information (don't forget to 'wiki upgrade' as well) 326 326 else: 327 327 if status != '*': 328 328 hints.append(_("Next status will be '%(name)s'", name=status)) 329 return (this_action['name'], tag(*control), '. '.join(hints) )329 return (this_action['name'], tag(*control), '. '.join(hints) + ".") 330 330 331 331 def get_ticket_changes(self, req, ticket, action): 332 332 this_action = self.actions[action]
seems preferable than having to go through all the hints, adding a "." there and then breaking all the translations for that…
comment:4 by , 12 years ago
Milestone: | next-stable-1.0.x → 1.0.1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Applied in r11386.
comment:5 by , 12 years ago
All right. I've updated RPC plugin in th:changeset:12105 to support either behaviour.
follow-up: 7 comment:6 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Unbelievable, such a small change and I got it wrong ;-)
The last dot should be added only when there are hints, of course. Thanks to Rémy for noticing!
follow-up: 8 comment:7 by , 12 years ago
Replying to cboos:
Unbelievable, such a small change and I got it wrong ;-)
The last dot should be added only when there are hints, of course. Thanks to Rémy for noticing!
Here's a patch to stop the dot from showing up when there are no hints, like the "Leave" action which currently has a stray dot.
-
trac/ticket/default_workflow.py
index 6b087ab..9eb25d0 100644
a b Read TracWorkflow for more information (don't forget to 'wiki upgrade' as well) 326 326 else: 327 327 if status != '*': 328 328 hints.append(_("Next status will be '%(name)s'", name=status)) 329 return (this_action['name'], tag(*control), '. '.join(hints) + "." )329 return (this_action['name'], tag(*control), '. '.join(hints) + "." if hints else '') 330 330 331 331 def get_ticket_changes(self, req, ticket, action): 332 332 this_action = self.actions[action]
comment:8 by , 12 years ago
Milestone: | → 1.0.2 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
Replying to ethan.jucovy@…:
Here's a patch to stop the dot from showing up when there are no hints, like the "Leave" action which currently has a stray dot.
Thanks Ethan, applied in r11703.
comment:9 by , 12 years ago
Release Notes: | modified (diff) |
---|
comment:10 by , 12 years ago
Release Notes: | modified (diff) |
---|
Agree. This is not ideal. As you say, hints should be self-contained full sentences.
For th:XmlRpcPlugin it would be quite trivial to handle this - I can just add fullstop if one isn't present already.
PatchWelcome ;-)