Merge lp://staging/~gary/launchpad/muteteamsub-ui into lp://staging/launchpad/db-devel

Proposed by Gary Poster
Status: Merged
Approved by: Gary Poster
Approved revision: no longer in the source branch.
Merged at revision: 10396
Proposed branch: lp://staging/~gary/launchpad/muteteamsub-ui
Merge into: lp://staging/launchpad/db-devel
Diff against target: 759 lines (+358/-96)
7 files modified
lib/lp/bugs/browser/structuralsubscription.py (+3/-1)
lib/lp/bugs/browser/tests/test_expose.py (+26/-5)
lib/lp/bugs/interfaces/bugsubscriptionfilter.py (+8/-11)
lib/lp/bugs/model/bugsubscriptionfilter.py (+10/-4)
lib/lp/bugs/tests/test_structuralsubscription.py (+5/-0)
lib/lp/registry/javascript/structural-subscription.js (+106/-37)
lib/lp/registry/javascript/tests/test_structural_subscription.js (+200/-38)
To merge this branch: bzr merge lp://staging/~gary/launchpad/muteteamsub-ui
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+56419@code.staging.launchpad.net

Commit message

[r=gmb][bug=751173] Add UI for muting team subscriptions

Description of the change

This branch adds a UI for muting team subscriptions, building on the work Graham and I have done previously.

The Python changes are what I needed to get the UI working.

 * I added a "muted" method. It returns the date it was muted for the person, or None if it is not.
 * I stopped "mute" from returning the mute. I couldn't get lazr.restful to deal with it properly, and it was not in the interface and didn't seem necessary.
 * I removed the webservice bobs from the mute interface because they were not being used (it was not imported into the bug package's webservice.py) and it was not necessary for them to be exported.
 * lib/lp/bugs/browser/structuralsubscription.py exposes the new mute info, and lib/lp/bugs/browser/tests/test_expose.py adds pertinent tests.

The JavaScript in lib/lp/registry/javascript/structural-subscription.js has the meat of the work.
 * I changed edit_subscription_handler to use the currently preferred approach to get the main container by id and then the components by class. I don't remember if I needed to do this or if it just seemed like a good idea at the time. :-/
 * I made some linty changes per our lint (78 char line length) and Crockford's JS linter (he advocates no single line funcs, and does stuff about semi-colons).
 * make_delete_handler now takes a node rather than an id, which seemed a bit more elegant to me.
 * make_delete_handler had messed up its unsubscribe node in some refactoring or other. I fixed it (but still no test).
 * The meat of the change is to add mute handling, as you'd expect, which is primarily in make_mute_handler and handle_mute.
 * While I added the mute code, I also changed how we draw subscriptions to use a string for a template, gradually gathered, rather than nodes one by one. As I say in a comment, this is because whitespace was stripped from left and right when I tried to use Y.Node.create with spaces at the beginning or end of a string.

I also added JS tests for the new mute functionality. To do so, I reused some code from earlier tests, which I factored out into helpers (monkeypatch_LP and make_lp_client_stub). We could probably use those more, but this branch was big enough.

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

This branch looks good. My only request is that you add some explanatory comments to the tests you've added in lib/lp/registry/javascript/tests/test_structural_subscription.js.

review: Approve (code)
Revision history for this message
Graham Binns (gmb) wrote :

test_muted_team_member_subscription also needs an explanatory comment.

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.

Subscribers

People subscribed via source and target branches

to status/vote changes: