launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #02115
[Merge] lp:~edwin-grubbs/launchpad/bug-677511-bad-invited-members-link into lp:launchpad
Edwin Grubbs has proposed merging lp:~edwin-grubbs/launchpad/bug-677511-bad-invited-members-link into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Summary
-------
Changed the "invited members" link that is created when the ajax "Add
member" picker changes the number of invited members from zero to one.
In this case the javascript must create the link instead of just
modifying the count in front of the link. It was using an absolute url
of "/+members#invited", but it needed to be a relative link
"+members#invited" so that it would resolve to
"/$TEAM/+members#invited".
Tests
-----
./bin/test -vv --layer RegistryWindmillLayer -t test_addmember
Demo and Q/A
------------
* Log in as a user without admin priveleges.
* Open http://launchpad.dev/people/+newteam
* After creating the team, click on the
* Click on the "Add member" ajax link.
* Select a team.
* A link to "invited members" should appear at the top of the
portlet.
* Click on it, and you should not get an error that the page cannot
be found.
Lint
----
None.
--
https://code.launchpad.net/~edwin-grubbs/launchpad/bug-677511-bad-invited-members-link/+merge/42905
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~edwin-grubbs/launchpad/bug-677511-bad-invited-members-link into lp:launchpad.
=== modified file 'lib/lp/registry/javascript/team.js'
--- lib/lp/registry/javascript/team.js 2010-12-01 21:28:52 +0000
+++ lib/lp/registry/javascript/team.js 2010-12-07 04:23:45 +0000
@@ -93,7 +93,7 @@
'<span>, </span>'));
count_box.append(count_elem);
count_box.append(Y.Node.create(
- '<span> <a href="/+members#invited">' +
+ '<span> <a href="+members#invited">' +
'invited members</a></span>'));
} else {
var count = count_elem.get('innerHTML');
@@ -134,4 +134,5 @@
};
}, '0.1', {requires: [
- 'node', 'lazr.anim', 'lp.app.picker', 'lp.app.errors', 'lp.client.plugins']});
+ 'node', 'lazr.anim', 'lp.app.picker', 'lp.app.errors', 'lp.client.plugins'
+ ]});
=== modified file 'lib/lp/registry/windmill/tests/test_team_index.py'
--- lib/lp/registry/windmill/tests/test_team_index.py 2010-10-18 12:56:47 +0000
+++ lib/lp/registry/windmill/tests/test_team_index.py 2010-12-07 04:23:45 +0000
@@ -65,6 +65,13 @@
xpath=invited_count_xpath,
validator="1")
+ # Verify that there is now a relative link to
+ # "+members#invited", which is equivalent to
+ # "~testing-spanish-team/+members#invited".
+ self.client.asserts.assertNode(
+ xpath='//*[@id="membership-counts"]'
+ '//a[@href="+members#invited"]')
+
def test_suite():
return unittest.TestLoader().loadTestsFromName(__name__)