Fix from trivial issues while my brain is stuck in first gear
--------------------------------------------------------------------
Bug #436299 [Search results give wrong "Registered by" information]
The maintainer is listed as the registrant. This is wrong. The
problem is that distributions do not have a registrant.
Bug #568336 [Typo on profile workload page]
There is a double 'or'
Bug #130285 [Disregard deleted projects from Most active in]
Deactivated projects are listed in "Most active in" in the profile page
and the links are a 404.
Bug #557544 [Bad plural on team page ("1 active members")]
What: "1 active members" can appear on team page. This is incorrect use
of a plural.
Rules
-----
Bug #436299 [Search results give wrong "Registered by" information]
Verify there is a registrant using tales before appending the clause.
tal:define="registrant view/pillar/registrant|nothing"
tal:condition="registrant"
Bug #568336 [Typo on profile workload page]
Remove the second 'or'.
Bug #130285 [Disregard deleted projects from lists]
This issue in on the cusp of *not* trivial because a good understanding
of pillar name behaviour and karma testing is needed. The fix can be
easily placed into an existing doc test, but that is not the correct
location.
* pillar names (used by karma cache) have no concept of active/inactive.
The method must filter deactivate pillars /after/ the query to get the
names. The callsite must request more than is needed because of the
filtering.
* Generate the karma for a unit test of the method *and* the private
methods that were never directly tested.
* Test that deactivated pillars are not included.
* ADDENDUM: While I knew how to generate the karma, the reason why
the karma looks like it is inserted twice was not obvious from existing
tests. I took an extra hour learning this and adding comments for
future developers.
Bug #557544 [Bad plural on team page ("1 active members")]
* Use the plural-message macro to switch between member and members
* lib/lp/app/stories/launchpad-root/site-search.txt
* Verified that distributions do not get a "registered by" line.
* lib/lp/registry/doc/person-karma.txt
* Moved test from doctest to unittest.
* lib/lp/registry/stories/team/xx-team-home.txt
* Verified singural and plural cases.
* lib/lp/registry/stories/teammembership/xx-private-membership.txt
* Verified singural and plural cases.
* lib/lp/registry/tests/test_person.py
* Lint hated this file. I removed a lot of unused imports and vars.
* I switched the tests to run on the faster DatabaseFunctionalLayer.
* Added a test for Person.getProjectsAndCategoriesContributedTo()
and its private helpers. This also tests the new rule to not include
deactivate projects.
Implementation
--------------
* lib/lp/app/templates/base-layout-macros.pt
* Discovered that the macro generated white-space that is inappropirate
for anchors and punctuation.
* lib/lp/app/templates/launchpad-search.pt
* Updated the template to use registrant, not owner, and only print
the "registered by" line if the pillar has a registrant.
* lib/lp/blueprints/templates/person-specworkload.pt
* Removed redundant "or".
* lib/lp/registry/model/person.py
* Request 5 extra pillar names and built a list of 5 active pillars.
* lib/lp/registry/templates/team-portlet-membership.pt
* Fixed plural rule for active, proposed, and pending membership.
Sorry that this makes the template hard to read.
This is my branch to fix from trivial issues while my brain is stuck in
first gear.
lp:~sinzui/launchpad/oil-and-pigment /bugs.launchpad .net/bugs/ 436299 /bugs.launchpad .net/bugs/ 568336 /bugs.launchpad .net/bugs/ 130285 /bugs.launchpad .net/bugs/ 557544 tests.test_ person membership \ implementation: no one
Diff size: 489
Launchpad bug: https:/
https:/
https:/
https:/
Test command: ./bin/test -vv lp.registry.
./bin/test -t site-search -t xx-team-home -t xx-private-
-t person-karma
Pre-
Target release: 10.04
Fix from trivial issues while my brain is stuck in first gear ------- ------- ------- ------- ------- ------- ------- ------- -----
-------
Bug #436299 [Search results give wrong "Registered by" information]
The maintainer is listed as the registrant. This is wrong. The
problem is that distributions do not have a registrant.
Bug #568336 [Typo on profile workload page]
There is a double 'or'
Bug #130285 [Disregard deleted projects from Most active in]
Deactivated projects are listed in "Most active in" in the profile page
and the links are a 404.
Bug #557544 [Bad plural on team page ("1 active members")]
What: "1 active members" can appear on team page. This is incorrect use
of a plural.
Rules
-----
Bug #436299 [Search results give wrong "Registered by" information] define= "registrant view/pillar/ registrant| nothing" condition= "registrant"
Verify there is a registrant using tales before appending the clause.
tal:
tal:
Bug #568336 [Typo on profile workload page]
Remove the second 'or'.
Bug #130285 [Disregard deleted projects from lists]
This issue in on the cusp of *not* trivial because a good understanding
of pillar name behaviour and karma testing is needed. The fix can be
easily placed into an existing doc test, but that is not the correct
location.
* pillar names (used by karma cache) have no concept of active/inactive.
The method must filter deactivate pillars /after/ the query to get the
names. The callsite must request more than is needed because of the
filtering.
* Generate the karma for a unit test of the method *and* the private
methods that were never directly tested.
* Test that deactivated pillars are not included.
* ADDENDUM: While I knew how to generate the karma, the reason why
the karma looks like it is inserted twice was not obvious from existing
tests. I took an extra hour learning this and adding comments for
future developers.
Bug #557544 [Bad plural on team page ("1 active members")]
* Use the plural-message macro to switch between member and members
QA
--
Bug #436299 [Search results give wrong "Registered by" information] /edge.launchpad .net/+search? field.text= wesnoth /edge.launchpad .net/+search? field.text= ubuntu
* Visit https:/
* Verify that Karianne Fog Heen is listed as the registrant
* Visit https:/
* Verify that no registrant is listed:
Registered on <date>
Bug #568336 [Typo on profile workload page] /blueprints. edge.launchpad. net/~humphreybc /+specworkload
* Visit https:/
* Verify text:
Benjamin Humphrey is expected to work on, or is its creator
Bug #130285 [Disregard deleted projects from lists] /edge.launchpad .net/~simon- zoellner
* Visit https:/
* Verify that PHProute is not in "Most active in"
Bug #557544 [Bad plural on team page ("1 active members")] /launchpad. net/~halfgeek. org-ixan
* Visit https:/
* Verify the page says 1 active member
Lint
----
Linting changed files: app/stories/ launchpad- root/site- search. txt app/templates/ base-layout- macros. pt app/templates/ launchpad- search. pt blueprints/ templates/ person- specworkload. pt registry/ doc/person- karma.txt registry/ model/person. py registry/ stories/ team/xx- team-home. txt registry/ stories/ teammembership/ xx-private- membership. txt registry/ templates/ team-portlet- membership. pt registry/ tests/test_ person. py
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
Test
----
* lib/lp/ app/stories/ launchpad- root/site- search. txt registry/ doc/person- karma.txt registry/ stories/ team/xx- team-home. txt registry/ stories/ teammembership/ xx-private- membership. txt registry/ tests/test_ person. py nalLayer. getProjectsAndC ategoriesContri butedTo( )
* Verified that distributions do not get a "registered by" line.
* lib/lp/
* Moved test from doctest to unittest.
* lib/lp/
* Verified singural and plural cases.
* lib/lp/
* Verified singural and plural cases.
* lib/lp/
* Lint hated this file. I removed a lot of unused imports and vars.
* I switched the tests to run on the faster DatabaseFunctio
* Added a test for Person.
and its private helpers. This also tests the new rule to not include
deactivate projects.
Implementation
--------------
* lib/lp/ app/templates/ base-layout- macros. pt app/templates/ launchpad- search. pt blueprints/ templates/ person- specworkload. pt registry/ model/person. py registry/ templates/ team-portlet- membership. pt
* Discovered that the macro generated white-space that is inappropirate
for anchors and punctuation.
* lib/lp/
* Updated the template to use registrant, not owner, and only print
the "registered by" line if the pillar has a registrant.
* lib/lp/
* Removed redundant "or".
* lib/lp/
* Request 5 extra pillar names and built a list of 5 active pillars.
* lib/lp/
* Fixed plural rule for active, proposed, and pending membership.
Sorry that this makes the template hard to read.