Merge lp:~bac/launchpad/bug-770245 into lp:launchpad

Proposed by Brad Crittenden
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: 12930
Proposed branch: lp:~bac/launchpad/bug-770245
Merge into: lp:launchpad
Diff against target: 39 lines (+25/-5)
1 file modified
lib/lp/bugs/javascript/bugtask_index_portlets.js (+25/-5)
To merge this branch: bzr merge lp:~bac/launchpad/bug-770245
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Review via email: mp+59239@code.launchpad.net

Commit message

[r=danilo][bug=770245] When unsubscribing a team from a bug, unsubscribe from the bug and all duplicates.

Description of the change

= Summary =

Unsubscribing a team from a bug that is subscribed to a duplicate was
not actually doing the unsubscribe.

== Proposed fix ==

Call both unsubscribe and unsubscribeFromDupes when unsubscribing a team.

== Pre-implementation notes ==

Chat with Danilo.

== Implementation details ==

As above.

== Tests ==

Hmm.

== Demo and Q/A ==

Link bug 2 to bug 1.
Subscribe a team directly to bug 2.
Unsubscribe that team from bug 1.

= Launchpad lint =

Checking for conflicts and issues in changed files.

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

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) :
review: Approve

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_portlets.js'
2--- lib/lp/bugs/javascript/bugtask_index_portlets.js 2011-04-22 22:31:33 +0000
3+++ lib/lp/bugs/javascript/bugtask_index_portlets.js 2011-04-27 15:21:55 +0000
4@@ -853,11 +853,31 @@
5
6 parameters: { person: subscriber_link }
7 };
8- if (subscription.is_direct_subscription() || subscription.is_team()) {
9- lp_client.named_post(bug_repr.self_link, 'unsubscribe', config);
10- } else {
11- lp_client.named_post(
12- bug_repr.self_link, 'unsubscribeFromDupes', config);
13+
14+ // A team must be unsubcribed from both the current bug and from
15+ // duplicates. This configuration handles the first and then
16+ // chains to the other upon success.
17+ var team_config = {
18+ on: {
19+ success: function(client) {
20+ lp_client.named_post(
21+ bug_repr.self_link, 'unsubscribeFromDupes', config);
22+ },
23+ failure: error_handler.getFailureHandler()
24+ },
25+ parameters: { person: subscriber_link }
26+ };
27+
28+ if (subscription.is_team()){
29+ lp_client.named_post(bug_repr.self_link, 'unsubscribe', team_config);
30+ }
31+ else {
32+ if (subscription.is_direct_subscription()) {
33+ lp_client.named_post(bug_repr.self_link, 'unsubscribe', config);
34+ } else {
35+ lp_client.named_post(
36+ bug_repr.self_link, 'unsubscribeFromDupes', config);
37+ }
38 }
39 }
40