Merge lp:~dooferlad/launchpad/upcomingwork-expand-all into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Curtis Hovey on 2012-06-13 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 15410 | ||||
| Proposed branch: | lp:~dooferlad/launchpad/upcomingwork-expand-all | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
543 lines (+476/-12) 4 files modified
lib/lp/blueprints/javascript/tests/test_workitems.html (+211/-0) lib/lp/blueprints/javascript/tests/test_workitems.js (+153/-0) lib/lp/blueprints/javascript/workitems.js (+94/-0) lib/lp/registry/templates/person-upcomingwork.pt (+18/-12) |
||||
| To merge this branch: | bzr merge lp:~dooferlad/launchpad/upcomingwork-expand-all | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Curtis Hovey (community) | code | 2012-05-23 | Approve on 2012-06-13 |
| James Tunnicliffe (community) | Resubmit on 2012-06-13 | ||
|
Review via email:
|
|||
Commit Message
Upcoming work page should have expand all links
Description of the Change
-- Summary
Feature Request: Upcoming work page should have expand all links. I also added collapse all and set back to default links since these seemed like logical extensions of the same feature (and likely to be requested if they weren’t present).
-- Proposed fix
Add JavaScript links to upcoming work view to expand / collapse / restore all work item lists for a blueprint.
-- Pre-implementation notes
None.
-- Implementation details
person-
-- LOC Rationale
Added a few lines because of new functionality. These will be more than offset by:
https:/
-- Tests
None.
-- Demo and Q/A
1. In a dev instance run http://
2. Visit https:/
-- Lint
None.
| James Tunnicliffe (dooferlad) wrote : | # |
Thanks for the review.
I haven't started on tests yet, but I have moved the existing code around as requested (I hope), so feedback on that is welcome.
| Curtis Hovey (sinzui) wrote : | # |
Thank you for extracting the code.
Consider using
!Y.
for
expanders[
The code needs an array. or just use
!Y.Lang.
if you just want to be sure there is something.
| James Tunnicliffe (dooferlad) wrote : | # |
Hi,
I am not sure how best to proceed with testing. I have got a test JS and HTML set up with a bit of example layout in the HTML for the JS to search through. It is my intention to run setUpWorkItemEx
Other tests would start using the same template but simulate clicks to test each on click function is run when expected.
So, to do this I would need to pass in Y.lp.app.
One odd thing is that the JS console at the moment (in Chrome) contains:
TestRunner: Testing began at Fri May 25 2012 15:53:01 GMT+0100 (BST).
TestRunner: Test suite "lp.workitems.
TestRunner: Testing began at Fri May 25 2012 15:53:01 GMT+0100 (BST).
TestRunner: Test suite "yuitests133795
TestRunner: Test case "setUpWorkItemE
TestRunner: Test suite "yuitests133795
Passed:0 Failed:0 Total:0 (0 ignored)
TestRunner: Testing completed at Fri May 25 2012 15:53:01 GMT+0100 (BST).
Passed:0 Failed:0 Total:0 (0 ignored)
TestRunner: test_setUpWorkI
Unexpected error: Cannot call method 'reversible_
TestRunner: Test case "setUpWorkItemE
Passed:0 Failed:1 Total:1 (0 ignored)
TestRunner: Test suite "lp.workitems.
Passed:0 Failed:1 Total:1 (0 ignored)
TestRunner: Testing completed at Fri May 25 2012 15:53:03 GMT+0100 (BST).
Passed:0 Failed:1 Total:1 (0 ignored)
I don't know where the Test suite "yuitests<random number>" came from. Only they are visible in the browser based console. I have pushed my branch so you can have a look at it, if you want to.
| Curtis Hovey (sinzui) wrote : | # |
You can ignore the random numbers. YUI assigns a unique id to every node it creates.
The test-suite should only test the functions in the code you wrote. We want to verify that the correct function is wired to the correct element. Since the functions are anonymous, I imagine we want to test that the element has or does not have the "hidden" class.
According to the module you created, it only requires lp.app.
The html file is not setup to be reset by the test. Take a look at
lib/
Which uses the 'type="
test_util.js is testing several setup functions that also do hide and show (but not expanders). You might find this test helpful because it illustrates how to verify a method was called during an event, then checks the final state of the element. I think this style of test could be adapted by passing in an example expander config.
| James Tunnicliffe (dooferlad) wrote : | # |
I believe I have addressed the previous comments. Please re-review.
Thanks!
| Curtis Hovey (sinzui) wrote : | # |
Lines 256 and 269 are missing the space between the keyword and the predicate:
if(
should be
if (
This looks good. I can land this once you fix the space.
| James Tunnicliffe (dooferlad) wrote : | # |
Done.

This JavaScript belongs in a module and requires a YUI test to verify it works. The lint report of the module will catch errors that commonly break older browsers as well as pointing out style issue. JavaScript uses 4-space identation
Avoid
var things = new Array();
Use
var things = [];
The floated div must be before the text "Blueprint" to display consistently across browsers. There is leading white-space.
I think this template is creating non-unique ids. This breaks many browsers. A proper test would catch this.