Merge lp:~wallyworld/launchpad/person-picker-header-803990 into lp:launchpad

Proposed by Ian Booth
Status: Merged
Approved by: Ian Booth
Approved revision: no longer in the source branch.
Merged at revision: 13451
Proposed branch: lp:~wallyworld/launchpad/person-picker-header-803990
Merge into: lp:launchpad
Diff against target: 37 lines (+14/-6)
1 file modified
lib/lp/bugs/javascript/bugtask_index.js (+14/-6)
To merge this branch: bzr merge lp:~wallyworld/launchpad/person-picker-header-803990
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+68047@code.launchpad.net

Commit message

[r=bac][bug=803990] Improve the bugtask assignee picker when the user has no permission to assign anyone except themselves to the bug task.

Description of the change

This branch fixes the bug task assignee picker when the user has no permission to assign anyone except themselves to the bug task.

== Implementation ==

The javascript to create the assignee picker was fixed:
- do not hide the steps div (green line) anymore
- if hide_assignee_team_selection is true:
    set step_title to null
    display message to user (as per screenshot)

See screenshot:

http://people.canonical.com/~ianb/bug-assignee-picker.png

== Tests ==

The are no existing yui tests for almost all of what's in bugtask_index.js, including the hide_assignee_team_selection functionality. This functionality was originally tested via windmill. Any new replacement tests should provide the required coverage.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/bugs/javascript/bugtask_index.js

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/javascript/bugtask_index.js'
2--- lib/lp/bugs/javascript/bugtask_index.js 2011-07-06 14:13:04 +0000
3+++ lib/lp/bugs/javascript/bugtask_index.js 2011-07-15 06:37:40 +0000
4@@ -883,10 +883,15 @@
5 conf.bugtask_path, "getContributorInfo", y_config);
6 };
7
8- var step_title =
9- (conf.assignee_vocabulary === 'ValidAssignee') ?
10- "Search for people or teams" :
11- "Select a team of which you are a member";
12+ var step_title;
13+ if (conf.hide_assignee_team_selection) {
14+ step_title = null;
15+ } else {
16+ step_title =
17+ (conf.assignee_vocabulary === 'ValidAssignee') ?
18+ "Search for people or teams" :
19+ "Select a team of which you are a member";
20+ }
21 var assignee_picker = Y.lp.app.picker.addPickerPatcher(
22 conf.assignee_vocabulary,
23 conf.bugtask_path,
24@@ -907,8 +912,11 @@
25 content_box = assignee_picker.get('contentBox');
26 search_box = content_box.one('.yui3-picker-search-box');
27 search_box.setStyle('display', 'none');
28- step_title = content_box.one('.contains-steptitle');
29- step_title.setStyle('display', 'none');
30+ var info = Y.Node.create('<p style="padding-top: 1em;"></p>')
31+ .set('text', 'You may only assign yourself because you are ' +
32+ 'not affiliated with this project and do not have any team ' +
33+ 'memberships.');
34+ search_box.insert(info, search_box);
35 }
36 assignee_picker.render();
37 }