Ticket #2821 (closed enhancement: fixed)
Opened 6 years ago
Last modified 5 years ago
Ability to customize column results in a filter/query
| Reported by: | aroach@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | high | Milestone: | 0.11 |
| Component: | report system | Version: | 0.9.4 |
| Severity: | normal | Keywords: | custom formatting |
| Cc: | rhind@…,daved@… | ||
| Release Notes: | |||
| API Changes: | |||
Description
Much like when you create a SELECT statement, and you can choose what columns would like to return in the query -- regardless of the constraints for the query -- I'd like to request the ability to select what columns are displayed in a filter.
For example:
SELECT id, summary, component FROM ticket WHERE milestone = 'testmilestone';
Would display id, summary, and component in the recordset.
Now, if I tried this in the filter view, by including "component" I'm introducing another query constraint. In order to have all of the results to display "component", I have to keep adding components until I reach the end. There's no way for me to wildcard (that I'm aware of) because component is a selectbox.
Many thanks.
Attachments
Change History
comment:1 Changed 6 years ago by Russell Hind <rhind@…>
- Cc rhind@… added
comment:2 Changed 6 years ago by David Adler
I second the request. I could imagine a user interface with a series of checkboxes for the user to specify which columns he wants to see in the results.
Related and also useful would be a way to specify globally what custom fields should appear by default in custom queries (and perhaps also in standard reports).
comment:3 Changed 6 years ago by anonymous
- Cc daved@… added
comment:4 Changed 6 years ago by JoshuaFranklin
I would also like to customize column results.
In our project we have different people working on different components, but the components interact. Therefore we have a saved query on our front page that includes several (grouped) components so the different groups can see what's happening with the other group. Showing the component in the results would make this more clear.
comment:5 Changed 5 years ago by cboos
- Milestone set to 1.0
That's an often requested feature, we should implement this one day.
comment:6 Changed 5 years ago by anonymous
As a mitigation, you can make all columns display by using the following patch:
-
trac/ticket/query.py
137 137 138 138 # Only display the first eight columns by default 139 139 # FIXME: Make this configurable on a per-user and/or per-query basis 140 self.cols = cols[:7] 141 if not self.order in self.cols and not self.order == self.group: 140 #self.cols = cols[:7] 141 self.cols = cols 142 #if not self.order in self.cols and not self.order == self.group: 142 143 # Make sure the column we order by is visible, if it isn't also 143 144 # the column we group by 144 self.cols[-1] = self.order145 #self.cols[-1] = self.order 145 146 146 147 return self.cols
comment:7 follow-up: ↓ 10 Changed 5 years ago by alexandra
I second this request. I even tried the same underscore tricks that work for custom formatting for SQL custom reports, of course with no avail. So even just adding this to query language without any UI would be useful.
comment:8 Changed 5 years ago by anonymous
- Keywords custom formatting added
comment:9 Changed 5 years ago by eoin.dunne@…
- Priority changed from normal to high
This feature would be awsome. You could basically do away with the custom reports capability if you could specify which columns to display.
I'm bumping the priority on this issue.
comment:10 in reply to: ↑ 7 Changed 5 years ago by cboos
- Milestone changed from 1.0 to 0.11
comment:11 Changed 5 years ago by writetodan@…
Nice one, i third it.
Trac does seem pretty crippled without the user able to query all info, e.g. if user wants to see the latest updates, but can't sort by update time, since column not visible.
comment:12 Changed 5 years ago by writetodan@…
(Okay latest updates is a bad example - i just found the timeline!)
comment:13 follow-up: ↓ 14 Changed 5 years ago by cboos
- Owner changed from daniel to cboos
- Status changed from new to assigned
comment:14 in reply to: ↑ 13 ; follow-up: ↓ 15 Changed 5 years ago by alexandre.franke@…
comment:15 in reply to: ↑ 14 ; follow-up: ↓ 16 Changed 5 years ago by cboos
Replying to alexandre.franke@gmail.com:
What's more Roadmap uses TracQuery to show open/closed tickets for a milestone. This should also be customizable.
That could be useful for specifying the columns one would like to display. This could perhaps be done with a "[milestone] base_query = ?...<query href>..." setting?
comment:16 in reply to: ↑ 15 ; follow-up: ↓ 17 Changed 5 years ago by anonymous
Replying to cboos:
That could be useful for specifying the columns one would like to display.
Exactly.
This could perhaps be done with a "[milestone] base_query = ?...<query href>..." setting?
Where would you change this setting from?
comment:17 in reply to: ↑ 16 ; follow-up: ↓ 18 Changed 5 years ago by cboos
comment:18 in reply to: ↑ 17 Changed 5 years ago by alexandre.franke@…
Replying to cboos:
This could perhaps be done with a "[milestone] base_query = ?...<query href>..." setting?
Replying to alexandre.franke@gmail.com:
Where would you change this setting from?
Replying to cboos:
A normal TracIni setting in the [milestone] section?
Okay, seems nice.
comment:19 Changed 5 years ago by ecarter
I've thrown together a rough implementation in sandbox/ticket-2821 to get this rolling again. Feedback welcome.
comment:20 Changed 5 years ago by anonymous
- Resolution set to fixed
- Status changed from assigned to closed
Changes merged to trunk. If further enhancements are desired, please open a new ticket.
comment:21 Changed 5 years ago by dharris <dharris+trac@…>
For reference, this merge was in changeset:5413



Not sure if this should be a separate query or not, but we are effectively serving multiple projects from 1 svn repo and 1 trac database. Hence we have components such as:
Project1/Area1
Project1/Area2
Project2/Area1
I'm not up on SQL and like the simple filter interface, but would like to be able to enter freeform text and wildcards for values such as component so rather than having to add multiple component lines to the filer (which may not be updated when new areas are added), I'd like to be able to enter
Project1/*
Cheers
Russell