Edgewall Software
Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#13044 closed defect (fixed)

Clone button is missing if the description is empty

Reported by: Jun Omae Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.4
Component: ticket system Version:
Severity: minor Keywords: ticketclone
Cc: Branch:
Release Notes:

Fix ticket clone button missing when ticket description empty.

API Changes:

CoffeeScript 1.x should be used for compiling. The Makefile returns an error if CoffeeScript version is not 1.x.

Internal Changes:

Description


Attachments (0)

Change History (13)

comment:1 by Ryan J Ollos, 6 years ago

Keywords: ticketclone added
Milestone: next-dev-1.3.x1.3.4
Owner: set to Ryan J Ollos
Release Notes: modified (diff)
Status: newassigned

We could change the jQuery selector to also match the br element.

Proposed fix:

  • tracopt/ticket/htdocs/ticketclone.coffee

    diff --git a/tracopt/ticket/htdocs/ticketclone.coffee b/tracopt/ticket/htdocs/ticketclone.coffee
    index a1f5b17c1..e416567e8 100644
    a b $(document).ready () ->  
    8585    _("Cloned from #%(id)s:\n%(description)s",
    8686      id: old_values.id,
    8787      description: quoteText(old_values.description))
    88   $('#ticket .description .searchable').before(clone)
     88  $("#ticket .description").children(".searchable, br").before(clone)
    8989  # clone from comment
    9090  if old_values? and changes?
    9191    addCloneFromComments (c for c in changes when c.cnum? and

comment:2 by Ryan J Ollos, 6 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in r16766.

comment:3 by Ryan J Ollos, 6 years ago

comment:4 by Ryan J Ollos, 6 years ago

There are some missing messages following r16765:

  • trac/locale/messages-js.pot

    diff --git a/trac/locale/messages-js.pot b/trac/locale/messages-js.pot
    index 88b6a8ec9..986b69e9f 100644
    a b msgid ""  
    88msgstr ""
    99"Project-Id-Version: Trac 1.3.4\n"
    1010"Report-Msgid-Bugs-To: trac-dev@googlegroups.com\n"
    11 "POT-Creation-Date: 2018-07-19 16:31-0700\n"
     11"POT-Creation-Date: 2018-07-29 11:30-0700\n"
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1414"Language-Team: LANGUAGE <LL@li.org>\n"
    msgstr ""  
    1717"Content-Transfer-Encoding: 8bit\n"
    1818"Generated-By: Babel 2.6.0\n"
    1919
    20 #: tracopt/ticket/htdocs/ticketclone.js:22
    21 msgid "Clone"
    22 msgstr ""
    23 
    24 #: tracopt/ticket/htdocs/ticketclone.js:34
     20#: tracopt/ticket/htdocs/ticketclone.js:61
    2521msgid "Create a new ticket from this comment"
    2622msgstr ""
    2723
    28 #: tracopt/ticket/htdocs/ticketclone.js:41
     24#: tracopt/ticket/htdocs/ticketclone.js:70
    2925#, python-format
    3026msgid "(part of #%(ticketid)s) %(summary)s"
    3127msgstr ""
    3228
    33 #: tracopt/ticket/htdocs/ticketclone.js:47
     29#: tracopt/ticket/htdocs/ticketclone.js:76
    3430#, python-format
    3531msgid ""
    3632"Copied from [%(source)s]:\n"
    3733"%(description)s"
    3834msgstr ""
    3935
    40 #: tracopt/ticket/htdocs/ticketclone.js:59
     36#: tracopt/ticket/htdocs/ticketclone.js:89
    4137msgid "Create a copy of this ticket"
    4238msgstr ""
    4339
    44 #: tracopt/ticket/htdocs/ticketclone.js:60
     40#: tracopt/ticket/htdocs/ticketclone.js:90
    4541#, python-format
    4642msgid "%(summary)s (cloned)"
    4743msgstr ""
    4844
    49 #: tracopt/ticket/htdocs/ticketclone.js:65
     45#: tracopt/ticket/htdocs/ticketclone.js:95
    5046#, python-format
    5147msgid ""
    5248"Cloned from #%(id)s:\n"
    5349"%(description)s"
    5450msgstr ""
    5551
    56 #: tracopt/ticket/htdocs/ticketdeleter.js:16
    57 #: tracopt/ticket/htdocs/ticketdeleter.js:22
    58 msgid "Delete"
    59 msgstr ""
    60 
    61 #: tracopt/ticket/htdocs/ticketdeleter.js:16
    62 msgid "Delete ticket"
    63 msgstr ""
    64 
    65 #: tracopt/ticket/htdocs/ticketdeleter.js:22
    66 #, python-format
    67 msgid "Delete comment %(num)s"
    68 msgstr ""
    69 
    7052#: trac/admin/templates/admin_perms.html:10
    7153msgid "Toggle all"
    7254msgstr ""

Looks like it might be associated with template literals.

in reply to:  4 comment:5 by Ryan J Ollos, 6 years ago

Replying to Ryan J Ollos:

Looks like it might be associated with template literals.

There's an open issue for supporting template literals: https://github.com/python-babel/babel/issues/329

comment:6 by Ryan J Ollos, 6 years ago

Reverting to coffeescript 1.12.7 resolves the issue. That's the only workaround that I know of.

comment:7 by Jun Omae, 6 years ago

According to browser compatibility of template literals, Internet Explorer 11 doesn't support the template literals. I don't think we should use template literals. … Or, we have dropped support of IE 11 for trunk?

in reply to:  7 comment:8 by Ryan J Ollos, 6 years ago

Replying to Jun Omae:

Or, we have dropped support of IE 11 for trunk?

I don't know that we've discussed or made any decision.

I don't care whether we use template literals or not, the issue is that CoffeeScript chooses to use them. Unless a configuration option for CoffeeScript can be found that avoids using them, we will need to continue using Coffee script 1.x to avoid template literals.

Last edited 6 years ago by Ryan J Ollos (previous) (diff)

comment:9 by Ryan J Ollos, 6 years ago

If we stick with CoffeeScript 1.x, maybe we could parse the version in the Makefile and throw an error if the major version is not 1:

$ coffee -version
CoffeeScript version 1.12.7
Last edited 6 years ago by Ryan J Ollos (previous) (diff)

comment:10 by Ryan J Ollos, 6 years ago

In r16790, committed update of compiled CoffeeScript.

Proposed update to Makefile:

  • Makefile

    diff --git a/Makefile b/Makefile
    index 27b2f7a94..5aa5c8036 100644
    a b jinja:  
    365365       $(PYTHON) contrib/jinjachecker.py $(jinjaopts) $(templates)
    366366
    367367coffeescripts ?= $(shell find trac tracopt -name \*.coffee)
    368 coffee_version ?= $(shell coffee -v | sed -E s"|CoffeeScript version ([0-9]+)\.[0-9]+\.[0-9]+|\1|")
     368coffee_version ?= $(shell coffee -v 2> /dev/null | sed -E s"|CoffeeScript version ([0-9]+)\.[0-9]+\.[0-9]+|\1|")
    369369
    370370coffee:
    371371ifneq "$(coffee_version)" "1"

Tested with:

  • Ubuntu 16.04.1 LTS
  • OSX 10.13.6

comment:11 by Jun Omae, 6 years ago

Looks good to me.

comment:12 by Ryan J Ollos, 6 years ago

Thanks for review. Committed to trunk in r16794.

comment:13 by Ryan J Ollos, 6 years ago

API Changes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.