Merge lp:~jcsackett/launchpad/distribution-enum-selection-677536 into lp:launchpad

Proposed by j.c.sackett
Status: Merged
Approved by: Aaron Bentley
Approved revision: no longer in the source branch.
Merged at revision: 12002
Proposed branch: lp:~jcsackett/launchpad/distribution-enum-selection-677536
Merge into: lp:launchpad
Diff against target: 95 lines (+18/-18)
3 files modified
lib/lp/registry/browser/distribution.py (+4/-4)
lib/lp/registry/browser/tests/distribution-views.txt (+3/-3)
lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt (+11/-11)
To merge this branch: bzr merge lp:~jcsackett/launchpad/distribution-enum-selection-677536
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+42161@code.launchpad.net

Commit message

[r=abentley][ui=none][bug=677536] Updates interface for distribution edit and add views to allow full range of usage options on answers and blueprints.

Description of the change

Summary
=======
Although internally distributions now use the usage enums phased in for bridging the gap, they don't expose those settings where appropriate.

This branch exposes them for answers and blueprints. Bugs and translations both require more in depth solutions, making them more appropriately separate bugs.

Proposed fix
============
Switch use of official_* booleans for *_usage enums in the field names for distribution. All other work was already done.

Preimplementation talk
======================
Spoke with Curtis Hovey and Robert Collins (via comments on bug) regarding scope.

Implementation details
======================
As in Proposed.

Tests
=====
bin/test -t distribution-views

Demo & QA
=========
Go to launchpad.dev/ubuntu/+edit; you should now have an enum selection for blue prints and answers.

Lint
====
make lint output:

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/browser/distribution.py
  lib/lp/registry/browser/tests/distribution-views.txt

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/browser/distribution.py'
--- lib/lp/registry/browser/distribution.py 2010-11-23 23:22:27 +0000
+++ lib/lp/registry/browser/distribution.py 2010-11-30 15:26:33 +0000
@@ -741,9 +741,9 @@
741 "domainname",741 "domainname",
742 "members",742 "members",
743 "official_malone",743 "official_malone",
744 "official_blueprints",744 "blueprints_usage",
745 "official_rosetta",745 "official_rosetta",
746 "official_answers",746 "answers_usage",
747 ]747 ]
748748
749 @property749 @property
@@ -787,9 +787,9 @@
787 'mugshot',787 'mugshot',
788 'official_malone',788 'official_malone',
789 'enable_bug_expiration',789 'enable_bug_expiration',
790 'official_blueprints',790 'blueprints_usage',
791 'official_rosetta',791 'official_rosetta',
792 'official_answers',792 'answers_usage',
793 'translation_focus',793 'translation_focus',
794 ]794 ]
795795
796796
=== modified file 'lib/lp/registry/browser/tests/distribution-views.txt'
--- lib/lp/registry/browser/tests/distribution-views.txt 2010-11-03 14:40:53 +0000
+++ lib/lp/registry/browser/tests/distribution-views.txt 2010-11-30 15:26:33 +0000
@@ -51,8 +51,8 @@
5151
52 >>> view.field_names52 >>> view.field_names
53 ['name', 'displayname', 'title', 'summary', 'description', 'domainname',53 ['name', 'displayname', 'title', 'summary', 'description', 'domainname',
54 'members', 'official_malone', 'official_blueprints', 'official_rosetta',54 'members', 'official_malone', 'blueprints_usage', 'official_rosetta',
55 'official_answers']55 'answers_usage']
5656
57 >>> login("admin@canonical.com")57 >>> login("admin@canonical.com")
58 >>> form = {58 >>> form = {
@@ -113,7 +113,7 @@
113 ['displayname', 'title', 'summary', 'description',113 ['displayname', 'title', 'summary', 'description',
114 'bug_reporting_guidelines', 'bug_reported_acknowledgement', 'icon',114 'bug_reporting_guidelines', 'bug_reported_acknowledgement', 'icon',
115 'logo', 'mugshot', 'official_malone', 'enable_bug_expiration',115 'logo', 'mugshot', 'official_malone', 'enable_bug_expiration',
116 'official_blueprints', 'official_rosetta', 'official_answers',116 'blueprints_usage', 'official_rosetta', 'answers_usage',
117 'translation_focus']117 'translation_focus']
118118
119 >>> del form['field.name']119 >>> del form['field.name']
120120
=== modified file 'lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt'
--- lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt 2010-09-30 21:00:37 +0000
+++ lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt 2010-11-30 15:26:33 +0000
@@ -31,10 +31,10 @@
31 True31 True
32 >>> print registrant.getControl(name='field.enable_bug_expiration').value32 >>> print registrant.getControl(name='field.enable_bug_expiration').value
33 True33 True
34 >>> print registrant.getControl(name='field.official_blueprints').value34 >>> print registrant.getControl(name='field.blueprints_usage').value[0]
35 True35 LAUNCHPAD
36 >>> print registrant.getControl(name='field.official_answers').value36 >>> print registrant.getControl(name='field.answers_usage').value[0]
37 True37 LAUNCHPAD
3838
39 >>> registrant.getControl(name='field.official_rosetta').value = False39 >>> registrant.getControl(name='field.official_rosetta').value = False
40 >>> registrant.getControl('Change', index=3).click()40 >>> registrant.getControl('Change', index=3).click()
@@ -52,17 +52,17 @@
52 >>> print admin_browser.getControl(52 >>> print admin_browser.getControl(
53 ... name='field.enable_bug_expiration').value53 ... name='field.enable_bug_expiration').value
54 True54 True
55 >>> print admin_browser.getControl(name='field.official_blueprints').value55 >>> print admin_browser.getControl(name='field.blueprints_usage').value[0]
56 True56 LAUNCHPAD
57 >>> print admin_browser.getControl(name='field.official_answers').value57 >>> print admin_browser.getControl(name='field.answers_usage').value[0]
58 True58 LAUNCHPAD
5959
60 >>> admin_browser.getControl(60 >>> admin_browser.getControl(
61 ... name='field.enable_bug_expiration').value = False61 ... name='field.enable_bug_expiration').value = False
62 >>> admin_browser.getControl(name='field.official_malone').value = False62 >>> admin_browser.getControl(name='field.official_malone').value = False
63 >>> admin_browser.getControl(name='field.official_blueprints').value = (63 >>> admin_browser.getControl(name='field.blueprints_usage').value = (
64 ... False)64 ... ['UNKNOWN'])
65 >>> admin_browser.getControl(name='field.official_answers').value = False65 >>> admin_browser.getControl(name='field.answers_usage').value = ['UNKNOWN']
66 >>> admin_browser.getControl('Change', index=3).click()66 >>> admin_browser.getControl('Change', index=3).click()
6767
68 >>> print admin_browser.url68 >>> print admin_browser.url