Merge lp:~stevenk/launchpad/destroy-simplified-branch-ff into lp:launchpad
- destroy-simplified-branch-ff
- Merge into devel
Proposed by
Steve Kowalik
Status: | Merged |
---|---|
Approved by: | Curtis Hovey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 16086 |
Proposed branch: | lp:~stevenk/launchpad/destroy-simplified-branch-ff |
Merge into: | lp:launchpad |
Diff against target: |
509 lines (+57/-233) 8 files modified
lib/lp/code/browser/branchlisting.py (+17/-147) lib/lp/code/browser/tests/test_branchlisting.py (+5/-14) lib/lp/code/stories/branches/xx-branch-listings.txt (+1/-1) lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt (+6/-5) lib/lp/code/stories/branches/xx-person-branches.txt (+16/-14) lib/lp/code/stories/branches/xx-personproduct-branch-listings.txt (+1/-1) lib/lp/code/templates/person-codesummary.pt (+11/-45) lib/lp/services/features/flags.py (+0/-6) |
To merge this branch: | bzr merge lp:~stevenk/launchpad/destroy-simplified-branch-ff |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email: mp+127630@code.launchpad.net |
Commit message
Description of the change
The code.simplified
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/code/browser/branchlisting.py' | |||
2 | --- lib/lp/code/browser/branchlisting.py 2012-10-03 03:07:36 +0000 | |||
3 | +++ lib/lp/code/browser/branchlisting.py 2012-10-04 01:12:22 +0000 | |||
4 | @@ -71,11 +71,7 @@ | |||
5 | 71 | ) | 71 | ) |
6 | 72 | from lp.bugs.interfaces.bugbranch import IBugBranchSet | 72 | from lp.bugs.interfaces.bugbranch import IBugBranchSet |
7 | 73 | from lp.code.browser.branch import BranchMirrorMixin | 73 | from lp.code.browser.branch import BranchMirrorMixin |
13 | 74 | from lp.code.browser.branchmergeproposallisting import ( | 74 | from lp.code.browser.branchmergeproposallisting import ActiveReviewsView |
9 | 75 | ActiveReviewsView, | ||
10 | 76 | PersonActiveReviewsView, | ||
11 | 77 | PersonProductActiveReviewsView, | ||
12 | 78 | ) | ||
14 | 79 | from lp.code.browser.branchmergequeuelisting import HasMergeQueuesMenuMixin | 75 | from lp.code.browser.branchmergequeuelisting import HasMergeQueuesMenuMixin |
15 | 80 | from lp.code.browser.branchvisibilitypolicy import BranchVisibilityPolicyMixin | 76 | from lp.code.browser.branchvisibilitypolicy import BranchVisibilityPolicyMixin |
16 | 81 | from lp.code.browser.summary import BranchCountSummaryView | 77 | from lp.code.browser.summary import BranchCountSummaryView |
17 | @@ -117,7 +113,6 @@ | |||
18 | 117 | from lp.registry.model.sourcepackage import SourcePackage | 113 | from lp.registry.model.sourcepackage import SourcePackage |
19 | 118 | from lp.services.browser_helpers import get_plural_text | 114 | from lp.services.browser_helpers import get_plural_text |
20 | 119 | from lp.services.config import config | 115 | from lp.services.config import config |
21 | 120 | from lp.services.features import getFeatureFlag | ||
22 | 121 | from lp.services.feeds.browser import ( | 116 | from lp.services.feeds.browser import ( |
23 | 122 | FeedsMixin, | 117 | FeedsMixin, |
24 | 123 | PersonBranchesFeedLink, | 118 | PersonBranchesFeedLink, |
25 | @@ -161,7 +156,7 @@ | |||
26 | 161 | return Badge('/@@/warning', '/@@/warning-large', '', | 156 | return Badge('/@@/warning', '/@@/warning-large', '', |
27 | 162 | 'Branch has errors') | 157 | 'Branch has errors') |
28 | 163 | else: | 158 | else: |
30 | 164 | return HasBadgeBase.getBadge(self, badge_name) | 159 | return super(BranchBadges, self).getBadge(badge_name) |
31 | 165 | 160 | ||
32 | 166 | 161 | ||
33 | 167 | class BranchListingItem(BzrIdentityMixin, BranchBadges): | 162 | class BranchListingItem(BzrIdentityMixin, BranchBadges): |
34 | @@ -560,9 +555,7 @@ | |||
35 | 560 | 555 | ||
36 | 561 | @property | 556 | @property |
37 | 562 | def initial_values(self): | 557 | def initial_values(self): |
41 | 563 | return { | 558 | return {'lifecycle': BranchLifecycleStatusFilter.CURRENT} |
39 | 564 | 'lifecycle': BranchLifecycleStatusFilter.CURRENT, | ||
40 | 565 | } | ||
42 | 566 | 559 | ||
43 | 567 | @cachedproperty | 560 | @cachedproperty |
44 | 568 | def selected_lifecycle_status(self): | 561 | def selected_lifecycle_status(self): |
45 | @@ -856,30 +849,8 @@ | |||
46 | 856 | usedfor = IPerson | 849 | usedfor = IPerson |
47 | 857 | facet = 'branches' | 850 | facet = 'branches' |
48 | 858 | links = ['registered', 'owned', 'subscribed', | 851 | links = ['registered', 'owned', 'subscribed', |
73 | 859 | 'active_reviews', 'mergequeues', 'source_package_recipes', | 852 | 'active_reviews', 'mergequeues', 'source_package_recipes'] |
74 | 860 | 'simplified_subscribed', 'simplified_registered', | 853 | extra_attributes = ['mergequeue_count'] |
51 | 861 | 'simplified_owned', 'simplified_active_reviews'] | ||
52 | 862 | extra_attributes = [ | ||
53 | 863 | 'active_review_count', | ||
54 | 864 | 'owned_branch_count', | ||
55 | 865 | 'registered_branch_count', | ||
56 | 866 | 'show_summary', | ||
57 | 867 | 'subscribed_branch_count', | ||
58 | 868 | 'mergequeue_count', | ||
59 | 869 | 'simplified_branches_menu', | ||
60 | 870 | ] | ||
61 | 871 | |||
62 | 872 | def _getCountCollection(self): | ||
63 | 873 | """The base collection of branches which should be counted. | ||
64 | 874 | |||
65 | 875 | This collection will be further restricted to, e.g., the | ||
66 | 876 | branches registered by a particular user for the counts that | ||
67 | 877 | appear at the top of a branch listing page. | ||
68 | 878 | |||
69 | 879 | This should be overridden in subclasses to restrict to, for | ||
70 | 880 | example, the set of branches of a particular product. | ||
71 | 881 | """ | ||
72 | 882 | return getUtility(IAllBranches).visibleByUser(self.user) | ||
75 | 883 | 854 | ||
76 | 884 | @property | 855 | @property |
77 | 885 | def person(self): | 856 | def person(self): |
78 | @@ -890,139 +861,38 @@ | |||
79 | 890 | """ | 861 | """ |
80 | 891 | return self.context | 862 | return self.context |
81 | 892 | 863 | ||
82 | 893 | @property | ||
83 | 894 | def show_summary(self): | ||
84 | 895 | """Should the template show the summary view with the links.""" | ||
85 | 896 | |||
86 | 897 | if self.simplified_branches_menu: | ||
87 | 898 | return True | ||
88 | 899 | else: | ||
89 | 900 | return ( | ||
90 | 901 | self.owned_branch_count or | ||
91 | 902 | self.registered_branch_count or | ||
92 | 903 | self.subscribed_branch_count or | ||
93 | 904 | self.active_review_count | ||
94 | 905 | ) | ||
95 | 906 | |||
96 | 907 | @cachedproperty | ||
97 | 908 | def simplified_branches_menu(self): | ||
98 | 909 | return getFeatureFlag('code.simplified_branches_menu.enabled') | ||
99 | 910 | |||
100 | 911 | @cachedproperty | ||
101 | 912 | def registered_branches_not_empty(self): | ||
102 | 913 | """False if the number of branches registered by self.person | ||
103 | 914 | is zero. | ||
104 | 915 | """ | ||
105 | 916 | return ( | ||
106 | 917 | not self._getCountCollection().registeredBy( | ||
107 | 918 | self.person).is_empty()) | ||
108 | 919 | |||
109 | 920 | def simplified_owned(self): | ||
110 | 921 | return Link( | ||
111 | 922 | canonical_url(self.context, rootsite='code'), | ||
112 | 923 | 'Owned branches') | ||
113 | 924 | |||
114 | 925 | def simplified_registered(self): | ||
115 | 926 | person_is_individual = (not self.person.is_team) | ||
116 | 927 | return Link( | ||
117 | 928 | '+registeredbranches', | ||
118 | 929 | 'Registered branches', | ||
119 | 930 | enabled=( | ||
120 | 931 | person_is_individual and | ||
121 | 932 | self.registered_branches_not_empty)) | ||
122 | 933 | |||
123 | 934 | def simplified_subscribed(self): | ||
124 | 935 | return Link( | ||
125 | 936 | '+subscribedbranches', | ||
126 | 937 | 'Subscribed branches') | ||
127 | 938 | |||
128 | 939 | def simplified_active_reviews(self): | ||
129 | 940 | return Link( | ||
130 | 941 | '+activereviews', | ||
131 | 942 | 'Active reviews') | ||
132 | 943 | |||
133 | 944 | def source_package_recipes(self): | ||
134 | 945 | return Link( | ||
135 | 946 | '+recipes', | ||
136 | 947 | 'Source package recipes', | ||
137 | 948 | enabled=IPerson.providedBy(self.context)) | ||
138 | 949 | |||
139 | 950 | @cachedproperty | ||
140 | 951 | def registered_branch_count(self): | ||
141 | 952 | """Return the number of branches registered by self.person.""" | ||
142 | 953 | return self._getCountCollection().registeredBy(self.person).count() | ||
143 | 954 | |||
144 | 955 | @cachedproperty | ||
145 | 956 | def owned_branch_count(self): | ||
146 | 957 | """Return the number of branches owned by self.person.""" | ||
147 | 958 | return self._getCountCollection().ownedBy(self.person).count() | ||
148 | 959 | |||
149 | 960 | @cachedproperty | ||
150 | 961 | def subscribed_branch_count(self): | ||
151 | 962 | """Return the number of branches subscribed to by self.person.""" | ||
152 | 963 | return self._getCountCollection().subscribedBy(self.person).count() | ||
153 | 964 | |||
154 | 965 | def owned(self): | 864 | def owned(self): |
155 | 966 | return Link( | 865 | return Link( |
159 | 967 | canonical_url(self.context, rootsite='code'), | 866 | canonical_url(self.context, rootsite='code'), 'Owned branches') |
157 | 968 | get_plural_text( | ||
158 | 969 | self.owned_branch_count, 'owned branch', 'owned branches')) | ||
160 | 970 | 867 | ||
161 | 971 | def registered(self): | 868 | def registered(self): |
163 | 972 | person_is_individual = (not self.person.is_team) | 869 | enabled = not self.person.is_team |
164 | 973 | return Link( | 870 | return Link( |
170 | 974 | '+registeredbranches', | 871 | '+registeredbranches', 'Registered branches', enabled=enabled) |
166 | 975 | get_plural_text( | ||
167 | 976 | self.registered_branch_count, | ||
168 | 977 | 'registered branch', 'registered branches'), | ||
169 | 978 | enabled=person_is_individual) | ||
171 | 979 | 872 | ||
172 | 980 | def subscribed(self): | 873 | def subscribed(self): |
173 | 874 | return Link('+subscribedbranches', 'Subscribed branches') | ||
174 | 875 | |||
175 | 876 | def active_reviews(self): | ||
176 | 877 | return Link('+activereviews', 'Active reviews') | ||
177 | 878 | |||
178 | 879 | def source_package_recipes(self): | ||
179 | 981 | return Link( | 880 | return Link( |
197 | 982 | '+subscribedbranches', | 881 | '+recipes', 'Source package recipes', |
198 | 983 | get_plural_text( | 882 | enabled=IPerson.providedBy(self.context)) |
182 | 984 | self.subscribed_branch_count, | ||
183 | 985 | 'subscribed branch', 'subscribed branches')) | ||
184 | 986 | |||
185 | 987 | @cachedproperty | ||
186 | 988 | def active_review_count(self): | ||
187 | 989 | """Return the number of active reviews for self.person's branches.""" | ||
188 | 990 | active_reviews = PersonActiveReviewsView(self.context, self.request) | ||
189 | 991 | return active_reviews.getProposals().count() | ||
190 | 992 | |||
191 | 993 | def active_reviews(self): | ||
192 | 994 | text = get_plural_text( | ||
193 | 995 | self.active_review_count, | ||
194 | 996 | 'active review', | ||
195 | 997 | 'active reviews') | ||
196 | 998 | return Link('+activereviews', text) | ||
199 | 999 | 883 | ||
200 | 1000 | 884 | ||
201 | 1001 | class PersonProductBranchesMenu(PersonBranchesMenu): | 885 | class PersonProductBranchesMenu(PersonBranchesMenu): |
202 | 1002 | 886 | ||
203 | 1003 | usedfor = IPersonProduct | 887 | usedfor = IPersonProduct |
204 | 1004 | links = ['registered', 'owned', 'subscribed', 'active_reviews', | 888 | links = ['registered', 'owned', 'subscribed', 'active_reviews', |
213 | 1005 | 'source_package_recipes', | 889 | 'source_package_recipes'] |
206 | 1006 | 'simplified_subscribed', 'simplified_registered', | ||
207 | 1007 | 'simplified_owned', 'simplified_active_reviews'] | ||
208 | 1008 | |||
209 | 1009 | def _getCountCollection(self): | ||
210 | 1010 | """See `PersonBranchesMenu`.""" | ||
211 | 1011 | collection = getUtility(IAllBranches).visibleByUser(self.user) | ||
212 | 1012 | return collection.inProduct(self.context.product) | ||
214 | 1013 | 890 | ||
215 | 1014 | @property | 891 | @property |
216 | 1015 | def person(self): | 892 | def person(self): |
217 | 1016 | """See `PersonBranchesMenu`.""" | 893 | """See `PersonBranchesMenu`.""" |
218 | 1017 | return self.context.person | 894 | return self.context.person |
219 | 1018 | 895 | ||
220 | 1019 | @cachedproperty | ||
221 | 1020 | def active_review_count(self): | ||
222 | 1021 | """Return the number of active reviews for self.person's branches.""" | ||
223 | 1022 | active_reviews = PersonProductActiveReviewsView( | ||
224 | 1023 | self.context, self.request) | ||
225 | 1024 | return active_reviews.getProposals().count() | ||
226 | 1025 | |||
227 | 1026 | 896 | ||
228 | 1027 | class PersonBaseBranchListingView(BranchListingView): | 897 | class PersonBaseBranchListingView(BranchListingView): |
229 | 1028 | """Base class used for different person listing views.""" | 898 | """Base class used for different person listing views.""" |
230 | 1029 | 899 | ||
231 | === modified file 'lib/lp/code/browser/tests/test_branchlisting.py' | |||
232 | --- lib/lp/code/browser/tests/test_branchlisting.py 2012-09-06 00:01:38 +0000 | |||
233 | +++ lib/lp/code/browser/tests/test_branchlisting.py 2012-10-04 01:12:22 +0000 | |||
234 | @@ -1,4 +1,4 @@ | |||
236 | 1 | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2012 Canonical Ltd. This software is licensed under the |
237 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
238 | 3 | 3 | ||
239 | 4 | """Tests for branch listing.""" | 4 | """Tests for branch listing.""" |
240 | @@ -265,10 +265,6 @@ | |||
241 | 265 | self._test_batch_template(self.barney) | 265 | self._test_batch_template(self.barney) |
242 | 266 | 266 | ||
243 | 267 | 267 | ||
244 | 268 | SIMPLIFIED_BRANCHES_MENU_FLAG = { | ||
245 | 269 | 'code.simplified_branches_menu.enabled': 'on'} | ||
246 | 270 | |||
247 | 271 | |||
248 | 272 | class TestSimplifiedPersonBranchesView(TestCaseWithFactory): | 268 | class TestSimplifiedPersonBranchesView(TestCaseWithFactory): |
249 | 273 | 269 | ||
250 | 274 | layer = LaunchpadFunctionalLayer | 270 | layer = LaunchpadFunctionalLayer |
251 | @@ -294,19 +290,16 @@ | |||
252 | 294 | def get_branch_list_page(self, target=None, page_name='+branches'): | 290 | def get_branch_list_page(self, target=None, page_name='+branches'): |
253 | 295 | if target is None: | 291 | if target is None: |
254 | 296 | target = self.default_target | 292 | target = self.default_target |
260 | 297 | with FeatureFixture(SIMPLIFIED_BRANCHES_MENU_FLAG): | 293 | with person_logged_in(self.user): |
261 | 298 | with person_logged_in(self.user): | 294 | return create_initialized_view( |
262 | 299 | return create_initialized_view( | 295 | target, page_name, rootsite='code', principal=self.user)() |
258 | 300 | target, page_name, rootsite='code', | ||
259 | 301 | principal=self.user)() | ||
263 | 302 | 296 | ||
264 | 303 | def test_branch_list_h1(self): | 297 | def test_branch_list_h1(self): |
265 | 304 | self.makeABranch() | 298 | self.makeABranch() |
266 | 305 | page = self.get_branch_list_page() | 299 | page = self.get_branch_list_page() |
267 | 306 | h1_matcher = soupmatchers.HTMLContains( | 300 | h1_matcher = soupmatchers.HTMLContains( |
268 | 307 | soupmatchers.Tag( | 301 | soupmatchers.Tag( |
271 | 308 | 'Title', 'h1', | 302 | 'Title', 'h1', text='Bazaar branches owned by Barney')) |
270 | 309 | text='Bazaar branches owned by Barney')) | ||
272 | 310 | self.assertThat(page, h1_matcher) | 303 | self.assertThat(page, h1_matcher) |
273 | 311 | 304 | ||
274 | 312 | def test_branch_list_empty(self): | 305 | def test_branch_list_empty(self): |
275 | @@ -317,7 +310,6 @@ | |||
276 | 317 | text='There are no branches related to Barney ' | 310 | text='There are no branches related to Barney ' |
277 | 318 | 'in Launchpad today.')) | 311 | 'in Launchpad today.')) |
278 | 319 | self.assertThat(page, empty_message_matcher) | 312 | self.assertThat(page, empty_message_matcher) |
279 | 320 | self.assertThat(page, Not(self.registered_branches_matcher)) | ||
280 | 321 | 313 | ||
281 | 322 | def test_branch_list_registered_link(self): | 314 | def test_branch_list_registered_link(self): |
282 | 323 | self.makeABranch() | 315 | self.makeABranch() |
283 | @@ -408,7 +400,6 @@ | |||
284 | 408 | text='There are no branches of Bambam owned by Barney ' | 400 | text='There are no branches of Bambam owned by Barney ' |
285 | 409 | 'in Launchpad today.')) | 401 | 'in Launchpad today.')) |
286 | 410 | self.assertThat(page, empty_message_matcher) | 402 | self.assertThat(page, empty_message_matcher) |
287 | 411 | self.assertThat(page, Not(self.registered_branches_matcher)) | ||
288 | 412 | 403 | ||
289 | 413 | 404 | ||
290 | 414 | class TestSourcePackageBranchesView(TestCaseWithFactory): | 405 | class TestSourcePackageBranchesView(TestCaseWithFactory): |
291 | 415 | 406 | ||
292 | === modified file 'lib/lp/code/stories/branches/xx-branch-listings.txt' | |||
293 | --- lib/lp/code/stories/branches/xx-branch-listings.txt 2012-07-17 14:29:17 +0000 | |||
294 | +++ lib/lp/code/stories/branches/xx-branch-listings.txt 2012-10-04 01:12:22 +0000 | |||
295 | @@ -65,7 +65,7 @@ | |||
296 | 65 | needed, then the table is sortable and no batching navigation links are shown. | 65 | needed, then the table is sortable and no batching navigation links are shown. |
297 | 66 | 66 | ||
298 | 67 | >>> browser.open('http://code.launchpad.dev/~name12') | 67 | >>> browser.open('http://code.launchpad.dev/~name12') |
300 | 68 | >>> browser.getLink('subscribed').click() | 68 | >>> browser.getLink('Subscribed').click() |
301 | 69 | >>> links = find_tag_by_id(browser.contents, 'branch-batch-links') | 69 | >>> links = find_tag_by_id(browser.contents, 'branch-batch-links') |
302 | 70 | >>> links is None | 70 | >>> links is None |
303 | 71 | True | 71 | True |
304 | 72 | 72 | ||
305 | === modified file 'lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt' | |||
306 | --- lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt 2012-08-21 11:01:47 +0000 | |||
307 | +++ lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt 2012-10-04 01:12:22 +0000 | |||
308 | @@ -93,10 +93,11 @@ | |||
309 | 93 | 93 | ||
310 | 94 | >>> browser.open('http://code.launchpad.dev/~albert') | 94 | >>> browser.open('http://code.launchpad.dev/~albert') |
311 | 95 | >>> print_tag_with_id(browser.contents, 'portlet-person-codesummary') | 95 | >>> print_tag_with_id(browser.contents, 'portlet-person-codesummary') |
316 | 96 | 1 owned branch | 96 | Owned branches |
317 | 97 | 1 registered branch | 97 | Registered branches |
318 | 98 | 1 subscribed branch | 98 | Subscribed branches |
319 | 99 | 1 active review | 99 | Active reviews |
320 | 100 | Source package recipes | ||
321 | 100 | 101 | ||
322 | 101 | The person's active reviews also lists all of their currently requested | 102 | The person's active reviews also lists all of their currently requested |
323 | 102 | reviews. | 103 | reviews. |
324 | @@ -128,7 +129,7 @@ | |||
325 | 128 | Since Albert is in the A-Team, he can do the pending review. | 129 | Since Albert is in the A-Team, he can do the pending review. |
326 | 129 | 130 | ||
327 | 130 | >>> browser.open('http://code.launchpad.dev/~a-team') | 131 | >>> browser.open('http://code.launchpad.dev/~a-team') |
329 | 131 | >>> browser.getLink('active review').click() | 132 | >>> browser.getLink('Active reviews').click() |
330 | 132 | >>> print_tag_with_id(browser.contents, 'proposals') | 133 | >>> print_tag_with_id(browser.contents, 'proposals') |
331 | 133 | Requested reviews I can do | 134 | Requested reviews I can do |
332 | 134 | Branch Merge Proposal Requested By Lines Activity | 135 | Branch Merge Proposal Requested By Lines Activity |
333 | 135 | 136 | ||
334 | === modified file 'lib/lp/code/stories/branches/xx-person-branches.txt' | |||
335 | --- lib/lp/code/stories/branches/xx-person-branches.txt 2012-01-15 13:32:27 +0000 | |||
336 | +++ lib/lp/code/stories/branches/xx-person-branches.txt 2012-10-04 01:12:22 +0000 | |||
337 | @@ -64,7 +64,7 @@ | |||
338 | 64 | There is also a link which points to the registered branches page. | 64 | There is also a link which points to the registered branches page. |
339 | 65 | 65 | ||
340 | 66 | >>> browser.open('http://code.launchpad.dev/~name12') | 66 | >>> browser.open('http://code.launchpad.dev/~name12') |
342 | 67 | >>> browser.getLink('registered').click() | 67 | >>> browser.getLink('Registered').click() |
343 | 68 | >>> print browser.title | 68 | >>> print browser.title |
344 | 69 | Registered : Code : Sample Person | 69 | Registered : Code : Sample Person |
345 | 70 | >>> table = find_tag_by_id(browser.contents, 'branchtable') | 70 | >>> table = find_tag_by_id(browser.contents, 'branchtable') |
346 | @@ -81,7 +81,7 @@ | |||
347 | 81 | branches. | 81 | branches. |
348 | 82 | 82 | ||
349 | 83 | >>> browser.open('http://code.launchpad.dev/~name12') | 83 | >>> browser.open('http://code.launchpad.dev/~name12') |
351 | 84 | >>> browser.getLink('subscribed').click() | 84 | >>> browser.getLink('Subscribed').click() |
352 | 85 | >>> print browser.title | 85 | >>> print browser.title |
353 | 86 | Subscribed : Code : Sample Person | 86 | Subscribed : Code : Sample Person |
354 | 87 | >>> table = find_tag_by_id(browser.contents, 'branchtable') | 87 | >>> table = find_tag_by_id(browser.contents, 'branchtable') |
355 | @@ -112,10 +112,11 @@ | |||
356 | 112 | >>> eric_browser = setupBrowser(auth="Basic eric@example.com:test") | 112 | >>> eric_browser = setupBrowser(auth="Basic eric@example.com:test") |
357 | 113 | >>> eric_browser.open('http://code.launchpad.dev/~eric') | 113 | >>> eric_browser.open('http://code.launchpad.dev/~eric') |
358 | 114 | >>> print_tag_with_id(eric_browser.contents, 'portlet-person-codesummary') | 114 | >>> print_tag_with_id(eric_browser.contents, 'portlet-person-codesummary') |
363 | 115 | 1 owned branch | 115 | Owned branches |
364 | 116 | 1 registered branch | 116 | Registered branches |
365 | 117 | 1 subscribed branch | 117 | Subscribed branches |
366 | 118 | 0 active reviews | 118 | Active reviews |
367 | 119 | Source package recipes | ||
368 | 119 | 120 | ||
369 | 120 | Now we'll create another branch, and unsubscribe the owner from it. | 121 | Now we'll create another branch, and unsubscribe the owner from it. |
370 | 121 | 122 | ||
371 | @@ -127,11 +128,11 @@ | |||
372 | 127 | >>> eric_browser.open('http://code.launchpad.dev/~eric') | 128 | >>> eric_browser.open('http://code.launchpad.dev/~eric') |
373 | 128 | >>> print_tag_with_id( | 129 | >>> print_tag_with_id( |
374 | 129 | ... eric_browser.contents, 'portlet-person-codesummary') | 130 | ... eric_browser.contents, 'portlet-person-codesummary') |
380 | 130 | 2 owned branches | 131 | Owned branches |
381 | 131 | 2 registered branches | 132 | Registered branches |
382 | 132 | 1 subscribed branch | 133 | Subscribed branches |
383 | 133 | 0 active reviews | 134 | Active reviews |
384 | 134 | 135 | Source package recipes | |
385 | 135 | 136 | ||
386 | 136 | Teams do not show registered branches | 137 | Teams do not show registered branches |
387 | 137 | ------------------------------------- | 138 | ------------------------------------- |
388 | @@ -142,9 +143,10 @@ | |||
389 | 142 | >>> browser.open('http://code.launchpad.dev/~landscape-developers') | 143 | >>> browser.open('http://code.launchpad.dev/~landscape-developers') |
390 | 143 | >>> print_tag_with_id( | 144 | >>> print_tag_with_id( |
391 | 144 | ... browser.contents, 'portlet-person-codesummary') | 145 | ... browser.contents, 'portlet-person-codesummary') |
395 | 145 | 1 owned branch | 146 | Owned branches |
396 | 146 | 2 subscribed branches | 147 | Subscribed branches |
397 | 147 | 0 active reviews | 148 | Active reviews |
398 | 149 | Source package recipes | ||
399 | 148 | 150 | ||
400 | 149 | >>> browser.getLink('registered').click() | 151 | >>> browser.getLink('registered').click() |
401 | 150 | Traceback (most recent call last): | 152 | Traceback (most recent call last): |
402 | 151 | 153 | ||
403 | === modified file 'lib/lp/code/stories/branches/xx-personproduct-branch-listings.txt' | |||
404 | --- lib/lp/code/stories/branches/xx-personproduct-branch-listings.txt 2010-10-15 16:41:50 +0000 | |||
405 | +++ lib/lp/code/stories/branches/xx-personproduct-branch-listings.txt 2012-10-04 01:12:22 +0000 | |||
406 | @@ -39,7 +39,7 @@ | |||
407 | 39 | 39 | ||
408 | 40 | >>> browser.open('http://code.launchpad.dev/~eric/fooix') | 40 | >>> browser.open('http://code.launchpad.dev/~eric/fooix') |
409 | 41 | >>> print_tag_with_id(browser.contents, 'portlet-person-codesummary') | 41 | >>> print_tag_with_id(browser.contents, 'portlet-person-codesummary') |
411 | 42 | 2 owned branches ... | 42 | Owned branches ... |
412 | 43 | >>> print_tag_with_id(browser.contents, 'branchtable') | 43 | >>> print_tag_with_id(browser.contents, 'branchtable') |
413 | 44 | Name ... | 44 | Name ... |
414 | 45 | lp://dev/~eric/fooix/feature ... | 45 | lp://dev/~eric/fooix/feature ... |
415 | 46 | 46 | ||
416 | === modified file 'lib/lp/code/templates/person-codesummary.pt' | |||
417 | --- lib/lp/code/templates/person-codesummary.pt 2012-02-21 12:11:11 +0000 | |||
418 | +++ lib/lp/code/templates/person-codesummary.pt 2012-10-04 01:12:22 +0000 | |||
419 | @@ -4,62 +4,28 @@ | |||
420 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
421 | 5 | id="portlet-person-codesummary" | 5 | id="portlet-person-codesummary" |
422 | 6 | class="portlet" | 6 | class="portlet" |
426 | 7 | tal:define="menu context/menu:branches; | 7 | tal:define="menu context/menu:branches; features request/features"> |
424 | 8 | features request/features" | ||
425 | 9 | tal:condition="menu/show_summary"> | ||
427 | 10 | 8 | ||
433 | 11 | <table tal:condition="not: menu/simplified_branches_menu"> | 9 | <table> |
434 | 12 | <tr class="code-links"> | 10 | <tr class="code-links" tal:condition="menu/owned/enabled"> |
435 | 13 | <td class="code-count" tal:content="menu/owned_branch_count">100</td> | 11 | <td tal:content="structure menu/owned/render" /> |
431 | 14 | <td tal:content="structure menu/owned/render" | ||
432 | 15 | /> | ||
436 | 16 | </tr> | 12 | </tr> |
440 | 17 | <tr class="code-links" | 13 | <tr class="code-links" tal:condition="menu/registered/enabled"> |
438 | 18 | tal:condition="menu/registered/enabled"> | ||
439 | 19 | <td class="code-count" tal:content="menu/registered_branch_count">100</td> | ||
441 | 20 | <td tal:content="structure menu/registered/render" /> | 14 | <td tal:content="structure menu/registered/render" /> |
442 | 21 | </tr> | 15 | </tr> |
445 | 22 | <tr class="code-links"> | 16 | <tr class="code-links" tal:condition="menu/subscribed/enabled"> |
444 | 23 | <td class="code-count" tal:content="menu/subscribed_branch_count">100</td> | ||
446 | 24 | <td tal:content="structure menu/subscribed/render" /> | 17 | <td tal:content="structure menu/subscribed/render" /> |
447 | 25 | </tr> | 18 | </tr> |
450 | 26 | <tr class="code-links" id="merge-counts"> | 19 | <tr class="code-links" |
451 | 27 | <td class="code-count" tal:content="menu/active_review_count">5</td> | 20 | tal:condition="menu/active_reviews/enabled"> |
452 | 28 | <td tal:content="structure menu/active_reviews/render" /> | 21 | <td tal:content="structure menu/active_reviews/render" /> |
453 | 29 | </tr> | 22 | </tr> |
454 | 30 | <tr tal:condition="features/code.branchmergequeue" id="mergequeue-counts"> | 23 | <tr tal:condition="features/code.branchmergequeue" id="mergequeue-counts"> |
455 | 31 | <td class="code-count" tal:content="menu/mergequeue_count">5</td> | 24 | <td class="code-count" tal:content="menu/mergequeue_count">5</td> |
456 | 32 | <td tal:condition="menu" | 25 | <td tal:condition="menu" |
487 | 33 | tal:content="structure menu/mergequeues/render" | 26 | tal:content="structure menu/mergequeues/render" /> |
488 | 34 | /> | 27 | </tr> |
489 | 35 | </tr> | 28 | <tr class="code-links" tal:condition="menu/source_package_recipes/enabled"> |
460 | 36 | </table> | ||
461 | 37 | |||
462 | 38 | <table tal:condition="menu/simplified_branches_menu"> | ||
463 | 39 | <tr class="code-links" | ||
464 | 40 | tal:condition="menu/simplified_owned/enabled"> | ||
465 | 41 | <td tal:content="structure menu/simplified_owned/render" /> | ||
466 | 42 | </tr> | ||
467 | 43 | <tr class="code-links" | ||
468 | 44 | tal:condition="menu/simplified_registered/enabled"> | ||
469 | 45 | <td tal:content="structure menu/simplified_registered/render" /> | ||
470 | 46 | </tr> | ||
471 | 47 | <tr class="code-links" | ||
472 | 48 | tal:condition="menu/simplified_subscribed/enabled"> | ||
473 | 49 | <td tal:content="structure menu/simplified_subscribed/render" /> | ||
474 | 50 | </tr> | ||
475 | 51 | <tr class="code-links" | ||
476 | 52 | tal:condition="menu/simplified_active_reviews/enabled"> | ||
477 | 53 | <td tal:content="structure menu/simplified_active_reviews/render" /> | ||
478 | 54 | </tr> | ||
479 | 55 | <tr tal:condition="features/code.branchmergequeue" id="mergequeue-counts"> | ||
480 | 56 | <td class="code-count" tal:content="menu/mergequeue_count">5</td> | ||
481 | 57 | <td tal:condition="menu" | ||
482 | 58 | tal:content="structure menu/mergequeues/render" | ||
483 | 59 | /> | ||
484 | 60 | </tr> | ||
485 | 61 | <tr class="code-links" | ||
486 | 62 | tal:condition="menu/source_package_recipes/enabled"> | ||
490 | 63 | <td tal:content="structure menu/source_package_recipes/render" /> | 29 | <td tal:content="structure menu/source_package_recipes/render" /> |
491 | 64 | </tr> | 30 | </tr> |
492 | 65 | </table> | 31 | </table> |
493 | 66 | 32 | ||
494 | === modified file 'lib/lp/services/features/flags.py' | |||
495 | --- lib/lp/services/features/flags.py 2012-10-02 06:36:44 +0000 | |||
496 | +++ lib/lp/services/features/flags.py 2012-10-04 01:12:22 +0000 | |||
497 | @@ -106,12 +106,6 @@ | |||
498 | 106 | '', | 106 | '', |
499 | 107 | '', | 107 | '', |
500 | 108 | ''), | 108 | ''), |
501 | 109 | ('code.simplified_branches_menu.enabled', | ||
502 | 110 | 'boolean', | ||
503 | 111 | ('Display a simplified version of the branch menu (omit the counts).'), | ||
504 | 112 | '', | ||
505 | 113 | '', | ||
506 | 114 | ''), | ||
507 | 115 | ('hard_timeout', | 109 | ('hard_timeout', |
508 | 116 | 'float', | 110 | 'float', |
509 | 117 | 'Sets the hard request timeout in milliseconds.', | 111 | 'Sets the hard request timeout in milliseconds.', |
Thank you.