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

Issue 8640043: Make safe relation ids in environment view

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

Description

Make safe relation ids in environment view Relation ids included spaces and other problematic chacracters in our related DOM ids. This branch cleans those up, and also does a quick CSS cleanup to make some text legible again. https://code.launchpad.net/~gary/juju-gui/bug1167295/+merge/158224 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Make safe relation ids in environment view #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -10 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M app/templates/unit.handlebars View 1 chunk +1 line, -1 line 0 comments Download
M app/views/topology/relation.js View 4 chunks +4 lines, -4 lines 0 comments Download
M app/views/utils.js View 1 chunk +35 lines, -0 lines 2 comments Download
M lib/views/stylesheet.less View 1 chunk +1 line, -0 lines 0 comments Download
M test/test_environment_view.js View 4 chunks +14 lines, -3 lines 0 comments Download
M test/test_topology_relation.js View 2 chunks +4 lines, -2 lines 0 comments Download
M test/test_utils.js View 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 6
gary.poster
Please take a look.
11 years ago (2013-04-10 21:22:48 UTC) #1
jeff.pihach
LGTM - nice clean approach!
11 years ago (2013-04-10 21:37:07 UTC) #2
matthew.scott
LGTM - thanks!
11 years ago (2013-04-10 22:19:20 UTC) #3
gary.poster
*** Submitted: Make safe relation ids in environment view Relation ids included spaces and other ...
11 years ago (2013-04-10 23:24:56 UTC) #4
benji
The generateSafeDOMId function doesn't quite generate safe IDs. See below. https://codereview.appspot.com/8640043/diff/4001/app/views/utils.js File app/views/utils.js (right): https://codereview.appspot.com/8640043/diff/4001/app/views/utils.js#newcode46 ...
11 years ago (2013-04-11 12:39:44 UTC) #5
benji
11 years ago (2013-04-11 13:16:53 UTC) #6
https://codereview.appspot.com/8640043/diff/4001/app/views/utils.js
File app/views/utils.js (right):

https://codereview.appspot.com/8640043/diff/4001/app/views/utils.js#newcode46
app/views/utils.js:46: value.replace(/\W/g, '_') + '-' + generateHash(value));
I just realized that there is another small issue with using \W: it doesn't
include the dash character, so dashes will unnecessarily be transformed into
underscores.

I would use an inverted character class instead of \W, [^-a-zA-Z0-9] in
particular.
Sign in to reply to this message.

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