Merge lp:~bac/launchpad/progressbar_feature_switch into lp:launchpad

Proposed by Brad Crittenden
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: 11294
Proposed branch: lp:~bac/launchpad/progressbar_feature_switch
Merge into: lp:launchpad
Diff against target: 119 lines (+67/-5)
2 files modified
lib/lp/registry/browser/tests/pillar-views.txt (+56/-3)
lib/lp/registry/templates/pillar-involvement-portlet.pt (+11/-2)
To merge this branch: bzr merge lp:~bac/launchpad/progressbar_feature_switch
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code Approve
Review via email: mp+31749@code.launchpad.net

Commit message

Don't show the new project progress bar on lpnet for now.

Description of the change

= Summary =

The project progress bar is OK to deploy on edge but should not be put
on lpnet until further work is done.

== Proposed fix ==

In the page template simply trap the display of the progress bar and
status indicators.

== Pre-implementation notes ==

Talk with Curtis.

== Implementation details ==

As above.

== Tests ==

bin/test -vvt pillar-views.txt

== Demo and Q/A ==

After roll-out go to a project you administer on edge and you should see
the progress bar. On lpnet there should be none.

= Launchpad lint =

Will fix these

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/templates/pillar-involvement-portlet.pt
  lib/lp/registry/browser/tests/pillar-views.txt

./lib/lp/registry/browser/tests/pillar-views.txt
     146: want exceeds 78 characters.
     147: want exceeds 78 characters.
     148: want exceeds 78 characters.
     149: want exceeds 78 characters.
     179: narrative exceeds 78 characters.
     132: 'extract_text' imported but unused

To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Hi Brad,

This is pretty sweet. I was hoping to see the feature flags in action, but that appears to be waiting on the rollout for the database tables to be added.

-Edwin

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/browser/tests/pillar-views.txt'
--- lib/lp/registry/browser/tests/pillar-views.txt 2010-08-02 20:26:40 +0000
+++ lib/lp/registry/browser/tests/pillar-views.txt 2010-08-04 12:49:10 +0000
@@ -127,9 +127,62 @@
127 {'done': 25,127 {'done': 25,
128 'undone': 75}128 'undone': 75}
129129
130130The progress bar is shown as a green bar.
131Project groups are supported too, but they only display the applications used by131
132their products.132 >>> from canonical.launchpad.testing.pages import find_tag_by_id
133 >>> rendered = view.render()
134 >>> print find_tag_by_id(rendered, 'progressbar')
135 <div ... id="progressbar">
136 ...
137 <img src="/@@/green-bar" ... width="25".../>
138 ...
139
140Each application is displayed (except for blueprints) with an
141indicator showing whether it has been configured or not.
142
143 >>> print find_tag_by_id(rendered, 'configuration_links')
144 <table...
145 <a href="http://launchpad.dev/bread/+configure-bugtracker"...
146 <span class="sprite yes">...
147 <a href="http://launchpad.dev/bread/+configure-answers"...
148 <span class="sprite no">...
149 <a href="http://launchpad.dev/bread/+configure-translations"...
150 <span class="sprite no">...
151 <a href="http://launchpad.dev/bread/trunk/+setbranch"...
152 <span class="sprite no">...
153 </table>
154
155Until other supporting code lands, the progress bar is not going to be
156shown on lpnet.
157
158 >>> # Pretend that we're on launchpad.net:
159 >>> from canonical.config import config
160 >>> from textwrap import dedent
161 >>> test_data = dedent("""
162 ... [launchpad]
163 ... is_lpnet: True
164 ... """)
165 >>> config.push('test_data', test_data)
166
167The progress bar is not shown on lpnet.
168
169 >>> view = create_view(product, '+get-involved')
170 >>> rendered = view.render()
171 >>> print find_tag_by_id(rendered, 'progressbar')
172 None
173
174Neither are the indicator sprites.
175
176 >>> 'sprite' in find_tag_by_id(rendered, 'configuration_links')
177 False
178
179 >>> # Restore the previous config:
180 >>> config_data = config.pop('test_data')
181 >>> print config.launchpad.is_lpnet
182 False
183
184Project groups are supported too, but they only display the
185applications used by their products.
133186
134 >>> project_group = factory.makeProject(name='box', owner=product.owner)187 >>> project_group = factory.makeProject(name='box', owner=product.owner)
135 >>> product.project = project_group188 >>> product.project = project_group
136189
=== modified file 'lib/lp/registry/templates/pillar-involvement-portlet.pt'
--- lib/lp/registry/templates/pillar-involvement-portlet.pt 2010-08-02 22:03:33 +0000
+++ lib/lp/registry/templates/pillar-involvement-portlet.pt 2010-08-04 12:49:10 +0000
@@ -3,6 +3,7 @@
3 xmlns:i18n="http://xml.zope.org/namespaces/i18n"3 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
4 id="involvement" class="portlet"4 id="involvement" class="portlet"
5 tal:condition="view/has_involvement"5 tal:condition="view/has_involvement"
6 tal:define="is_lpnet modules/canonical.config/config/launchpad/is_lpnet;"
6 >7 >
7 <h2>Get Involved</h2>8 <h2>Get Involved</h2>
89
@@ -33,9 +34,11 @@
3334
34 <tal:editor condition="context/required:launchpad.Edit"35 <tal:editor condition="context/required:launchpad.Edit"
35 define="registration view/registration_completeness">36 define="registration view/registration_completeness">
37
38 <tal:not_lpnet condition="not:is_lpnet">
36 <tal:show_configuration condition="registration">39 <tal:show_configuration condition="registration">
37 <h2>Configuration Progress</h2>40 <h2>Configuration Progress</h2>
38 <div class="centered">41 <div class="centered" id="progressbar">
39 <table width="80%" border="1">42 <table width="80%" border="1">
40 <tr>43 <tr>
41 <td>44 <td>
@@ -51,17 +54,23 @@
51 </table>54 </table>
52 </div>55 </div>
53 </tal:show_configuration>56 </tal:show_configuration>
57 </tal:not_lpnet>
5458
55 <table style="width: 100%; padding-top: 1em"59 <table style="width: 100%; padding-top: 1em"
56 tal:condition="view/configuration_links">60 tal:condition="view/configuration_links"
61 id="configuration_links">
57 <tal:item repeat="link_status view/configuration_links">62 <tal:item repeat="link_status view/configuration_links">
58 <tr>63 <tr>
59 <td>64 <td>
60 <a tal:replace="structure link_status/link/fmt:link" />65 <a tal:replace="structure link_status/link/fmt:link" />
61 </td>66 </td>
67
68 <tal:not_lpnet condition="not:is_lpnet">
62 <td style="text-align: right;" tal:condition="registration">69 <td style="text-align: right;" tal:condition="registration">
63 <tal:yes-no replace="structure link_status/configured/image:boolean" />70 <tal:yes-no replace="structure link_status/configured/image:boolean" />
64 </td>71 </td>
72 </tal:not_lpnet>
73
65 </tr>74 </tr>
66 </tal:item>75 </tal:item>
67 </table>76 </table>