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
1=== modified file 'lib/lp/registry/browser/tests/pillar-views.txt'
2--- lib/lp/registry/browser/tests/pillar-views.txt 2010-08-02 20:26:40 +0000
3+++ lib/lp/registry/browser/tests/pillar-views.txt 2010-08-04 12:49:10 +0000
4@@ -127,9 +127,62 @@
5 {'done': 25,
6 'undone': 75}
7
8-
9-Project groups are supported too, but they only display the applications used by
10-their products.
11+The progress bar is shown as a green bar.
12+
13+ >>> from canonical.launchpad.testing.pages import find_tag_by_id
14+ >>> rendered = view.render()
15+ >>> print find_tag_by_id(rendered, 'progressbar')
16+ <div ... id="progressbar">
17+ ...
18+ <img src="/@@/green-bar" ... width="25".../>
19+ ...
20+
21+Each application is displayed (except for blueprints) with an
22+indicator showing whether it has been configured or not.
23+
24+ >>> print find_tag_by_id(rendered, 'configuration_links')
25+ <table...
26+ <a href="http://launchpad.dev/bread/+configure-bugtracker"...
27+ <span class="sprite yes">...
28+ <a href="http://launchpad.dev/bread/+configure-answers"...
29+ <span class="sprite no">...
30+ <a href="http://launchpad.dev/bread/+configure-translations"...
31+ <span class="sprite no">...
32+ <a href="http://launchpad.dev/bread/trunk/+setbranch"...
33+ <span class="sprite no">...
34+ </table>
35+
36+Until other supporting code lands, the progress bar is not going to be
37+shown on lpnet.
38+
39+ >>> # Pretend that we're on launchpad.net:
40+ >>> from canonical.config import config
41+ >>> from textwrap import dedent
42+ >>> test_data = dedent("""
43+ ... [launchpad]
44+ ... is_lpnet: True
45+ ... """)
46+ >>> config.push('test_data', test_data)
47+
48+The progress bar is not shown on lpnet.
49+
50+ >>> view = create_view(product, '+get-involved')
51+ >>> rendered = view.render()
52+ >>> print find_tag_by_id(rendered, 'progressbar')
53+ None
54+
55+Neither are the indicator sprites.
56+
57+ >>> 'sprite' in find_tag_by_id(rendered, 'configuration_links')
58+ False
59+
60+ >>> # Restore the previous config:
61+ >>> config_data = config.pop('test_data')
62+ >>> print config.launchpad.is_lpnet
63+ False
64+
65+Project groups are supported too, but they only display the
66+applications used by their products.
67
68 >>> project_group = factory.makeProject(name='box', owner=product.owner)
69 >>> product.project = project_group
70
71=== modified file 'lib/lp/registry/templates/pillar-involvement-portlet.pt'
72--- lib/lp/registry/templates/pillar-involvement-portlet.pt 2010-08-02 22:03:33 +0000
73+++ lib/lp/registry/templates/pillar-involvement-portlet.pt 2010-08-04 12:49:10 +0000
74@@ -3,6 +3,7 @@
75 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
76 id="involvement" class="portlet"
77 tal:condition="view/has_involvement"
78+ tal:define="is_lpnet modules/canonical.config/config/launchpad/is_lpnet;"
79 >
80 <h2>Get Involved</h2>
81
82@@ -33,9 +34,11 @@
83
84 <tal:editor condition="context/required:launchpad.Edit"
85 define="registration view/registration_completeness">
86+
87+ <tal:not_lpnet condition="not:is_lpnet">
88 <tal:show_configuration condition="registration">
89 <h2>Configuration Progress</h2>
90- <div class="centered">
91+ <div class="centered" id="progressbar">
92 <table width="80%" border="1">
93 <tr>
94 <td>
95@@ -51,17 +54,23 @@
96 </table>
97 </div>
98 </tal:show_configuration>
99+ </tal:not_lpnet>
100
101 <table style="width: 100%; padding-top: 1em"
102- tal:condition="view/configuration_links">
103+ tal:condition="view/configuration_links"
104+ id="configuration_links">
105 <tal:item repeat="link_status view/configuration_links">
106 <tr>
107 <td>
108 <a tal:replace="structure link_status/link/fmt:link" />
109 </td>
110+
111+ <tal:not_lpnet condition="not:is_lpnet">
112 <td style="text-align: right;" tal:condition="registration">
113 <tal:yes-no replace="structure link_status/configured/image:boolean" />
114 </td>
115+ </tal:not_lpnet>
116+
117 </tr>
118 </tal:item>
119 </table>