Code review comment for lp:~allenap/launchpad/show-me-too-counts

Revision history for this message
Gavin Panella (allenap) wrote :

This branch does two things: shows the count of users affected by a
bug (previously this has not been shown), and moves the "Does this bug
affect you" line to above the bug task table.

Lint free.

To test:

  bin/test -vvct 'test_bugtask|xx-bug-affects-me-too'
  bin/test -vvct test_bug_me_too.py --layer BugsWindmillLayer
  firefox lib/canonical/launchpad/javascript/bugs/tests/test_me_too.html

File by file:

lib/canonical/launchpad/javascript/bugs/bugtask-index.js

  Pass a new argument, others_affected_count, into the
  MeTooChoiceSource constructor. Accept it too :)

  New method, _getNewSourceNames(), that figures out the strings that
  will be used in the page to represent the current state of the
  choice source in the page. The results of this are used to override
  the defaults in the choice source's "items" array.

lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js

  Test the above.

lib/lp/bugs/browser/bugtask.py

  New property BugTasksAndNominationsView.other_users_affected_count
  which returns the number of users affected by the current bug
  *excluding* the logged-in user, if he/she is affected.

  New property BugTasksAndNominationsView.affected_statement, which
  returns a sentence or two to describe what the current state is. It
  takes into consideration whether or not the current user has voted
  either way or not, and also how many other users are affected.

lib/lp/bugs/browser/tests/test_bugtask.py

  Test the above.

lib/lp/bugs/stories/bugs/xx-bug-affects-me-too.txt

  The affected_statement is used for both clients with and without
  Javascript enabled, so this pagetest was updated.

lib/lp/bugs/templates/bugtasks-and-nominations-table.pt

  Move the me-too widget to above the task table. Apart from that
  there are very few changes. The affected_statement replaces the
  static text in the static and dynamic parts of the supporting HTML,
  and other_users_affected_count is passed into setup_me_too().

lib/lp/bugs/windmill/tests/test_bug_me_too.py

  Windmill test updated to reflect wording changes.

« Back to merge proposal