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

Issue 14441054: Prevent direct charm id routes mis-firing.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by rharding
Modified:
10 years, 6 months ago
Reviewers:
matthew.scott, mp+190199
Visibility:
Public.

Description

Prevent direct charm id routes mis-firing. The routeDirectCharmId is ONLY meant to handle the case of short, id-only urls "jujucharms.com/precise/mysql". It assumes the viewmode (usually 'sidebar'). A fullscreen url was getting processed except that the viewmode was set to sidebar. This caused contention between the routeDirectCharmId and the routeView which would work like this - routeDirectCharmId: "Render this charm id I found in the url in sidebar mode" - routeView: "We've rendered crap, but that was sidebar so Render this charm id found in fullscreen" --Enter double dispatch - routeDirectCharmId: "Hmm, we've got crap rendered, but it was fullscreen so the viewmode has changed. Render this charm id in sidebar" - routeView: "Stupid sidebar, this clearly says to render it in fullscreen viewmode. Render it again." What should happen is that the routeDirectCharmId realizes that the url has more than a charmId in it and just bails out saying another route (routeView) will handle it altogether. QA: Just hit the url in the bug in your local branch and it should work perfectly without artifacts. https://code.launchpad.net/~rharding/juju-gui/dispatch-1235012/+merge/190199 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1

Patch Set 2 : Prevent direct charm id routes mis-firing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -2 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M app/subapps/browser/browser.js View 2 chunks +11 lines, -2 lines 0 comments Download
M test/test_browser_app.js View 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 4
rharding
Please take a look.
10 years, 6 months ago (2013-10-09 17:33:09 UTC) #1
rharding
Comment added https://codereview.appspot.com/14441054/diff/1/app/subapps/browser/browser.js File app/subapps/browser/browser.js (right): https://codereview.appspot.com/14441054/diff/1/app/subapps/browser/browser.js#newcode917 app/subapps/browser/browser.js:917: var viewmode = this.get('defaultViewmode'); Only moved this ...
10 years, 6 months ago (2013-10-09 17:34:04 UTC) #2
matthew.scott
LGTM, thanks!
10 years, 6 months ago (2013-10-09 18:55:53 UTC) #3
rharding
10 years, 6 months ago (2013-10-09 19:05:36 UTC) #4
*** Submitted:

Prevent direct charm id routes mis-firing.

The routeDirectCharmId is ONLY meant to handle the case of short, id-only urls
"jujucharms.com/precise/mysql". It assumes the viewmode (usually 'sidebar').

A fullscreen url was getting processed except that the viewmode was set to
sidebar. This caused contention between the routeDirectCharmId and the
routeView which would work like this

- routeDirectCharmId: "Render this charm id I found in the url in sidebar mode"
- routeView: "We've rendered crap, but that was sidebar so Render this charm
id found in fullscreen"

--Enter double dispatch

- routeDirectCharmId: "Hmm, we've got crap rendered, but it was fullscreen so
the viewmode has changed. Render this charm id in sidebar"
- routeView: "Stupid sidebar, this clearly says to render it in fullscreen
viewmode. Render it again."

What should happen is that the routeDirectCharmId realizes that the url has
more than a charmId in it and just bails out saying another route (routeView)
will handle it altogether.

QA: Just hit the url in the bug in your local branch and it should work
perfectly without artifacts.

R=matthew.scott
CC=
https://codereview.appspot.com/14441054
Sign in to reply to this message.

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