Merge lp://staging/~danilo/launchpad/subscribers-list-js into lp://staging/launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: 12945
Proposed branch: lp://staging/~danilo/launchpad/subscribers-list-js
Merge into: lp://staging/launchpad
Prerequisite: lp://staging/~danilo/launchpad/bug-770241
Diff against target: 535 lines (+324/-100)
4 files modified
lib/lp/bugs/javascript/bugtask_index_portlets.js (+22/-61)
lib/lp/bugs/javascript/subscribers_list.js (+38/-3)
lib/lp/bugs/javascript/tests/test_subscribers_list.html (+4/-0)
lib/lp/bugs/javascript/tests/test_subscribers_list.js (+260/-36)
To merge this branch: bzr merge lp://staging/~danilo/launchpad/subscribers-list-js
Reviewer Review Type Date Requested Status
j.c.sackett (community) Approve
Review via email: mp+59387@code.staging.launchpad.net

Commit message

[r=jcsackett][no-qa] Clean-up user link removal JS for bug subscribers list.

Description of the change

= Bug subscribers list: user link removal =

Move user link removal to the newly started subscribers_list module and add tests for it.

== Proposed fix ==

remove_user_name_link() in bugtask_index_portlets.js was:
 - used every time as anim.on('end') handler together with reset()
 - simply doing node.remove() which requires no separate method

So, I've joined it all together, added tests and moved it to bugs.subscribers_list JS module as remove_user_link() method.

== Implementation details ==

 - bugtask_index_portlets.js: other than the change to replace repeated code with remove_user_link(), the only change is unindenting the big block that was unnecessarily in anim.on('end') in one occurrence
 - tests are relatively comprehensive, and because of the green_flash animation taking a full second, a bit slow :/
 - I am still working on more clean-ups in bugtask_index_portlets.js because it's basically untestable because of the hacky nature
 - Tests have been slightly refactored to share more code for set-up

== Tests ==

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

== Demo and Q/A ==

1. Mark https://bugs.launchpad.dev/bugs/2 as duplicate of https://bugs.launchpad.dev/bugs/1
2. "Subscribe someone else" on bug 2 (eg. ubuntu-team)
3. "Subscribe (the same) someone else" on bug 1.
4. Subscribe yourself
4. Reload bug 1 page.
5. Play with unsubscribe icons

= 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
j.c.sackett (jcsackett) wrote :

This looks good to me. Thanks for explaining the undefined default thing to me.

review: Approve

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.