Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11834 closed enhancement (fixed)

[Patch] add filtering by component to ticket statistics

Reported by: Miguel Ferreira Owned by: Miguel Ferreira
Priority: normal Component: TracTicketStatsPlugin
Severity: normal Keywords: Component, Ticket, Statistics
Cc: Trac Release: 1.0

Description

This patch adds a combo box to the template populated with the Components, and filtering by component functionality to the main python file.

This was a useful feature for us.

Attachments (1)

add_component_filter.diff (8.3 KB) - added by anonymous 10 years ago.
patch for component filtering, two files affected

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by anonymous

Attachment: add_component_filter.diff added

patch for component filtering, two files affected

comment:1 Changed 10 years ago by Ryan J Ollos

Status: newaccepted

Looks good! I will try to get it applied soon.

comment:2 Changed 10 years ago by Ryan J Ollos

I encountered an error on the Ticket Stats page with Trac 1.1.2dev:

Trac detected an internal error:
TypeError: select() takes exactly 2 arguments (3 given)
File "/home/user/Workspace/tracdev/teo-rjollos.git/trac/web/main.py", line 530, in _dispatch_request
  dispatcher.dispatch(req)
File "/home/user/Workspace/tracdev/teo-rjollos.git/trac/web/main.py", line 223, in dispatch
  resp = chosen_handler.process_request(req)
File "/home/user/Workspace/trachacks.git/tracticketstatsplugin/trunk/ticketstats/ticketstats.py", line 163, in process_request
  TicketComponent.select(self.env, show_all)]

The issue is that the second argument to Component.select was db, and it has since been removed: select(cls, env, db=None) -> select(cls, env). This would have had no consequences on Trac 1.0-stable, since the db parameter was deprecated and unused.

Milestone.select has a different signature: select(cls, env, include_completed=True, db=None) (1.0-stable) -> select(cls, env, include_completed=True) (1.2dev).

Also, your patch contained tab characters. You don't want to mix tabs and spaces in Python, and spaces are preferred.

No need to refresh the patch. I'll do some more testing later and commit it.

comment:3 Changed 10 years ago by mpaf98

Good comments and thanks for having a look, I'll also test it with the new trac next week when back in front of a PC. Sorry for the tabs in the patch..

comment:4 Changed 10 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 13989:

Add filtering by component. Patch by mpaf98@…. Fixes #11834.

comment:5 Changed 10 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to Miguel Ferreira

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Miguel Ferreira.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.