Edgewall Software
Modify

Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#11649 closed enhancement (fixed)

Add description field to ticket enums

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.2
Component: ticket system Version:
Severity: normal Keywords:
Cc: craig_silver@… Branch:
Release Notes:

Added description field to ticket enums.

API Changes:

Description (last modified by Ryan J Ollos)

A description field will be added for each ticket enum. This was discussed in comment:10:ticket:1233.

Attachments (0)

Change History (13)

comment:1 by Ryan J Ollos, 5 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:2 by Craig Silver <craig_silver@…>, 5 years ago

Cc: craig_silver@… added

comment:3 by Ryan J Ollos, 5 years ago

After this ticket is implemented, we should consider creating a macro to list the enums and optionally their descriptions. This would be useful for listing the Resolution descriptions on the TracTicketTriage#StatusandResolution page.

comment:4 by Ryan J Ollos, 5 years ago

Description: modified (diff)

comment:5 by Ryan J Ollos, 5 years ago

Milestone: 1.1.3next-dev-1.1.x
Owner: Ryan J Ollos removed
Status: assignednew

comment:6 by Ryan J Ollos, 5 years ago

#11872 is needed to implement this ticket.

comment:7 by Ryan J Ollos, 4 years ago

Milestone: next-dev-1.1.xnext-dev-1.3.x

Narrowing focus for milestone:1.2. Please move ticket to milestone:1.2 if you intend to fix it.

comment:8 by Ryan J Ollos, 3 years ago

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

Proposed changes in rjollos.git:t11649_enum_description. The "string replace" used to modify the reports is similar to that in db13.py. I've also tried to make the reports for new environments more robust against the need for changes ([cc17233d/rjollos.git]).

Upgrade step documented in 1.3/TracUpgrade@12 and 1.3/TracUpgrade@13.

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

comment:9 by Jun Omae, 3 years ago

At least, enum.name is incorrectly formatted as javascript.

       jQuery(document).ready(function($) {
         $("#description").autoPreview("${href.wiki_render()}", {
             realm: "${enum.type}",
-            id: "${enum.name}"
+            id: ${to_json(enum.name)|safe}
           }, $("#preview").showOnPreview());
       });

in reply to:  9 comment:10 by Ryan J Ollos, 3 years ago

Replying to Jun Omae:

At least, enum.name is incorrectly formatted as javascript.

       jQuery(document).ready(function($) {
         $("#description").autoPreview("${href.wiki_render()}", {
             realm: "${enum.type}",
-            id: "${enum.name}"
+            id: ${to_json(enum.name)|safe}
           }, $("#preview").showOnPreview());
       });

That would also be true then for other instances in which an arbitrary string is used for id, such as in milestone_edit_form.html?

comment:11 by Jun Omae, 3 years ago

Yes. I think we should check whether it is needed to use to_json or javascript_quote in the following locations.

$ git grep ": *[\"']\${"
trac/ticket/templates/admin_components.html:            realm: "${component.resource.realm}",
trac/ticket/templates/admin_components.html:            id: "${component.resource.id}"
trac/ticket/templates/admin_enums.html:            realm: "${enum.type}",
trac/ticket/templates/admin_enums.html:            id: "${enum.name}"
trac/ticket/templates/admin_versions.html:            realm: "${version.resource.realm}",
trac/ticket/templates/admin_versions.html:            id: "${version.resource.id}"
trac/ticket/templates/milestone_edit_form.html:          realm: "${milestone.resource.realm}",
trac/ticket/templates/milestone_edit_form.html:          id: "${milestone.resource.id}"
trac/ticket/templates/report_edit.html:            realm: "report", id: "${report.id}"
trac/versioncontrol/templates/admin_repositories.html:            realm: "repository",  id: "${reponame}"
trac/versioncontrol/templates/browser.html:                range_min_secs: '${dir.range_min_secs}',
trac/versioncontrol/templates/browser.html:                range_max_secs: '${dir.range_max_secs}'
trac/versioncontrol/templates/revisionlog.html:        var canvas = $('<canvas>').css({width: '${graph.columns * 2}em',
trac/versioncontrol/templates/revisionlog.html:                                        height: '${len(items) * 2}em'})
trac/wiki/templates/wiki_edit.html:              realm: "${page.resource.realm}", id: "${page.resource.id}"

comment:12 by Ryan J Ollos, 3 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in r15933. I'll address the comment:11 changes in #3776.

in reply to:  3 comment:13 by Ryan J Ollos, 3 years ago

Replying to Ryan J Ollos:

After this ticket is implemented, we should consider creating a macro to list the enums and optionally their descriptions. This would be useful for listing the Resolution descriptions on the TracTicketTriage#StatusandResolution page.

This can probably be handled in #11702, or in tickets that follow from that one. I've updated comment:description:ticket:11702 to include consideration of a Ticket enum macro.

Last edited 3 years ago by Ryan J Ollos (previous) (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 as closed 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.