Edgewall Software
Modify

Opened 15 years ago

Last modified 13 years ago

#7895 new enhancement

Issue: Custom Query Shows All Milestones Closed and Active

Reported by: minhthel@… Owned by:
Priority: normal Milestone: unscheduled
Component: general Version: none
Severity: normal Keywords:
Cc: ismael@…, kirean@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I realize this maybe intentional but it occured to me that when I do a custom query and search by milestone, EVERY milestone is shown in the dropdown. I understand it was meant to be exhaustive but the list is growing and growing after each successive release.

Would be great to only show current/active milestones in the dropdown as default but also, if needed, through a checkbox be able to show all milestones.

Attachments (5)

select_group_milestones.diff (6.9 KB ) - added by Ismael de Esteban <ismael@…> 14 years ago.
Put milestones in select groups like ticket view. Make some tests to fail.
select_group_milestones_correct.diff (6.7 KB ) - added by Ismael de Esteban <ismael@…> 14 years ago.
This is the correct diff, the other one has two extra lines where ordered alphabetically the milestones 'By due date', that fits better my organization
order_milestones_custom_query_view_V2.patch (6.8 KB ) - added by Ismael de Esteban <ismael@…> 14 years ago.
Found a bug in the last one. Uploading patch with fixed bug.
order_milestones_custom_query_view_V3.patch (8.1 KB ) - added by Ismael de Esteban <ismael@…> 14 years ago.
Bugfix: Not showing group by Milestone. Following coding standards.
7895-group-milestones-r10139.patch (6.8 KB ) - added by Remy Blank 14 years ago.
Group milestones in the ticket query selectors.

Download all attachments as: .zip

Change History (26)

comment:1 by Remy Blank, 15 years ago

Milestone: 0.12next-major-0.1X

comment:2 by Remy Blank, 15 years ago

Milestone: next-major-0.1X1.0

Sorry, wrong milestone.

comment:3 by Christian Boos, 14 years ago

Milestone: 1.0unscheduled

Milestone 1.0 deleted

by Ismael de Esteban <ismael@…>, 14 years ago

Put milestones in select groups like ticket view. Make some tests to fail.

comment:4 by Ismael de Esteban <ismael@…>, 14 years ago

Cc: ismael@… added

comment:5 by Remy Blank, 14 years ago

Milestone: triaging0.13
Owner: set to Remy Blank
Priority: normalhigh

Using the same grouping as in the milestone field of tickets might indeed be a good idea. I'll test the patch.

by Ismael de Esteban <ismael@…>, 14 years ago

This is the correct diff, the other one has two extra lines where ordered alphabetically the milestones 'By due date', that fits better my organization

by Ismael de Esteban <ismael@…>, 14 years ago

Found a bug in the last one. Uploading patch with fixed bug.

comment:6 by Christian Boos, 14 years ago

Thanks for working on this, but please have a look at our TracDev/CodingStyle first. In particular, it seems you have a mix of tabs and spaces, use spaces only. Also, use more appropriate variable names (e.g. sel instead of e for the <select>).

comment:7 by Erik Andersson <kirean@…>, 14 years ago

Are you working on Would be great to only show current/active milestones in the dropdown as default but also, if needed, through a checkbox be able to show all milestones. or Put milestones in select groups like ticket view.? Or a mix of both?

in reply to:  6 ; comment:8 by Ismael de Esteban <ismael@…>, 14 years ago

Replying to cboos:

Thanks for working on this, but please have a look at our TracDev/CodingStyle first. In particular, it seems you have a mix of tabs and spaces, use spaces only. Also, use more appropriate variable names (e.g. sel instead of e for the <select>).

I'll have a look at it.

in reply to:  7 comment:9 by Ismael de Esteban <ismael@…>, 14 years ago

Replying to Erik Andersson <kirean@…>:

Are you working on Would be great to only show current/active milestones in the dropdown as default but also, if needed, through a checkbox be able to show all milestones. or Put milestones in select groups like ticket view.? Or a mix of both?

I think the proper solution is a mix of both: Hide optionally the completed milestones and show grouped and ordered the active ones. I'm only doing Put milestones in select groups like ticket view.

Don't mind if this patch is discarded in the end, but it can be a solution patch for the meantime, or some start point for the desired solution.

comment:10 by Erik Andersson <kirean@…>, 14 years ago

Cc: kirean@… added

in reply to:  8 ; comment:11 by Ismael de Esteban <ismael@…>, 14 years ago

Replying to Ismael de Esteban <ismael@…>:

Replying to cboos:

Thanks for working on this, but please have a look at our TracDev/CodingStyle first. In particular, it seems you have a mix of tabs and spaces, use spaces only. Also, use more appropriate variable names (e.g. sel instead of e for the <select>).

I'll have a look at it.

About the e for <select>, I got it from: http://trac.edgewall.org/browser/trunk/trac/htdocs/js/query.js#L99

How should I proceed?

in reply to:  11 ; comment:12 by Christian Boos, 14 years ago

Replying to Ismael de Esteban <ismael@…>:

… How should I proceed?

Use sel in the new code, don't change the unrelated code. Or better, look at unifying your new createSelectGroup with createSelect, if possible.

by Ismael de Esteban <ismael@…>, 14 years ago

Bugfix: Not showing group by Milestone. Following coding standards.

in reply to:  12 comment:13 by Ismael de Esteban <ismael@…>, 14 years ago

Replying to cboos:

Replying to Ismael de Esteban <ismael@…>:

… How should I proceed?

Use sel in the new code, don't change the unrelated code. Or better, look at unifying your new createSelectGroup with createSelect, if possible.

That's feasible but will obfuscate the code a little I think.

by Remy Blank, 14 years ago

Group milestones in the ticket query selectors.

comment:14 by Remy Blank, 14 years ago

Nice patch, thanks! Adding a whole new "optgroup" field type was not the simplest solution, however. Adding an "optgroup" key to "select" fields makes the code much simpler, and we already do the same on the ticket page. The result is in 7895-group-milestones-r10139.patch.

One difference with the previous behavior is that only milestones for which the user has MILESTONE_VIEW are shown in the selector. Previously, all milestones were shown. This is now consistent with the ticket page.

Please test and let me know if the result is what you expect.

comment:15 by Remy Blank, 14 years ago

Patch applied in [10153].

For the "only show active milestones, and closed milestones with a checkbox", I'm still waiting for UI suggestions / sample implementations.

comment:16 by Remy Blank, 14 years ago

Priority: highnormal

comment:17 by Remy Blank, 14 years ago

[10153] broke the [[TicketQuery()]] macro, due to the permission check in Query.template_data(). This is fixed in [10175].

in reply to:  17 comment:18 by Christian Boos, 14 years ago

Replying to rblank:

[10153] broke the [[TicketQuery()]] macro, due to the permission check in Query.template_data(). This is fixed in [10175].

A better fix would be to use context.perm for the check?

comment:19 by Remy Blank, 14 years ago

Possibly. If req is None, the generated milestone data isn't used anyway, so this won't make a difference. I didn't look much further either, because template_data() mixes plain data generation and side-effects, and would be in need of a good refactoring.

I'll make the change tonight.

comment:20 by Remy Blank, 14 years ago

Better fix in [10198].

comment:21 by Remy Blank, 13 years ago

Milestone: 0.13unscheduled
Owner: Remy Blank removed

No suggestions for the UI of "only show active milestones, and closed milestones with a checkbox", so this moves back to unscheduled.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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