Merge lp://staging/~danilo/launchpad/bug-770241 into lp://staging/launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: 12942
Proposed branch: lp://staging/~danilo/launchpad/bug-770241
Merge into: lp://staging/launchpad
Diff against target: 291 lines (+212/-28)
4 files modified
lib/lp/bugs/javascript/bugtask_index_portlets.js (+4/-28)
lib/lp/bugs/javascript/subscribers_list.js (+43/-0)
lib/lp/bugs/javascript/tests/test_subscribers_list.html (+44/-0)
lib/lp/bugs/javascript/tests/test_subscribers_list.js (+121/-0)
To merge this branch: bzr merge lp://staging/~danilo/launchpad/bug-770241
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+59338@code.staging.launchpad.net

Commit message

[r=gmb][bug=770241] When the last subscriber is unsubscribed, put the "none" in appropriate div as expected by subscribe code.

Description of the change

= Bug 770241 =

Using JS to empty the list of subscribers on a bug page (iow, unsubscribe everybody) and then try to "subscribe someone else" fails because "None" div is added to the subscribers-links instead of the parent node for it (as is done on reload of the page with no subscribers).

== Proposed fix ==

 * Move set_none_for_empty_subscribers to a separate JS module for managing the subscribers list and rename it to reset()
 * Instead of adding directly to #subscribers-links, add the "None" div to the parent node
 * Provide tests for the behaviour of reset() in all these cases

== Implementation details ==

 * test_subscribers_list.html is boiler-plate for test set-up
 * reset() is mostly old code
 * the plan is to move more of the subscribers list management methods
   to the new module, to split it up from the other code.

== Tests ==

lib/lp/bugs/javascript/tests/test_subscribers_list.html

== Demo and Q/A ==

https://bugs.launchpad.dev/debian/+source/mozilla-firefox/+bug/3
(unsubscribe everyone, and then try to "subscribe someone else")

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/bugs/javascript/tests/test_subscribers_list.html
  lib/lp/bugs/javascript/bugtask_index_portlets.js
  lib/lp/bugs/javascript/subscribers_list.js
  lib/lp/bugs/javascript/tests/test_subscribers_list.js

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.