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

Issue 10086045: Prevent a case of charm details double dispatch.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by rharding
Modified:
10 years, 10 months ago
Reviewers:
benjamin.saller, mp+168053, j.c.sackett
Visibility:
Public.

Description

Prevent a case of charm details double dispatch. - This double dispatch caused the charm details to be rendered multiple times causing issues with the tabview. - We match multiple routes in the browser subapp. We always match on * for instance. In the case of the * route, a url path /charm/id will match, but not have a req.params.id set, this causes the _viewState to think there is no charm id in the request. Because of this, it clears any current _details View object. However, a later matched route *id will find the id and cause it to render again. This could happen a couple of times. - We create custom callables for the * and *id routes. - These callables only kick in and do any work at all if they're the perfect match for that path. - If they do not apply, then they ignore and carry on allowing later matching routes (more specific ones) to do their work correctly. https://code.launchpad.net/~rharding/juju-gui/details-double-dispatch/+merge/168053 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : Prevent a case of charm details double dispatch. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -29 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M app/modules-debug.js View 1 chunk +5 lines, -0 lines 0 comments Download
M app/subapps/browser/browser.js View 1 9 chunks +116 lines, -22 lines 0 comments Download
M app/subapps/browser/views/charm.js View 3 chunks +9 lines, -6 lines 0 comments Download
M app/templates/charm.handlebars View 1 chunk +1 line, -0 lines 0 comments Download
M test/test_browser_app.js View 1 3 chunks +57 lines, -1 line 0 comments Download

Messages

Total messages: 6
rharding
Please take a look.
10 years, 10 months ago (2013-06-07 16:11:16 UTC) #1
j.c.sackett
LGTM, but I think you have some redundant code. https://codereview.appspot.com/10086045/diff/1/app/subapps/browser/browser.js File app/subapps/browser/browser.js (right): https://codereview.appspot.com/10086045/diff/1/app/subapps/browser/browser.js#newcode721 app/subapps/browser/browser.js:721: ...
10 years, 10 months ago (2013-06-07 16:21:41 UTC) #2
benjamin.saller
LGTM w/ some trivials. Thanks for this. I have some suggestions you can take or ...
10 years, 10 months ago (2013-06-07 16:27:12 UTC) #3
rharding
On 2013/06/07 16:21:41, j.c.sackett wrote: > LGTM, but I think you have some redundant code. ...
10 years, 10 months ago (2013-06-07 17:06:42 UTC) #4
rharding
On 2013/06/07 16:27:12, benjamin.saller wrote: > https://codereview.appspot.com/10086045/diff/1/app/subapps/browser/browser.js > File app/subapps/browser/browser.js (right): > > https://codereview.appspot.com/10086045/diff/1/app/subapps/browser/browser.js#newcode875 > ...
10 years, 10 months ago (2013-06-07 17:13:59 UTC) #5
rharding
10 years, 10 months ago (2013-06-07 17:18:31 UTC) #6
*** Submitted:

Prevent a case of charm details double dispatch.

- This double dispatch caused the charm details to be rendered multiple times
  causing issues with the tabview.
- We match multiple routes in the browser subapp. We always match on * for
  instance. In the case of the * route, a url path /charm/id will match, but
  not have a req.params.id set, this causes the _viewState to think there is
  no charm id in the request. Because of this, it clears any current _details
  View object. However, a later matched route *id will find the id and cause
  it to render again. This could happen a couple of times.
- We create custom callables for the * and *id routes.
- These callables only kick in and do any work at all if they're the perfect
match for that path.
- If they do not apply, then they ignore and carry on allowing later matching
routes (more specific ones) to do their work correctly.

R=j.c.sackett, benjamin.saller
CC=
https://codereview.appspot.com/10086045
Sign in to reply to this message.

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