Merge lp:~wallyworld/launchpad/request-build-popup into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Ian Booth | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 12422 | ||||
Proposed branch: | lp:~wallyworld/launchpad/request-build-popup | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
792 lines (+540/-122) 8 files modified
lib/lp/code/browser/configure.zcml (+8/-1) lib/lp/code/browser/sourcepackagerecipe.py (+104/-37) lib/lp/code/javascript/requestbuild_overlay.js (+214/-0) lib/lp/code/model/sourcepackagerecipe.py (+3/-1) lib/lp/code/templates/sourcepackagerecipe-builds.pt (+79/-0) lib/lp/code/templates/sourcepackagerecipe-index.pt (+33/-83) lib/lp/code/windmill/tests/test_recipe_request_build.py (+96/-0) lib/lp/soyuz/model/archive.py (+3/-0) |
||||
To merge this branch: | bzr merge lp:~wallyworld/launchpad/request-build-popup | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Penhey (community) | Approve | ||
Curtis Hovey (community) | ui | Approve | |
Review via email: mp+48864@code.launchpad.net |
Commit message
[r=thumper]
Description of the change
This branch introduces a popup form to allow the user to initiate recipe builds. Previously, a separate page load was used to display a standard html form.
== Implementation ==
The existing SourcePackageRe
- SourcePackageRe
- SourcePackageRe
The base class defines the form schema and provides the validation functionality. The individual subclasses provide slightly different implementations of the submit action, error handling and data rendering.
The html form behaves as previously. It renders the form page and relies on the underlying Launchpad form error handling to display field errors etc.
The ajax form works slightly differently. It renders just the recipe builds table (via a new +builds Zope URL). So when build(s) are requested and everything goes ok, a new version of the builds table is returned and the Javascrip ajax handler re-renders that part of the recipe page, flashing the rows of new builds. If there are errors, the ajax form returns a json data object containing the errors and sets the request status code to 400. This allows the client side Javascript to parse the json data and display the errors on the popup form. At the moment, only a single form wide error message is used, even though the json data contains field level errors. This is a limitation of the lazr.js FormOverlay implementation.
On the client side, the popup form acts modally. Client side validation is done and errors displayed on the form without a back end request - this is used to check that at least on distro series has been selected. Once the submit button is presses, the "please wait" spinner appears on the popup form. If the request went ok, the form disappears the the recipe page updated. If there are errors, the form stays visible and the errors are displayed on the form. This allows the user to correct any issues and try again. The most common case would be a user requesting an identical build to one already pending. They just need to untick that distro series and try again.
A driveby change was to make the pocket parameter of the requestBuild() method on SourcePackageRecipe default to PackagePublishi
== Demo ==
See screenshot: http://
The screenshot shows how an error is displayed, but also gives a good indication of what the form looks like. The form is standard lazr.js functionality.
== QA ==
Simply use the form to initiate some recipe builds and ensure the overall functionality is equivalent to that of the html form.
== Tests ==
A new Windmill test was written to check the form can initiate a build and display errors as required.
bin/test -vvt test_recipe_
== Lint ==
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
13: unbound prefix
The check and cross button look wrong. I do not know of any other "popups" or "overlays" that use them. I only see them used when editing inline content. I do not think they mean submit or cancel. I think users believe they mean done editing or cancel editing.
I expect to see a button [Request Build] to submit the form. Overlay forms use a [Cancel] button, but I think that contradicts the _Cancel_ rule for page forms. Most popups (gosh, maybe all) place the cancel (x) icon in the top right corner. There is a rule (maybe in code) that when the (x) cancel icon is in the right corner the popup will be dismissed when the user clicks outside the popup. Overlays remain on visible when he user clicks outside. I think the unfocus rule will help us decide the buttons.
If the popup is dismissed when it loses focus, place the (x) cancel icon in the right corner. If it should remain, we use a [Cancel] button. The submit button should be [Request Build].
/me is very aware that the NE cancel icon contradicts his unity desktop conventions