Edgewall Software
Modify

Ticket #1198 (closed enhancement: fixed)

Opened 7 years ago

Last modified 3 years ago

User filter for Timeline

Reported by: mrovner@… Owned by: rblank
Priority: high Milestone: 0.12
Component: timeline Version: 0.8
Severity: normal Keywords: user patch
Cc: ijones@…, matthew.bassett@…, hshin@…, wfragg@…, pkou@…, s.lipnevich@…, ealtin@…, metajack@…, m.gilbert@…, hyugaricdeau@…, marcandre.lureau@…, rwargo@…, mat@…, a.a.vykhodtsev@…, tapted@…
Release Notes:
API Changes:

Description (last modified by cboos) (diff)

The two attached patches (to files Timeline.py and timeline.cs) implement user filtering for the Timeline.

If user name is entered in input field, output only lines belonging to that user.

Attachments

Timeline.py.diff (3.8 KB) - added by mrovner@… 7 years ago.
svn diff for ver 1238
timeline.cs.diff (519 bytes) - added by mrovner@… 7 years ago.
svn diff for ver 1238
trac-timeline-author-1198.patch (16.1 KB) - added by davidf@… 4 years ago.
Patch to r7176 (0.11 branch) to enable filtering attachments by author name
1198-timeline-author-filter-r7499.patch (2.7 KB) - added by rblank 3 years ago.
Patch against trunk adding author filtering to timeline
1198-timeline-author-filter-r7499-0.11.patch (3.1 KB) - added by dfraser 3 years ago.
Added version of 0.12 patch that applies cleanly on 0.11

Download all attachments as: .zip

Change History

Changed 7 years ago by mrovner@…

svn diff for ver 1238

Changed 7 years ago by mrovner@…

svn diff for ver 1238

comment:1 Changed 6 years ago by cboos

  • Milestone set to 1.0
  • Owner changed from jonas to cboos

#2487 has been marked as duplicate.

Note that the patches provided on this ticket
are too old for Trac 0.9.

It's not possible to achieve that with
a plugin, either, because the ITimelineEventProvider
currently provide only checkbox filters,
which are only used to conditionally add all
the events provided by that provider.

What would be needed is a new ITimelineEventFilter,
which would see all the events and filter out some of them.

comment:2 Changed 6 years ago by mbass <matthew.bassett@…>

  • Cc mbass added

comment:3 Changed 6 years ago by mbass <matthew.bassett@…>

  • Cc matthew.bassett@… added; mbass removed

comment:4 Changed 6 years ago by mbass <matthew.bassett@…>

  • Cc matthew.bassett@… added; matthew.bassett@… removed

comment:5 Changed 6 years ago by anonymous

  • Cc matthew.bassett@… added; matthew.bassett@… removed

comment:6 Changed 6 years ago by anonymous

  • Cc matthew.bassett@… added; matthew.bassett@… removed

comment:7 Changed 6 years ago by cboos

#843 has been marked as duplicate.

comment:8 Changed 6 years ago by anonymous

  • Cc matthew.bassett@…, hshin@…, wfragg@…, pkou@… added; matthew.bassett@… removed

comment:9 Changed 6 years ago by Russell Hind <rhind@…>

  • Cc rhind@… added

We've just started to have to produce logs for what work we have done each work. The timeline filtered by each user seems like an ideal place for use to be able to look back and see what a user has done.

Thanks

Russell

comment:10 Changed 6 years ago by anonymous

  • Priority changed from normal to high
  • Severity changed from normal to minor
  • Type changed from defect to enhancement

comment:11 Changed 5 years ago by cboos

#4030 was marked as duplicate.

comment:12 Changed 5 years ago by anonymous

  • Cc s.lipnevich@… added

comment:13 Changed 5 years ago by ealtin@…

  • Cc ealtin@… added

comment:14 Changed 5 years ago by cboos

  • Description modified (diff)
  • Keywords user added
  • Milestone changed from 1.0 to 0.11

#4700 marked as duplicate... hm, looking at the CC: list, seems like this feature request is overdue ;)

comment:15 Changed 5 years ago by Jack Moffitt <metajack@…>

  • Cc metajack@… added

comment:16 Changed 5 years ago by anonymous

  • Cc m.gilbert@… added

comment:17 Changed 5 years ago by cboos

A new patch has been contributed for 0.10, see #4964.

comment:18 Changed 5 years ago by cboos

  • Cc hyugaricdeau@… added

Another patch has been contributed for 0.11 in #5242.
I'll test it and quite probably integrate it soon.

comment:19 Changed 5 years ago by anonymous

  • Cc marcandre.lureau@… added

comment:20 Changed 4 years ago by ijones

  • Cc ijones@… added

comment:21 Changed 4 years ago by anonymous

  • Cc rwargo@… added

comment:22 Changed 4 years ago by anonymous

  • Cc mat@… added

comment:23 Changed 4 years ago by trac@…

Is there a version of this that works for 11b1? If so where?

comment:24 Changed 4 years ago by davidf@…

I've just implemented this for latest trac 0.11 svn - it changes the filters API, I'm not sure if this should go into 0.11, but at least I'll make the patch available here for people...

Changed 4 years ago by davidf@…

Patch to r7176 (0.11 branch) to enable filtering attachments by author name

comment:25 Changed 4 years ago by rhind@…

  • Cc rhind@… removed

comment:26 follow-up: Changed 4 years ago by davidf@…

Note that the attached patch should handle filters in the previous format; still I'm not sure what the procedure for updating the API is.

Also, it seems that this could be implemented all inside the timeline code by simply looking at the generated author property that is part of the events tuple. Anyway, it seems to work :-)

comment:27 Changed 4 years ago by eblot

#7460 marked as a duplicate

comment:28 Changed 4 years ago by cboos

  • Milestone changed from 0.11.2 to 0.12
  • Owner cboos deleted
  • Severity changed from minor to normal

As it's not a minor improvement, this should rather be targeted for 0.12 (at least).
People that really want the feature earlier could use the patch (attachment:trac-timeline-author-1198.patch), which still applies cleanly (with some fuzz).

The approach taken in the patch is interesting.
Also, this would need some deeper changes (and maybe even a different approach) to allow for multiple user or even group filtering, which are natural extensions of this feature.

comment:29 Changed 4 years ago by a.a.vykhodtsev@…

  • Cc a.a.vykhodtsev@… added

comment:30 Changed 3 years ago by tapted@…

  • Cc tapted@… added

Changed 3 years ago by rblank

Patch against trunk adding author filtering to timeline

comment:31 in reply to: ↑ 26 Changed 3 years ago by rblank

  • Keywords patch added
  • Owner set to rblank

Replying to davidf@…:

Also, it seems that this could be implemented all inside the timeline code by simply looking at the generated author property that is part of the events tuple.

You know, this is an excellent idea! The patch above does just that.

Please test the patch and report any problems. If there are no objections, I'll apply it to trunk.

comment:32 Changed 3 years ago by osimons

Tested, and works well. +1.

comment:33 Changed 3 years ago by rblank

  • Resolution set to fixed
  • Status changed from new to closed

Patch applied in [7504].

comment:34 follow-up: Changed 3 years ago by lmar

Is this patch actual for the 0.11.2.1 build ? I try to apply this changes to my trac and get:

Trac detected an internal error:
NameError?: global name 'sorted' is not defined
Python Traceback
Most recent call last:
File "/usr/lib/python2.3/site-packages/Trac-0.11.2.1-py2.3.egg/trac/web/main.py", line 433, in _dispatch_request
Code fragment:

try: if not env and env_error: raise HTTPInternalError(env_error) try: dispatcher = RequestDispatcher?(env)

dispatcher.dispatch(req)

except RequestDone?: pass resp = req._response or [] except HTTPException, e:

Local variables:

Name Value
after [u' except RequestDone:', u' pass', u' resp = ...
before [u' try:', u' if not env and env_error:', u' raise ...
dispatcher <trac.web.main.RequestDispatcher? object at 0xb68c52cc>
e <exceptions.NameError? instance at 0xb688faec>
env <trac.env.Environment object at 0xb6da4d0c>
env_error None
exc_info (<class exceptions.NameError? at 0xb6e7e65c>, <exceptions.NameError? ...
filename '/usr/lib/python2.3/site-packages/Trac-0.11.2.1-py2.3.egg/trac/web/main.py' ...
frames [{'function': '_dispatch_request', 'lines_before': [u' try:', u' ...
has_admin True
line u' dispatcher.dispatch(req)'
lineno 432
message u"NameError?: global name 'sorted' is not defined"
req <Request "GET u'/timeline'">
resp []
tb <traceback object at 0xb6887e3c>
tb_hide None
traceback 'Traceback (most recent call last):\n File ...

File "/usr/lib/python2.3/site-packages/Trac-0.11.2.1-py2.3.egg/trac/web/main.py", line 204, in dispatch
Code fragment:

req.args.get('FORM_TOKEN') != req.form_token: raise HTTPBadRequest('Missing or invalid form token. ' 'Do you have cookies enabled?') # Process the request and render the template

resp = chosen_handler.process_request(req)

if resp: if len(resp) == 2: # Clearsilver chrome.populate_hdf(req) template, content_type = \

Local variables:

Name Value
chosen_handler <trac.timeline.web_ui.TimelineModule? object at 0xb68c548c>
chrome <trac.web.chrome.Chrome object at 0xb69843ec>
err (<class exceptions.NameError? at 0xb6e7e65c>, <exceptions.NameError? ...
handler <trac.timeline.web_ui.TimelineModule? object at 0xb68c548c>
req <Request "GET u'/timeline'">
self <trac.web.main.RequestDispatcher? object at 0xb68c52cc>

File "/usr/lib/python2.3/site-packages/Trac-0.11.2.1-py2.3.egg/trac/timeline/web_ui.py", line 172, in process_request

Trac: 0.11.2.1
Python: 2.3.4 (#1, Nov 4 2004, 14:06:56) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)]
setuptools: 0.6c9
SQLite: 2.8.17
pysqlite: 1.0.1
Genshi: 0.5.1
mod_python: < 3.2
jQuery: 1.2.6

comment:35 in reply to: ↑ 34 ; follow-up: Changed 3 years ago by rblank

Replying to lmar:

Is this patch actual for the 0.11.2.1 build ?

No, the patch was applied to trunk. However, the error you get is due to sorted() not being present in Python 2.3. Strangely, that function is called nowhere in the patch above, so the error is probably not due to the patch. Your best bet at this point is to upgrade to Python 2.4.

comment:36 in reply to: ↑ 35 Changed 3 years ago by lmar

Replying to rblank:

No, the patch was applied to trunk. However, the error you get is due to sorted() not being present in Python 2.3. Strangely, that function is called nowhere in the patch above, so the error is probably not due to the patch. Your best bet at this point is to upgrade to Python 2.4.

Yes, it's work on my home system with trac 0.11.2.1 + python 2.5.

Changed 3 years ago by dfraser

Added version of 0.12 patch that applies cleanly on 0.11

comment:37 Changed 3 years ago by debacle@…

The latest patch seems not to work with trac 0.11.1. If I filter for my user name, I still see entries of other users, e.g. changed wiki pages or closed tickets.

comment:38 Changed 3 years ago by debacle@…

Sorry, false alarm: The patch is OK, and I accidently messed with the code. This feature is really nice and should go into 0.11.[something] :~)

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from rblank. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.