Merge lp://staging/~gary/launchpad/muteteamsub-ui into lp://staging/launchpad/db-devel
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 |
Related bugs: |
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/
The JavaScript in lib/lp/
* I changed edit_subscripti
* 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_
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.