Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12367 closed enhancement (fixed)

Manage project components from the standard Trac component admin panel

Reported by: Cinc-th Owned by: Cinc-th
Priority: low Component: SimpleMultiProjectPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

The association of components with projects should be done using the standard Trac Components admin panel. The chosen projects should be visible in the default components table.

It's a little bit confusing to have a second Components panel just for that in the Manage Projects section.

Attachments (9)

wrongCol.PNG (5.9 KB) - added by falkb 9 years ago.
wrongCol-withEmptyRow.PNG (6.8 KB) - added by falkb 9 years ago.
wrongCol-withEmptyRow2.PNG (7.0 KB) - added by falkb 9 years ago.
admin_filter.py (20.9 KB) - added by Cinc-th 9 years ago.
Possible fix for misaligned help text
text-pos-issue.PNG (18.4 KB) - added by falkb 9 years ago.
admin_filter.2.py (20.9 KB) - added by Cinc-th 9 years ago.
Next try for text position.
text-pos-issue2.PNG (6.3 KB) - added by falkb 9 years ago.
admin_filter.3.py (20.9 KB) - added by Cinc-th 9 years ago.
Text with style="clear:both"
ticket12367_booloption.patch (3.4 KB) - added by Ryan J Ollos 9 years ago.

Download all attachments as: .zip

Change History (53)

comment:1 Changed 9 years ago by Cinc-th

Owner: changed from falkb to Cinc-th
Status: newaccepted

[14600]: added project column to components table of Tracs component admin panel to show the associations.

comment:2 Changed 9 years ago by Cinc-th

[14601]: associate projects and components using the components panel of Trac. The SMP components panel is still available.


@falkb: Should we remove the component panel in the Manage Projects section now?

comment:3 Changed 9 years ago by falkb

Today I tested your SmpFilterDefaultComponentPanels and it works almost perfect. Good job!

I just saw this issue, maybe you can have a look at this:

Changed 9 years ago by falkb

Attachment: wrongCol.PNG added

comment:4 Changed 9 years ago by falkb

Furthermore, I have about 50 projects which makes the first (gray) table very large. This is another place where a multi-selection dropdown list (see #11162) would be much cooler :-)

comment:5 in reply to:  3 ; Changed 9 years ago by Cinc-th

Replying to falkb:

Today I tested your SmpFilterDefaultComponentPanels and it works almost perfect. Good job!

I just saw this issue, maybe you can have a look at this:

Hmm, that's strange. You mention another plugin adding a column in #12373. Does this problem still show when that plugin is disabled?

What's a little puzzling is that there is no data in that malformed row at all... It may be that the row is inserted after SMP did it's job inserting the column.

comment:6 Changed 9 years ago by Cinc-th

In 14631:

Put project table in a div with scrollbars to improve handling of huge project lists. Refs #12367.

comment:7 in reply to:  5 Changed 9 years ago by falkb

Replying to Cinc-th:

Replying to falkb:

Today I tested your SmpFilterDefaultComponentPanels and it works almost perfect. Good job!

I just saw this issue, maybe you can have a look at this:

Hmm, that's strange. You mention another plugin adding a column in #12373. Does this problem still show when that plugin is disabled?

No. If I disable ComponentHierarchyPlugin, everything is fine again. Now I know why the radiobutton is in the 'owner' (='Verantwortlicher') column. It's that current misbehavior that when 2 plugins want to add columns to that table, the table columns get mixed up somehow, no idea why. You can see in the second row that "PC Software" is also in the wrong column, it should be in 'Parent'.

That was the reason why I kept a separate component page for SimpleMultiProjectPlugin. If we can fix this mixup, nothing will stand in the way to move everything to the regular component Admin page.

comment:8 Changed 9 years ago by falkb

The empty row in the screenshot is just because we want to allow to keep the component field empty.

comment:9 in reply to:  6 Changed 9 years ago by falkb

Replying to Cinc-th:

In 14631: Put project table in a div with scrollbars to improve handling of huge project lists.

works well

comment:10 Changed 9 years ago by Cinc-th

In 14639:

When injecting content in a stream accept <td> tags with or without 'xhtml' namespace. Fixes missing column content when ComponentHierarchyPlugin is installed. Refs #12367.

comment:11 Changed 9 years ago by falkb

After update to [14639] it's still displayed mixed up like in the screenshot above. The content of column 'parent' is in column 'owner'.

Changed 9 years ago by falkb

Attachment: wrongCol-withEmptyRow.PNG added

comment:12 in reply to:  11 ; Changed 9 years ago by Cinc-th

Replying to falkb:

After update to [14639] it's still displayed mixed up like in the screenshot above. The content of column 'parent' is in column 'owner'.

How do you manage to create a component without a name?

comment:13 in reply to:  11 Changed 9 years ago by Cinc-th

Replying to falkb:

After update to [14639] it's still displayed mixed up like in the screenshot above. The content of column 'parent' is in column 'owner'.

Try this patch:

  • trunk/simplemultiproject/admin_filter.py

     
    5959            else:
    6060                if mark == 'INSIDE' and kind == 'START' and data[0].localname == 'input':
    6161                    if data[1].get('type') == u"checkbox":
    62                         self._value = data[1].get('value')
     62                        self._value = data[1].get('value') or data[1].get('name')
    6363                yield event
    6464

comment:14 in reply to:  12 Changed 9 years ago by falkb

Replying to Cinc-th:

Replying to falkb:

After update to [14639] it's still displayed mixed up like in the screenshot above. The content of column 'parent' is in column 'owner'.

How do you manage to create a component without a name?

I tried to remember but I can't say. Maybe we tweaked the db manually, just to force the user to select a component on ticket creation.

Changed 9 years ago by falkb

Attachment: wrongCol-withEmptyRow2.PNG added

comment:15 Changed 9 years ago by falkb

Thanks, your patch of comment:13 improves it as you can see in attachment:wrongCol-withEmptyRow2.PNG​ . I wonder if it's also possible to move column name to be the first right next to the checkbox column (?)...

comment:16 in reply to:  15 ; Changed 9 years ago by Cinc-th

Replying to falkb:

I wonder if it's also possible to move column name to be the first right next to the checkbox column (?)...

You mean swapping the position of Restrict to Project and name?

comment:17 in reply to:  16 Changed 9 years ago by falkb

Replying to Cinc-th:

You mean swapping the position of Restrict to Project and name?

exactly

comment:18 Changed 9 years ago by falkb

I also noticed the little issue that the text "Please select the projects for which this component will be visible. ..." is on the right-hand side of the upper table if I resize the browser to the full screen width.

comment:19 in reply to:  15 Changed 9 years ago by Cinc-th

Replying to falkb:

Thanks, your patch of comment:13 improves it as you can see in attachment:wrongCol-withEmptyRow2.PNG​.

Please attach the html source of the first row of your broken table like this:

<tbody>
                <tr>
                  <td class="sel"><input name="sel" value="AAA" type="checkbox"></td><td></td>
                  <td class="name">
                    <a href="/Foo/admin/ticket/components/AAA">AAA</a>
                  </td>
                  <td class="owner"></td><td class="parent">Aaaa</td>
                  <td class="default">
                    <input name="default" value="AAA" type="radio">
                  </td>
                </tr><tr>
                  <td class="sel"><input name="sel" value="Aaaa" type="checkbox"></td><td></td>
                  <td class="name">
                    <a href="/Foo/admin/ticket/components/Aaaa">Aaaa</a>
                  </td>
                  <td class="owner"></td><td class="parent">HW</td>
                  <td class="default">
                    <input name="default" value="Aaaa" type="radio">
                  </td>
                </tr>

comment:20 Changed 9 years ago by falkb

 <thead>
                <tr><th class="sel">&nbsp;</th><th>Restricted to Project</th>
                  <th>Name</th><th>Parent</th><th>Owner</th><th>Default</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td class="sel"><input name="sel" value="" type="checkbox"></td><td></td>
                  <td class="name">
                    <a href="/Foo/admin/ticket/components/"></a>
                  </td>
                  <td class="owner"></td>
                  <td class="default">
                    <input name="default" value="" checked="checked" type="radio">
                  </td>
                </tr><tr>
                  <td class="sel"><input name="sel" value="Abc" type="checkbox"></td><td></td>
                  <td class="name">
                    <a href="/Foo/admin/ticket/components/Abc">Abc</a>
                  </td><td class="parent">Browser: IE8</td>
                  <td class="owner"></td>
                  <td class="default">
                    <input name="default" value="Abc" type="radio">
                  </td>
                </tr><tr>

comment:21 Changed 9 years ago by Cinc-th

Thanks for the dump. The parent column is missing which should have been inserted by ComponentHierarchyPlugin.

Did you apply the patch from ticket #12385?

comment:22 Changed 9 years ago by Cinc-th

In 14640:

Insert project column even when component has no name. Refs #12367.

comment:23 Changed 9 years ago by Cinc-th

Improved the patch in #12385. Should fix the issue at last.

comment:24 in reply to:  23 Changed 9 years ago by falkb

Replying to Cinc-th:

Improved the patch in #12385. Should fix the issue at last.

Yes, great, it does fix.

Now only 2 issues remain:

comment:25 Changed 9 years ago by Cinc-th

In 14641:

Insert project column after the name column of a version/milestone/component. Refs #12367:comment:16.

comment:26 in reply to:  18 Changed 9 years ago by Cinc-th

Replying to falkb:

I also noticed the little issue that the text "Please select the projects for which this component will be visible. ..." is on the right-hand side of the upper table if I resize the browser to the full screen width.

I can't see that. It's probably some CSS/Browser issue. Please provide some screenshot so I know more precisely what's the problem. It's perfectly aligned over here with FF 38.0.5.

Changed 9 years ago by Cinc-th

Attachment: admin_filter.py added

Possible fix for misaligned help text

comment:27 Changed 9 years ago by Cinc-th

Try the attached admin_filter.py for an easy fix. That one puts the help text below the table.

Changed 9 years ago by falkb

Attachment: text-pos-issue.PNG added

Changed 9 years ago by Cinc-th

Attachment: admin_filter.2.py added

Next try for text position.

Changed 9 years ago by falkb

Attachment: text-pos-issue2.PNG added

comment:28 Changed 9 years ago by falkb

<div id="tabcontent">
    <h2>Manage Components <span class="trac-count">(45)</span></h2>
        <form class="addnew" id="addcomponent" method="post" action=""><div><input name="__FORM_TOKEN" value="ceef8caf60d835b7e76262e4" type="hidden"></div>
          <fieldset>
            <legend>Add Component:</legend>
            <div class="field">
              <label>Name: <input name="name" type="text"></label>
            </div>
      <div class="field">
        <label>Owner:
            <input name="owner" value="" type="text">
        </label>
      </div><div style="overflow:hidden;">
<div style="float:left">
<p class="help">Please select the projects for which this component will be visible. Selecting nothing leaves
 this component visible for all projects.</p>
</div>
<div class="admin-smp-proj-tbl-div">
<table id="projectlist" class="listing admin-smp-project-table">
    <thead>
        <tr><th></th><th>Project</th></tr>
    </thead>
    <tbody>
    <tr>
        <td class="name">
            <input name="sel" value="1" type="checkbox">
        </td>
        <td>aaa1</td>
    </tr><tr>
        <td class="name">
            <input name="sel" value="23" type="checkbox">
        </td>
        <td>aaa2</td>
    </tr><tr>

comment:29 Changed 9 years ago by falkb

It's with Trac-1.0.4 with FF 31.1.1

comment:30 Changed 9 years ago by falkb

Probably, just a line-break is missing between text and table because it looks fine if I use a smaller browser window width.

Last edited 9 years ago by falkb (previous) (diff)

Changed 9 years ago by Cinc-th

Attachment: admin_filter.3.py added

Text with style="clear:both"

comment:31 Changed 9 years ago by Cinc-th

The Text on the left side as shown in text-pos-issue2.PNG is what I expected :-/. I'm not the CSS guru but admin_filter.3.py may fix it.

comment:32 Changed 9 years ago by falkb

Yezzzz! Now it's perfect. (y)

BTW: Testing around with the component hierarchy I noticed a traceback as I tried to change a parent of a component... *sigh*

comment:33 in reply to:  32 Changed 9 years ago by falkb

Replying to falkb:

Yezzzz! Now it's perfect. (y)

BTW: Testing around with the component hierarchy I noticed a traceback as I tried to change a parent of a component... *sigh*

but I think that's another story

comment:34 Changed 9 years ago by Cinc-th

In 14643:

Add style clear:both; to help div to make sure it doesn't float next to the project table.. Refs #12367.

comment:35 Changed 9 years ago by Cinc-th

Hi falkb,

please test this final version. If it works we are probably done :-).

comment:36 Changed 9 years ago by falkb

Tested with 0.12 and 1.0, and also with having ComponentHierarchyPlugin active on the same config page. Works great! Cinc-th, you can remove the Admin->projects->components page and close this ticket.

comment:37 in reply to:  8 Changed 9 years ago by falkb

Replying to falkb:

The empty row in the screenshot is just because we want to allow to keep the component field empty.

... remembered it was a fast hack to allow removing a parent component by simply choosing the empty component :) ...

comment:38 Changed 9 years ago by Cinc-th

Keywords: testing added

comment:39 Changed 9 years ago by Cinc-th

In 14966:

Hide admin panel used in the past to link projects and components. It may be shown by setting

[simple-multi-project]
legacy_component_panel = True

in trac.ini

Refs #12367.

comment:40 Changed 9 years ago by Ryan J Ollos

If you were to define a BoolOption on the SmpComponentAdminPanel class then you'd implicitly have documentation for the legacy_component_panel option on the TracIni page. Untested patch is attached.

The more common pattern though is to just enable/disable components using the plugin admin panel rather than adding a redundant option.

Changed 9 years ago by Ryan J Ollos

comment:41 Changed 9 years ago by Cinc-th

Thanks for the more elaborate patch. This option is just some temporary solution. The panel will be completely removed in the near future so no heavy thinking went into the code.

comment:42 Changed 9 years ago by Cinc-th

In 14971:

More Trac-like implementation for panel hiding thanks to a patch by rjollos.

Refs #12367.

comment:43 Changed 9 years ago by Cinc-th

Resolution: fixed
Status: acceptedclosed

In 15017:

Legacy component admin panel removed.

Fixes #12367

comment:44 Changed 9 years ago by falkb

Keywords: testing removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Cinc-th.
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.