← Back to team overview

launchpad-reviewers team mailing list archive

lp:~wallyworld/launchpad/inconsistent-linked-bug-portlet-1033354 into lp:launchpad

 

Ian Booth has proposed merging lp:~wallyworld/launchpad/inconsistent-linked-bug-portlet-1033354 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1033354 in Launchpad itself: "Inconsistent data displayed in linked bugs portlet"
  https://bugs.launchpad.net/launchpad/+bug/1033354

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/inconsistent-linked-bug-portlet-1033354/+merge/118289

When the branches page is first loaded, the linked bugs portlet contains a list <ul> of linked bugs, displaying the bug title and a remove icon. When a new linked bug is added, the portlet is refreshed using an XHR call and the result is that the portlet now is rendered using a <table> and contains importance and status information for each bug.

It turned out that the same problem was also there for related blueprints.

The fix was trivial. There were TAL macros defined which displayed related bugs and blueprints on the branch page. However, the TAL used for the initial page load ignored these macros and instead rendered some different HTML. The solution was to rip out the inconsistent TAL and replace with macro calls.
-- 
https://code.launchpad.net/~wallyworld/launchpad/inconsistent-linked-bug-portlet-1033354/+merge/118289
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wallyworld/launchpad/inconsistent-linked-bug-portlet-1033354 into lp:launchpad.
=== modified file 'lib/lp/code/templates/branch-related-bugs-specs.pt'
--- lib/lp/code/templates/branch-related-bugs-specs.pt	2012-08-03 12:47:11 +0000
+++ lib/lp/code/templates/branch-related-bugs-specs.pt	2012-08-06 03:51:21 +0000
@@ -7,25 +7,9 @@
   <h3>Related bugs</h3>
   <div id="buglinks" class="actions">
     <div id="buglink-list">
-      <tal:bugs tal:define="branch context;
-                            show_edit python:True;">
-
-        <ul tal:repeat="bugtask view/linked_bugtasks">
-          <li tal:condition="bugtask/required:launchpad.View"
-              tal:define="show_edit show_edit|Nothing"
-              tal:attributes="id string:buglink-${bugtask/bug/id}"
-              class="bug-branch-summary">
-            <tal:buglink content="structure bugtask/fmt:link:bugs" />
-            <tal:buglink-edit condition="show_edit|nothing">
-              <a title="Remove link"
-                 class="delete-buglink"
-                 tal:attributes="href string:+bug/${bugtask/bug/id}/+delete;
-                                 id string:delete-buglink-${bugtask/bug/id}">
-                <img src="/@@/remove" alt="Remove"/>
-              </a>
-            </tal:buglink-edit>
-          </li>
-        </ul>
+      <tal:bugs tal:define="branch context; show_edit python:True;">
+      <metal:bug-branch-links
+              use-macro="branch/@@+macros/bug-branch-links"/>
       </tal:bugs>
     </div>
 
@@ -44,20 +28,8 @@
   <div class="actions">
     <tal:blueprints tal:define="branch context;
                             show_edit python:True;">
-      <ul tal:repeat="spec_branch context/spec_links">
-      <li tal:define="has_edit_permission spec_branch/required:launchpad.AnyPerson;
-                      show_edit show_edit|nothing;
-                      show_edit python: show_edit and has_edit_permission;
-                      spec spec_branch/specification;"
-          class="spec-branch-summary">
-          <tal:link replace="structure spec/fmt:link:blueprints" />
-          <tal:show-edit condition="show_edit|nothing">
-            <a class="sprite edit action-icon"
-              tal:attributes="href spec_branch/fmt:url;">Edit</a>
-          </tal:show-edit>
-        </li>
-
-      </ul>
+        <metal:spec-branch-links
+                use-macro="branch/@@+macros/spec-branch-links"/>
     </tal:blueprints>
     <div
       tal:define="link context_menu/link_blueprint"


Follow ups