Merge lp:~wallyworld/launchpad/css-fix-empty-sharing-table into lp:launchpad

Proposed by Ian Booth on 2012-09-06
Status: Merged
Merged at revision: 15913
Proposed branch: lp:~wallyworld/launchpad/css-fix-empty-sharing-table
Merge into: lp:launchpad
Diff against target: 86 lines (+15/-10)
3 files modified
lib/lp/app/javascript/choiceedit/choiceedit.js (+3/-1)
lib/lp/registry/javascript/sharing/granteetable.js (+10/-7)
lib/lp/registry/javascript/sharing/tests/test_granteetable.js (+2/-2)
To merge this branch: bzr merge lp:~wallyworld/launchpad/css-fix-empty-sharing-table
Reviewer Review Type Date Requested Status
William Grant code 2012-09-06 Approve on 2012-09-06
Review via email: mp+122983@code.launchpad.net

Commit Message

Fix some css issues on the sharing page and in the choice source popups

Description of the Change

2 issues:

1. The sharing page displays some text if there are no grantees. The text contains the pillar name. This was unescaped.
2. The choice source popup displayed unescaped text in the header. For sharing, this text contains the grantee name.

The above have been fixed.

To post a comment you must log in.
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/javascript/choiceedit/choiceedit.js'
2--- lib/lp/app/javascript/choiceedit/choiceedit.js 2012-08-23 18:58:50 +0000
3+++ lib/lp/app/javascript/choiceedit/choiceedit.js 2012-09-06 05:02:19 +0000
4@@ -467,7 +467,9 @@
5 node: this.get("value_location"),
6 points:[Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.TL]
7 });
8- this.set("headerContent", "<h2>" + this.get("title") + "</h2>");
9+ this.set(
10+ 'headerContent',
11+ Y.Node.create("<h2></h2>").set('text', this.get("title")));
12 this.set("display_items_list", Y.Node.create("<ul>"));
13 var display_items_list = this.get("display_items_list");
14 var items = this.get("items");
15
16=== modified file 'lib/lp/registry/javascript/sharing/granteetable.js'
17--- lib/lp/registry/javascript/sharing/granteetable.js 2012-09-05 06:48:36 +0000
18+++ lib/lp/registry/javascript/sharing/granteetable.js 2012-09-06 05:02:19 +0000
19@@ -69,6 +69,10 @@
20 grantee_row_template: {
21 value: null
22 },
23+ // The node to display if there are no grantees.
24+ grantee_table_empty_row: {
25+ value: null
26+ },
27 // The handlebars template for the each access policy item.
28 grantee_policy_template: {
29 value: null
30@@ -201,11 +205,11 @@
31 var row_template = [
32 '<tr id="grantee-table-not-shared">',
33 '<td colspan="5" style="padding-left: 0.25em">',
34- '{pillar_name}\'s private information is not shared with ',
35- 'anyone.',
36+ '<span></span> private information is not shared with anyone.',
37 '</td></tr>'].join('');
38- return Y.Lang.sub(
39- row_template, {pillar_name: this.get('pillar_name')});
40+ var row = Y.Node.create(row_template);
41+ row.one('td span').set('text', this.get('pillar_name') + "'s");
42+ return row;
43 },
44
45 _grantee_policy_template: function() {
46@@ -310,7 +314,7 @@
47 var table_node = Y.Node.create(html);
48 if (grantees.length === 0) {
49 table_node.one('tbody').appendChild(
50- Y.Node.create(this.get('grantee_table_empty_row')));
51+ this.get('grantee_table_empty_row'));
52 }
53 grantee_table.replace(table_node);
54 this.render_sharing_info(grantees);
55@@ -522,8 +526,7 @@
56 var delete_rows = function() {
57 rows_to_delete.remove(true);
58 if (all_rows_deleted === true) {
59- var empty_table_row = Y.Node.create(
60- that.get('grantee_table_empty_row'));
61+ var empty_table_row = that.get('grantee_table_empty_row');
62 grantee_table.one('tbody')
63 .appendChild(empty_table_row);
64 }
65
66=== modified file 'lib/lp/registry/javascript/sharing/tests/test_granteetable.js'
67--- lib/lp/registry/javascript/sharing/tests/test_granteetable.js 2012-09-05 06:48:36 +0000
68+++ lib/lp/registry/javascript/sharing/tests/test_granteetable.js 2012-09-06 05:02:19 +0000
69@@ -106,7 +106,7 @@
70 Y.Assert.areEqual(
71 "My Project's private information is not shared " +
72 "with anyone.",
73- Y.one('#grantee-table tr td').getContent());
74+ Y.one('#grantee-table tr td').get('text'));
75 },
76
77 // When the first grantee is added, the "No grantees" row is removed.
78@@ -359,7 +359,7 @@
79 "My Project's private information is not shared " +
80 "with anyone.",
81 Y.one('#grantee-table tr#grantee-table-not-shared td')
82- .getContent());
83+ .get('text'));
84 },
85
86 // A batch update is correctly rendered.