Code review comment for lp:~gmb/launchpad/ajaxify-branch-linking

Revision history for this message
Graham Binns (gmb) wrote :

Incremental diff of changes:

=== modified file 'lib/canonical/launchpad/javascript/bugs/bugtask-index.js'
--- lib/canonical/launchpad/javascript/bugs/bugtask-index.js 2009-09-28 10:02:35 +0000
+++ lib/canonical/launchpad/javascript/bugs/bugtask-index.js 2009-09-28 11:01:30 +0000
@@ -634,14 +634,8 @@
  * Set up the link-a-related-branch picker.
  */
 function setup_link_branch_picker() {
- if (lp_client === undefined) {
- lp_client = new LP.client.Launchpad();
- }
-
- if (lp_bug_entry === undefined) {
- var bug_repr = LP.client.cache.bug;
- lp_bug_entry = new LP.client.Entry(
- lp_client, bug_repr, bug_repr.self_link);
+ if (lp_client === undefined || bug_repr === undefined) {
+ setup_client_and_bug();
     }

     var error_handler = new LP.client.ErrorHandler();
@@ -704,21 +698,13 @@
         display_error(Y.get('.menu-link-addsubscriber'), error_msg);
     };

- // Call linkBranch() on the bug and flash the 'add a branch' link
- // accordingly.
+ // Call linkBranch() on the bug.
     config = {
         on: {
             success: function(client) {
- // Show the green flash anim to say the action
- // has completed.
- var anim = Y.lazr.anim.green_flash(
- {node: link_branch_link});
- anim.on('end', function(e) {
- link_branch_link.toggleClass(
- 'update-in-progress-message');
- });
+ link_branch_link.toggleClass(
+ 'update-in-progress-message');
                 anim.run();
- link_branch_link.set('innerHTML', 'Link another branch');
             },
             failure: error_handler.getFailureHandler()
         },

=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py 2009-09-18 22:46:33 +0000
+++ lib/lp/bugs/browser/bug.py 2009-09-28 11:01:30 +0000
@@ -239,10 +239,7 @@

     def addbranch(self):
         """Return the 'Add branch' Link."""
- if self.context.bug.linked_branches.count() > 0:
- text = 'Link another branch'
- else:
- text = 'Link a related branch'
+ text = 'Link a related branch'
         return Link('+addbranch', text, icon='add')

     def linktocve(self):

=== modified file 'lib/lp/bugs/stories/bugs/xx-link-bug-to-branch.txt'
--- lib/lp/bugs/stories/bugs/xx-link-bug-to-branch.txt 2009-09-18 22:46:33 +0000
+++ lib/lp/bugs/stories/bugs/xx-link-bug-to-branch.txt 2009-09-28 11:01:30 +0000
@@ -36,17 +36,6 @@
     lp://dev/~name12/firefox/main (Development)
     ...

-The text "Link a related branch" has now changed to "Link another branch".
-
- >>> user_browser.getLink('Link a related branch')
- Traceback (most recent call last):
- ...
- LinkNotFoundError
-
- >>> user_browser.getLink('Link another branch')
- <Link text='Link another branch'
- url='http://bugs.launchpad.dev/firefox/+bug/1/+addbranch'>
-
 We can delete existing links between a bug and a branch.

     >>> delete_branch_link_url = (

« Back to merge proposal