Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(464)

Issue 9119044: Converted service and unit views to use promises

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by jeff.pihach
Modified:
11 years ago
Reviewers:
mp+162224, gary.poster, bcsaller
Visibility:
Public.

Description

Converted service and unit views to use promises -Attempt at a clean diff- In addition to converting the unit and service views to use promises: If the user is viewing a service and that service is no longer available it will redirect them to the environment with a notification. If the user is viewing a unit and that unit is no longer available the user will be redirected to the service. If the user is viewing a unit and that units service is no longer available then the user will be redirected to the service. https://code.launchpad.net/~hatch/juju-gui/view-promises-merge/+merge/162224 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Converted service and unit views to use promises #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+276 lines, -180 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M app/app.js View 1 7 chunks +105 lines, -35 lines 4 comments Download
M app/views/service.js View 8 chunks +160 lines, -134 lines 1 comment Download
M test/test_app.js View 1 chunk +1 line, -1 line 0 comments Download
M test/test_service_view.js View 2 chunks +8 lines, -10 lines 0 comments Download

Messages

Total messages: 5
jeff.pihach
Please take a look.
11 years ago (2013-05-02 19:17:57 UTC) #1
jeff.pihach
Please take a look.
11 years ago (2013-05-02 19:59:30 UTC) #2
gary.poster
looks good. qa'ing. https://codereview.appspot.com/9119044/diff/3001/app/app.js File app/app.js (right): https://codereview.appspot.com/9119044/diff/3001/app/app.js#newcode597 app/app.js:597: // or showing details but the ...
11 years ago (2013-05-02 21:01:02 UTC) #3
gary.poster
LGTM with a conflict resolution with trunk that handles the "I have no units of ...
11 years ago (2013-05-02 21:22:56 UTC) #4
bcsaller
11 years ago (2013-05-02 21:25:46 UTC) #5
LGTM

There was a trivial or two in there and some forward looking notes I would like
your thoughts on though.

https://codereview.appspot.com/9119044/diff/3001/app/app.js
File app/app.js (right):

https://codereview.appspot.com/9119044/diff/3001/app/app.js#newcode519
app/app.js:519: var handle = setTimeout(function() {
I can envision a way that we can declare requirements for views and reuse this
pattern such that 

create an Array of promises for requirements
create timeout handler
Y.batch(requirementPromises)
.then(...
      cancelTimeout
      showView
)

Maybe something for the future, its a DRY violation to have to repeat this setup
pattern. 

Fine for now though.

https://codereview.appspot.com/9119044/diff/3001/app/app.js#newcode864
app/app.js:864: match = /(logout|:gui:\/(charms|service|unit))/;
I'd almost rather the routes contained metadata, like 
allowBrowser: false than trying to capture it here. The problem with this is we
work to make routes reversible from models and not staticly coded into the app.
This is a DRY violation in that we encode app urls in yet another place.

Notes for the future I guess.

https://codereview.appspot.com/9119044/diff/3001/app/app.js#newcode899
app/app.js:899: next(); return;
newline

https://codereview.appspot.com/9119044/diff/3001/app/views/service.js
File app/views/service.js (right):

https://codereview.appspot.com/9119044/diff/3001/app/views/service.js#newcode480
app/views/service.js:480: 
nice improvement
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b