Edgewall Software

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#10642 closed defect (fixed)

Rendered ticket action hints don't end with a fullstop — at Version 10

Reported by: Alex Willmer <al.willmer@…> 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'.

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.

Change History (10)

comment:1 by osimons, 12 years ago

Cc: osimons added

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 ;-)

comment:2 by Christian Boos, 12 years ago

Milestone: next-stable-1.0.x

comment:3 by Christian Boos, 12 years ago

Owner: set to Christian Boos
  • 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)  
    326326        else:
    327327            if status != '*':
    328328                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) + ".")
    330330
    331331    def get_ticket_changes(self, req, ticket, action):
    332332        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 Christian Boos, 12 years ago

Milestone: next-stable-1.0.x1.0.1
Resolution: fixed
Status: newclosed

Applied in r11386.

comment:5 by osimons, 12 years ago

All right. I've updated RPC plugin in th:changeset:12105 to support either behaviour.

comment:6 by Christian Boos, 12 years ago

Resolution: fixed
Status: closedreopened

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!

in reply to:  6 ; comment:7 by ethan.jucovy@…, 11 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)  
    326326        else:
    327327            if status != '*':
    328328                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 '')
    330330
    331331    def get_ticket_changes(self, req, ticket, action):
    332332        this_action = self.actions[action]

in reply to:  7 comment:8 by Christian Boos, 11 years ago

Milestone: 1.0.2
Resolution: fixed
Status: reopenedclosed

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 Ryan J Ollos <ryan.j.ollos@…>, 11 years ago

Release Notes: modified (diff)

comment:10 by Ryan J Ollos <ryan.j.ollos@…>, 11 years ago

Release Notes: modified (diff)
Note: See TracTickets for help on using tickets.