=== modified file 'lib/canonical/launchpad/javascript/registry/team.js'
--- lib/canonical/launchpad/javascript/registry/team.js 2009-12-18 06:06:30 +0000
+++ lib/canonical/launchpad/javascript/registry/team.js 2009-12-21 20:35:57 +0000
@@ -54,13 +54,14 @@ var members_section, members_ul, count_elem;
if (did_status_change === false) { disable_spinner();
- Y.lp.display_error(
- addmember_link,
+ Y.lp.display_info( selected_person.title + ' is already ' +
- current_status + '.');
+ current_status.toLowerCase() +
+ ' as a member of the team.'); return;
} var is_team = false;
+ current_status = 'foo';
if (current_status == 'Invited') { is_team = true; members_section = box.query('#recently-invited');
@@ -79,6 +80,7 @@ Y.lp.display_error( addmember_link, 'Unexpected status: ' + current_status);
+ return;
} var first_node = members_ul.get('firstChild');
=== modified file 'lib/lp/registry/browser/tests/mailinglist-views.txt'
--- lib/lp/registry/browser/tests/mailinglist-views.txt 2009-12-18 06:04:44 +0000
+++ lib/lp/registry/browser/tests/mailinglist-views.txt 2009-12-21 19:55:45 +0000
@@ -33,8 +33,7 @@
No Privileges Person is added as a member of the Aardvarks.
>>> print extract_text(
... find_tag_by_id(browser.contents, 'recently-approved'))
- Recently approved
+ Latest members
Warty Gnome Team
Daniel Silverstone
Celso Providelo
Steve Alexander...
>>> print extract_text(
- ... find_tag_by_id(browser.contents, 'recently-applied'))
+ ... find_tag_by_id(browser.contents, 'recently-proposed'))
Pending approval
Sample Person
Andrew Bennetts
>>> print extract_text(
+ ... find_tag_by_id(browser.contents, 'recently-invited'))
+ Latest invited
+ Warty Security Team
+
+ >>> print extract_text(
... find_tag_by_id(browser.contents, 'team-owner'))
Owner:
Mark Shuttleworth
@@ -88,14 +93,14 @@
Show received invitations
If the team does not have any recently approved or proposed members,
-the recent members sections are not displayed:
+the recent members sections are hidden using the "unseen" css class:
In the above case there's no user logged in, so it doesn't actually show
what's the user's involvement with the team. If the user logs in, he'll see
@@ -187,7 +192,7 @@
>>> owner_browser = setupBrowser(auth="Basic <email address hidden>:test")
>>> owner_browser.open('http://launchpad.dev/~ubuntu-team')
>>> print extract_text(
- ... find_tag_by_id(owner_browser.contents, 'recently-applied'))
+ ... find_tag_by_id(owner_browser.contents, 'recently-proposed'))
Pending approval
Sample Person
Andrew Bennetts
+An admin can see the former members of the team.
+
+ >>> browser.open('http://launchpad.dev/~name18/+members')
+ >>> print extract_text(
+ ... find_tag_by_id(browser.contents, 'inactivemembers'))
+ Name Joined in Status...
+
+Other users cannot see the former members of the team.
+
+ >>> user_browser.open('http://launchpad.dev/~name18/+members')
+ >>> print find_tag_by_id(user_browser.contents, 'inactivemembers')
+ None
+
Here is the incremental diff that addresses both Salgado's and Martin's comments.
{{{ launchpad/ javascript/ lp/errors. js' launchpad/ javascript/ lp/errors. js 2009-11-23 19:29:02 +0000 launchpad/ javascript/ lp/errors. js 2009-12-21 20:33:38 +0000 flash_node, msg) { flash_node, msg) { error_overlay( ); red_flash( flash_node, function(){
error_ overlay. showError( msg);
=== modified file 'lib/canonical/
--- lib/canonical/
+++ lib/canonical/
@@ -69,7 +69,7 @@
* @param flash_node {Node} The node to red flash.
* @param msg {String} The message to display.
*/
-var display_error = function(
+Y.lp.display_error = function(
create_
maybe_
@@ -77,5 +77,36 @@
});
};
-Y.lp.display_error = display_error; :["lazr. formoverlay" ]}); PrettyOverlay( { @/info- large"/ >Notice< /h2>', render( ); appendChild( Y.Node. create( msg)); create( '<button> OK</button> '); on('click' , function(e) { fire('cancel' ); div.appendChild (ok_button) ; appendChild( button_ div); set('bodyConten t', content); show(); :["lazr. formoverlay" , "lazr.overlay"]});
-}, "0.1", {"requires"
+
+var info_overlay;
+/*
+ * Display the form overlay for non-error informational messages.
+ *
+ * @method display_info
+ * @param msg {String} The message to display.
+*/
+Y.lp.display_info = function(msg) {
+ if (info_overlay === undefined) {
+ info_overlay = new Y.lazr.
+ //headerContent: '<h2><img src="/@
+ centered: true,
+ visible: false
+ });
+ info_overlay.
+ }
+ var content = Y.Node.create(
+ '<div style="background: url(/@@/info-large) no-repeat; ' +
+ 'min-height: 32px; padding-left: 40px; padding-top: 16px"/></div>');
+ content.
+ var button_div = Y.Node.create('<div style="text-align: right"></div>');
+ var ok_button = Y.Node.
+ ok_button.
+ info_overlay.
+ });
+ button_
+ content.
+ info_overlay.
+ info_overlay.
+};
+
+}, "0.1", {"requires"
=== modified file 'lib/canonical/ launchpad/ javascript/ registry/ team.js' launchpad/ javascript/ registry/ team.js 2009-12-18 06:06:30 +0000 launchpad/ javascript/ registry/ team.js 2009-12-21 20:35:57 +0000
var members_section, members_ul, count_elem;
disable_ spinner( );
selected_ person. title + ' is already ' + status. toLowerCase( ) +
return;
var is_team = false;
is_team = true;
members_ section = box.query( '#recently- invited' );
Y.lp.display_ error(
addmember_ link,
'Unexpected status: ' + current_status);
var first_node = members_ ul.get( 'firstChild' );
--- lib/canonical/
+++ lib/canonical/
@@ -54,13 +54,14 @@
if (did_status_change === false) {
- Y.lp.display_error(
- addmember_link,
+ Y.lp.display_info(
- current_status + '.');
+ current_
+ ' as a member of the team.');
}
+ current_status = 'foo';
if (current_status == 'Invited') {
@@ -79,6 +80,7 @@
+ return;
}
=== modified file 'lib/lp/ registry/ browser/ tests/mailingli st-views. txt' registry/ browser/ tests/mailingli st-views. txt 2009-12-18 06:04:44 +0000 registry/ browser/ tests/mailingli st-views. txt 2009-12-21 19:55:45 +0000
--- lib/lp/
+++ lib/lp/
@@ -33,8 +33,7 @@
No Privileges Person is added as a member of the Aardvarks.
>>> no_priv = person_ set.getByEmail( '<email address hidden>') addMember( no_priv, sample_person) tatus.APPROVED, (2) Approved>) addMember( no_priv, sample_person)
- >>> aardvarks.
- (True, <DBItem TeamMembershipS
+ >>> ignored = aardvarks.
But regular members can't access the +mailinglist page.
@@ -54,8 +53,8 @@ .status tatus.APPROVED. .. .setStatus( TeamMembershipS tatus.ADMIN, sample_person) .setStatus( tatus.ADMIN, sample_person)
... no_priv, aardvarks)
>>> team_membership
<DBItem TeamMembershipS
- >>> team_membership
- True
+ >>> ignored = team_membership
+ ... TeamMembershipS
Now No Privileges Person has permission to request mailing lists.
@@ -210,8 +209,7 @@
A non-owner member can see information about the mailing list.
- >>> pmt.addMember( sample_ person, owner) tatus.APPROVED. .. sample_ person, owner) initialized_ view(pmt, '+index')
- (True, <DBItem TeamMembershipS
+ >>> ignored = pmt.addMember(
>>> login('<email address hidden>')
>>> view = create_
>>> print view.archive_url
=== modified file 'lib/lp/ registry/ stories/ team/xx- team-home. txt' registry/ stories/ team/xx- team-home. txt 2009-11-22 15:43:16 +0000 registry/ stories/ team/xx- team-home. txt 2009-12-21 19:53:58 +0000
--- lib/lp/
+++ lib/lp/
@@ -13,19 +13,24 @@
>>> print extract_text( by_id(browser. contents, 'recently- approved' ))
... find_tag_
- Recently approved
+ Latest members
Warty Gnome Team
Daniel Silverstone
Celso Providelo
Steve Alexander...
>>> print extract_text( by_id(browser. contents, 'recently- applied' )) by_id(browser. contents, 'recently- proposed' ))
- ... find_tag_
+ ... find_tag_
Pending approval
Sample Person
Andrew Bennetts
>>> print extract_text( by_id(browser. contents, 'recently- invited' )) by_id(browser. contents, 'team-owner'))
+ ... find_tag_
+ Latest invited
+ Warty Security Team
+
+ >>> print extract_text(
... find_tag_
Owner:
Mark Shuttleworth
@@ -88,14 +93,14 @@
Show received invitations
If the team does not have any recently approved or proposed members,
-the recent members sections are not displayed:
+the recent members sections are hidden using the "unseen" css class:
>>> browser.open('http:// launchpad. dev/~launchpad') by_id(browser. contents, 'recently- approved' ) approved" ... class="unseen">...
>>> print find_tag_
- None
+ <td id="recently-
- >>> print find_tag_ by_id(browser. contents, 'recently-applied') by_id(browser. contents, 'recently- proposed' ) proposed" class="unseen">...
- None
+ >>> print find_tag_
+ <td id="recently-
In the above case there's no user logged in, so it doesn't actually show auth="Basic <email address hidden>:test") open('http:// launchpad. dev/~ubuntu- team') by_id(owner_ browser. contents, 'recently- applied' )) by_id(owner_ browser. contents, 'recently- proposed' ))
what's the user's involvement with the team. If the user logs in, he'll see
@@ -187,7 +192,7 @@
>>> owner_browser = setupBrowser(
>>> owner_browser.
>>> print extract_text(
- ... find_tag_
+ ... find_tag_
Pending approval
Sample Person
Andrew Bennetts
=== modified file 'lib/lp/ registry/ stories/ team/xx- team-membership .txt' registry/ stories/ team/xx- team-membership .txt 2009-11-22 15:43:16 +0000 registry/ stories/ team/xx- team-membership .txt 2009-12-21 20:08:16 +0000 browser. contents
--- lib/lp/
+++ lib/lp/
@@ -174,6 +174,19 @@
>>> message in second_
True
+An admin can see the former members of the team. launchpad. dev/~name18/ +members') by_id(browser. contents, 'inactivemembers')) launchpad. dev/~name18/ +members') by_id(user_ browser. contents, 'inactivemembers')
+
+ >>> browser.open('http://
+ >>> print extract_text(
+ ... find_tag_
+ Name Joined in Status...
+
+Other users cannot see the former members of the team.
+
+ >>> user_browser.open('http://
+ >>> print find_tag_
+ None
+
Team Participation page ======= ======= ===
======
}}}