Modify

Opened 3 years ago

Closed 4 weeks ago

Last modified 3 weeks ago

#10060 closed defect (fixed)

Milestone edit via admin UI does not present project link

Reported by: anton@… Owned by: falkb
Priority: high Component: SimpleMultiProjectPlugin
Severity: critical Keywords:
Cc: Trac Release: 0.12

Description

When editing milestones via the standard admin UI, one should be able to link the project in same way as via the milstone view interface.

Also, it seems that duplicate permissions are created (2 of MILESTONE_VIEW, etc) and one can not see from the list which one is intended for which UI.

Attachments (5)

10060_milestone.patch.zip (3.3 KB) - added by Cinc 5 weeks ago.
Patch for #10060: associate milestones with projects using the standard admin panels.
admin_filter.py (6.7 KB) - added by Cinc 5 weeks ago.
Second patch for #10060 to fix messed up main milestone table
admin_filter-comment_26.py (9.0 KB) - added by Cinc 4 weeks ago.
Reworked file allowing milestones without projects. Some bug fixing.
admin_filter-comment_28.py (13.5 KB) - added by Cinc 4 weeks ago.
Add support for version panels. Supersedes the file admin_filter-comment_26.py.
model-comment_28.py (23.3 KB) - added by Cinc 4 weeks ago.
Add support for version panels.

Download all attachments as: .zip

Change History (37)

comment:1 in reply to: ↑ description Changed 3 years ago by falkb

Replying to anton@dsgnit.com:

Also, it seems that duplicate permissions are created (2 of MILESTONE_VIEW, etc) and one can not see from the list which one is intended for which UI.

I can't see duplicate MILESTONE_VIEW permissions with the current version. Are they still duplicated for with the current version?

comment:2 follow-up: Changed 3 years ago by falkb

  • Type changed from defect to enhancement
  • Only part 1 (projects => milestone on Admin panel) must still be implemented.
  • part 2 of this ticket == duplicated permissions => closed(worksforme).

comment:3 in reply to: ↑ 2 Changed 2 years ago by anonymous

Replying to falkb:

  • Only part 1 (projects => milestone on Admin panel) must still be implemented.
  • part 2 of this ticket == duplicated permissions => closed(worksforme).

We are new to Trac and we have a fresh installation of Trac 1.0. The only extra plugins that we have installed are latest SimpleMultiProjectPlugin (r12390) and latest AccountManagerPlugin.

We face also the reported problem "part 1". As a result when we create a new ticket, and we select a Project (other than the default one), then we cannot select any Milestone. Have you reproduced this problem too? As we cannot do it via standard admin GUI, I am wondering if we can do it via any other way, like via trac.ini?

The same problem (as with milestone) exists with versions (When I select a project, other than default, then I cannot select any version except the default one. I just mention it as I do not know if this is by specification or it is a problem.

comment:4 follow-up: Changed 2 years ago by anonymous

before you can select milestones for a ticket of a certain project you must assign the milestone to its project. Go to each milestone (e.g. via roadmap page) and you can assign it to a project there ('Edit milestone' button). After that the milestone will be in the combobox of the ticket.

That 'part 1' will be just a second (maybe more comfortable) way to map milestones to projects.

comment:5 in reply to: ↑ 4 Changed 2 years ago by anonymous

Replying to anonymous:

before you can select milestones for a ticket of a certain project you must assign the milestone to its project. Go to each milestone (e.g. via roadmap page) and you can assign it to a project there ('Edit milestone' button). After that the milestone will be in the combobox of the ticket.

That 'part 1' will be just a second (maybe more comfortable) way to map milestones to projects.

You are 100% correct!!! I did not understand that I can edit it by Roadmap->Milestone(Edit) , I tried via Admin->Milestone(Edit) The same applies to Version too!!

Thanks for your time.

comment:6 Changed 2 years ago by anonymous

My apologies if the wiki description was not clear enough, anyway your problem signals to me wiki:SimpleMultiProjectPlugin does not explain it good enough, although I mentioned it somehow at 'Associate a milestone in a project'...

comment:7 Changed 21 months ago by falkb

  • Owner changed from crossroad to falkb

comment:8 follow-up: Changed 20 months ago by anonymous

  • Priority changed from low to high
  • Severity changed from minor to critical
  • Type changed from enhancement to defect

this is a really serious usability problem with this plugin.. I would probably call it a blocker for realease, if it was my own project

Going through admin/ticket/milestones is the common use case for managing milestones. As it stands, you cannot create a new milestone, and have it be usable by anything unless you magically know to go to the roadmap, find the milestone there and edit it there. There is absolutely no way I can say that with a straight face to any of my developers.

there are three rather serious parts to the issue 1) no way to add a milestone to a project when creating the milestone 2) no way to add a milestone to a project via the milestone admin interface 3) no way to use a milestone if it has not been added to a project

the third part of the issue simply makes it look like your milestone has disappeared into the ether. The correct behaviour is to show all milestones that have not been added to a project, when no project is selected. right now nothing gets shown. Nothing. That is a bug if I ever saw one.

comment:9 in reply to: ↑ 8 Changed 20 months ago by falkb

Replying to anonymous:

this is a really serious usability problem with this plugin..

Thanks for pointing out the importance of this way of managing milestones. I wasn't much aware of this problem because I always used the /roadmap way to add or edit them.

Secondly, it's very difficult for a programmer to hack into the Genshi stream of the Admin web pages for extending the tables there. Either the API is a bit weak for that or I don't know it well enough yet, because I already have another plugin that adds new columns to the table, but there's no safe way to let another plugin also add new columns without messing up the other one. It's technically much easier to implement it via the roadmap page, we simply exchanged the HTML page templates there.

The recommendation about going the way via /roadmap page can be read on the plugin wiki page.

comment:10 Changed 5 weeks ago by Cinc

Hi falkb,

I created a patch to associate milestones and projects from the default Trac admin panel. Since I use a Trac installation (V0.12.x) with a heavily modified custom theme this should be tested against a stock installation of Trac.

The patch is implemented as a component so if something is broken just disable the component SmpFilterDefaultMilestonePanels and you have the standard behaviour.

Maybe this ticket should be closed if everything works ok and a new one opened which tracks the issue for versions.

Changed 5 weeks ago by Cinc

Patch for #10060: associate milestones with projects using the standard admin panels.

comment:11 Changed 5 weeks ago by Cinc

Just found a problem with the main milestone table. You shouldn't apply this patch to the tree yet.

comment:12 Changed 5 weeks ago by falkb

OK, no problem, still awaiting it, I appreciate your work very much!!

comment:13 Changed 5 weeks ago by Cinc

I reworked the code so the table tags are no longer messed up.

Just use this new admin_filter.py instead of the one in the zip file and everything should be just fine.

I created ticket #12119 to track progress for the version pages.

Changed 5 weeks ago by Cinc

Second patch for #10060 to fix messed up main milestone table

comment:14 Changed 5 weeks ago by falkb

  • Status changed from new to accepted

cool :) Having a look now and testing, too

P.S.: this TH server is dog-slow atm (?)

comment:15 Changed 5 weeks ago by falkb

NameError: global name 'milestone' is not defined is issued with this callstack:

...
admin_filter.py", line 95, in filter_stream 
model.py", line 395, in get_all_milestones_with_id_project 

Did I miss something of your two patches?

comment:16 Changed 5 weeks ago by falkb

I suppose you changed model.py also

comment:17 Changed 5 weeks ago by Cinc

The following change in def get_all_milestones_with_id_project(self) is missing in the patch:

===================================================================
--- Requirements-Trac/Trac/Plugins/SimpleMultiProject-0.0.4dev-py2.7.egg/simplemultiproject/model.py	(revision )
+++ Requirements-Trac/Trac/Plugins/SimpleMultiProject-0.0.4dev-py2.7.egg/simplemultiproject/model.py	(revision )
@@ -375,7 +375,7 @@
                    FROM
                         smp_milestone_project;"""
 
-        cursor.execute(query, [milestone])
+        cursor.execute(query)
         return cursor.fetchall()

I'm not on my own system here so I have to create these patches without access to SVN. As you can see this is very error prone...

Maybeyou have to adjust the linenumbers accordingly.

comment:18 Changed 5 weeks ago by falkb

Now admin_filter.py", line 40 which is

self.content = tag.td(self._all_ms_proj[self._value])

errors KeyError: u'mytestmilestone' . This should be a unicode error. Either you are faster or I can have a look tomorrow. Cheers, falkb

comment:19 Changed 5 weeks ago by Cinc

Try this code instead of the line giving the error:

                    # The end of a table column, tag: </td>
                    try:
                        self.content = tag.td(self._all_ms_proj[self._value])
                    except KeyError:
                        # We end up here when the milestone has no project yet
                        self.content = tag.td()

Your milestone seems to have no associated project.

comment:20 Changed 5 weeks ago by Cinc

Ok, there is now a problem with the modify milestone page when haing no project yet. I'm looking into that.

comment:21 Changed 5 weeks ago by falkb

yes, that's right, no project accociated

comment:22 Changed 5 weeks ago by falkb

In 14347:

see #10060: patch by Cinc which adds project accociation functionality to the common milestone Admin table

(@Cinc: Yeah, your comment:19 patch has helped. :-) Now it shows properly. Like++. I still see the problem I'm not able anymore to add milestones without projects, because the "Add" button is disabled then.)

comment:23 Changed 5 weeks ago by Cinc

Hi falkb,

yeah, disabling of the button was on purpose. I'll add a setting to switch that off in the next release of the patch. There are still some rough edges I want to work on. Currently the interface isn't as fool proof as I want it to be.

Stay tuned Cinc

comment:24 Changed 5 weeks ago by falkb

Hi Cinc + all Trac developers,

wishing you all a Merry X-mas! Lets retire for a moment and look forward to a great 2015. I'll be randomly off for a while, this does not mean I'm away...

Cheers, falkb

comment:25 Changed 5 weeks ago by endquote

Thanks Cinc, this is really helpful.

comment:26 Changed 4 weeks ago by Cinc

I think this patch should finally do the job. Removed quite some glitches and bugs.

You may add milestones without a project when setting the following in trac.ini:

[simple-multi-project]
allow_no_project = True

Regards Cinc

Changed 4 weeks ago by Cinc

Reworked file allowing milestones without projects. Some bug fixing.

comment:27 Changed 4 weeks ago by endquote

I'll watch for this to get checked in...

comment:28 Changed 4 weeks ago by Cinc

I added support for the version panels. Was easy enough after figuring out the way to do it.

Sorry for not providing diffs here but only the complete files. The admin_filter.py may replace the last patch completely. This set of files closes #12119.

Changed 4 weeks ago by Cinc

Add support for version panels. Supersedes the file admin_filter-comment_26.py.

Changed 4 weeks ago by Cinc

Add support for version panels.

comment:29 Changed 4 weeks ago by falkb

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

In 14354:

new cool patch by Cinc (thanks a lot!):

  • revised Admin milestone page considering projects now (fixed #10060, fixed #10733)
  • fixed Admin version page also considering project now (fixed #12119)

comment:30 follow-up: Changed 3 weeks ago by endquote

The project list on the query form is empty for me now. https://www.dropbox.com/s/85dxpm0rzcngo5r/Screenshot%202015-01-05%2012.53.32.png

The project list does show up when entering a milestone: https://www.dropbox.com/s/zwr92osx9toxn3m/Screenshot%202015-01-05%2012.55.12.png?dl=0

The project list also shows up on the versions page correctly.

comment:31 in reply to: ↑ 30 Changed 3 weeks ago by falkb

Replying to endquote:

The project list on the query form is empty for me now.

[14359] fixes this issue. Thanks for reporting.

comment:32 Changed 3 weeks ago by endquote

Looks better now, thanks!

Add Comment

Modify Ticket

Action
as closed The owner will remain falkb.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.