Merge lp:~rharding/launchpad/edit_product_info_type into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Richard Harding on 2012-10-05 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 16120 |
| Proposed branch: | lp:~rharding/launchpad/edit_product_info_type |
| Merge into: | lp:launchpad |
| Diff against target: |
474 lines (+231/-106) 5 files modified
lib/lp/registry/browser/configure.zcml (+1/-1) lib/lp/registry/browser/product.py (+30/-10) lib/lp/registry/javascript/product_views.js (+127/-72) lib/lp/registry/javascript/tests/test_product_views.js (+61/-22) lib/lp/registry/templates/project-edit.pt (+12/-1) |
| To merge this branch: | bzr merge lp:~rharding/launchpad/edit_product_info_type |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Abel Deuring (community) | code | 2012-10-04 | Approve on 2012-10-05 |
|
Review via email:
|
|||
Commit Message
Add the information type choice widget to project edit if the feature flag is enabled.
Description of the Change
= Summary =
There will be mistakes and users need to be able to change the information
type on their project using the ProjectEditView. This branch adds the
information type field and adds the JS to setup the choice widget and dealing
with the license setting in the same way it does for new project registration.
== Implementation Notes ==
In order to get the JS onto the page we needed to make sure we use
project-edit.pt.
The field is added in the same location as when registering a project. It adds
the choice widget.
There's a drive by moving the @property next_url up the class to be with the
other @property definitions.
The field is only available if the feature flag is set so we adjust the field
using setUpFields and make sure to omit the information_type if the feature
flag isn't set.
Large chunks of the JS are moved out into shared functions so that each View
class can share the code that watches the information type for changes and
respond with showing/hiding the license fields and such.
We add a new JS view EditProduct that is figured for the edit page. This only
sets up events if the information type field is set and is safe if the feature
flag is not set. It'll just be inert JS.
_information_
bind_informatio
The tests are setup to share setUp, tearDown, and the set of asserts for the
license changes. The product edit view doesn't have bug_supervisor or driver
fields to update.
== Q/A ==
Register a new project with a private information type. Then, once it's
created, "Change details" and select a Public information type.
== Known Issues ==
If the project starts out as public you cannot currently change it to a private type as you don't have a commercial subscription. A follow up branch will add that into place.
== Tests ==
test_product_
