launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #00430
[Merge] lp:~bac/launchpad/progressbar_feature_switch into lp:launchpad/devel
Brad Crittenden has proposed merging lp:~bac/launchpad/progressbar_feature_switch into lp:launchpad/devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
#613429 Do not release project progress bar on lpnet until further work is done
https://bugs.launchpad.net/bugs/613429
= 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
--
https://code.launchpad.net/~bac/launchpad/progressbar_feature_switch/+merge/31749
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~bac/launchpad/progressbar_feature_switch into lp:launchpad/devel.
=== 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:46:15 +0000
@@ -127,6 +127,56 @@
{'done': 25,
'undone': 75}
+The progress bar is shown as a green bar.
+
+ >>> from canonical.launchpad.testing.pages import (
+ ... extract_text, find_tag_by_id)
+ >>> rendered = view.render()
+ >>> print find_tag_by_id(rendered, 'progressbar')
+ <div ... id="progressbar">
+ ...
+ <img src="/@@/green-bar" ... width="25".../>
+ ...
+
+Each application is displayed (except for blueprints) with an
+indicator showing whether it has been configured or not.
+
+ >>> print find_tag_by_id(rendered, 'configuration_links')
+ <table...
+ <a href="http://launchpad.dev/bread/+configure-bugtracker"...<span class="sprite yes">...
+ <a href="http://launchpad.dev/bread/+configure-answers"...<span class="sprite no">...
+ <a href="http://launchpad.dev/bread/+configure-translations"...<span class="sprite no">...
+ <a href="http://launchpad.dev/bread/trunk/+setbranch"...<span class="sprite no">...
+ </table>
+
+Until other supporting code lands, the progress bar is not going to be
+shown on lpnet.
+
+ >>> # Pretend that we're on launchpad.net:
+ >>> from canonical.config import config
+ >>> from textwrap import dedent
+ >>> test_data = dedent("""
+ ... [launchpad]
+ ... is_lpnet: True
+ ... """)
+ >>> config.push('test_data', test_data)
+
+The progress bar is not shown on lpnet.
+
+ >>> view = create_view(product, '+get-involved')
+ >>> rendered = view.render()
+ >>> print find_tag_by_id(rendered, 'progressbar')
+ None
+
+Neither are the indicator sprites.
+
+ >>> 'sprite' in find_tag_by_id(rendered, 'configuration_links')
+ False
+
+ >>> # Restore the previous config:
+ >>> config_data = config.pop('test_data')
+ >>> print config.launchpad.is_lpnet
+ False
Project groups are supported too, but they only display the applications used by
their products.
=== 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:46:15 +0000
@@ -3,6 +3,7 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
id="involvement" class="portlet"
tal:condition="view/has_involvement"
+ tal:define="is_lpnet modules/canonical.config/config/launchpad/is_lpnet;"
>
<h2>Get Involved</h2>
@@ -33,9 +34,11 @@
<tal:editor condition="context/required:launchpad.Edit"
define="registration view/registration_completeness">
+
+ <tal:not_lpnet condition="not:is_lpnet">
<tal:show_configuration condition="registration">
<h2>Configuration Progress</h2>
- <div class="centered">
+ <div class="centered" id="progressbar">
<table width="80%" border="1">
<tr>
<td>
@@ -51,17 +54,23 @@
</table>
</div>
</tal:show_configuration>
+ </tal:not_lpnet>
<table style="width: 100%; padding-top: 1em"
- tal:condition="view/configuration_links">
+ tal:condition="view/configuration_links"
+ id="configuration_links">
<tal:item repeat="link_status view/configuration_links">
<tr>
<td>
<a tal:replace="structure link_status/link/fmt:link" />
</td>
+
+ <tal:not_lpnet condition="not:is_lpnet">
<td style="text-align: right;" tal:condition="registration">
<tal:yes-no replace="structure link_status/configured/image:boolean" />
</td>
+ </tal:not_lpnet>
+
</tr>
</tal:item>
</table>