Merge lp:~abentley/launchpad/view-flags into lp:launchpad
Status: | Merged |
---|---|
Merged at revision: | 14333 |
Proposed branch: | lp:~abentley/launchpad/view-flags |
Merge into: | lp:launchpad |
Prerequisite: | lp:~abentley/launchpad/next-prev |
Diff against target: |
495 lines (+159/-117) 7 files modified
lib/canonical/launchpad/webapp/publisher.py (+25/-25) lib/canonical/launchpad/webapp/tests/test_publisher.py (+87/-63) lib/canonical/launchpad/webapp/tests/test_view_model.py (+3/-3) lib/lp/app/javascript/beta-notification.js (+11/-16) lib/lp/app/javascript/tests/test_beta_notification.html (+2/-0) lib/lp/app/javascript/tests/test_beta_notification.js (+30/-9) lib/lp/bugs/browser/bugtask.py (+1/-1) |
To merge this branch: | bzr merge lp:~abentley/launchpad/view-flags |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+82570@code.launchpad.net |
Commit message
Provide access to feature flags in JavaScript.
Description of the change
= Summary =
Make feature flags available to JavaScript
== Proposed fix ==
Tweak the existing beta_features mechanism so that it reports about "related_features", rather than beta features. The beta status is reflected by a boolean, and the current value is reported.
== Pre-implementation notes ==
Discussed with abel
== Implementation details ==
Changed the JSON output to a dict so that it is more legible, and easier to add value and beta to. Consolidated all functionality into a single for-loop to simplify the code and avoid re-retrieving data.
Tweaked beta banner generation so that the banner is shown if any notifications were generated, rather than if there are any entries (because now there can be non-beta entries.)
== Tests ==
bin/test -t test_publisher -t test_view_name
== Demo and Q/A ==
Ensure dynamic bug listings are enabled for you. Go to a +bugs page. You should see the beta banner. View source. You should see that the value of 'bugs.dynamic_
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/canonical
lib/lp/
lib/canonical
lib/canonical
lib/lp/
lib/lp/
[1]
+ var chunks = ['<span class=" beta-feature" > ', info.title]; info-link" >', push('< /span>' ); push(Y. Node.create( chunks. join('' )));
+ if (info.url.length > 0) {
+ chunks.push(' (<a href="', info.url, '" class="
+ 'read more</a>)');
+ }
+ chunks.
+ notifications.
This is XSS territory. This must be done something like:
var node = Y.Node.create( beta-feature" ><a class=" info-link" ></a></ span>') ; one("a" ).set(" href", info.url);
'<span class="
node.set("text", info.title);
node.
Obviously that's not the whole story, but string concatenation is
going to get you in a lot of trouble.
... Review in progress ...