Merge lp:~abentley/launchpad/sharing-language-bugs into lp:launchpad

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 12852
Proposed branch: lp:~abentley/launchpad/sharing-language-bugs
Merge into: lp:launchpad
Diff against target: 91 lines (+22/-5)
4 files modified
lib/lp/translations/browser/sourcepackage.py (+1/-1)
lib/lp/translations/browser/tests/test_sharing_details.py (+5/-0)
lib/lp/translations/javascript/sourcepackage_sharing_details.js (+3/-3)
lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js (+13/-1)
To merge this branch: bzr merge lp:~abentley/launchpad/sharing-language-bugs
Reviewer Review Type Date Requested Status
j.c.sackett (community) Approve
Review via email: mp+57715@code.launchpad.net

Commit message

Fix various text issues on +sharing-details.

Description of the change

= Summary =
Fix bugs:
#758845: AJAX overlay says "Select productseries" in the translation sharing details Remove
#758852: Unhelpful title for "enable translations on an upstream project" dialog Remove
#758857: Linked branch in translations sharing details page shows branch URL without lp:// prefix Remove

== Proposed fix ==
Change AJAX overlay to "Select project series". Change title of "usage" dialog to "Configure translations", the same as the title of the page it comes from. Add lp: prefix to branch names.

== Pre-implementation notes ==
Discussed 758857 with jml

== Implementation details ==
None

== Tests ==
bin/test -t test_branch_link_text sharing_details
firefox lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.html

== Demo and Q/A ==
Go to the +sharing-details and verify the text is as expected.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js
  lib/lp/translations/browser/tests/test_sharing_details.py
  lib/lp/translations/javascript/sourcepackage_sharing_details.js
  lib/lp/translations/browser/sourcepackage.py

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

This is quite straightforward, and looks good to land.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/translations/browser/sourcepackage.py'
--- lib/lp/translations/browser/sourcepackage.py 2011-04-11 17:16:28 +0000
+++ lib/lp/translations/browser/sourcepackage.py 2011-04-14 15:52:31 +0000
@@ -151,7 +151,7 @@
151 if self.has_upstream_branch:151 if self.has_upstream_branch:
152 # Normally should use BranchFormatterAPI(branch).link(None), but152 # Normally should use BranchFormatterAPI(branch).link(None), but
153 # on this page, that information is redundant.153 # on this page, that information is redundant.
154 title = self.upstream_branch.unique_name154 title = 'lp:' + self.upstream_branch.unique_name
155 url = canonical_url(self.upstream_branch)155 url = canonical_url(self.upstream_branch)
156 else:156 else:
157 title = ''157 title = ''
158158
=== modified file 'lib/lp/translations/browser/tests/test_sharing_details.py'
--- lib/lp/translations/browser/tests/test_sharing_details.py 2011-04-11 21:52:14 +0000
+++ lib/lp/translations/browser/tests/test_sharing_details.py 2011-04-14 15:52:31 +0000
@@ -164,6 +164,11 @@
164 self.configureSharing(set_upstream_branch=True)164 self.configureSharing(set_upstream_branch=True)
165 self.assertTrue(self.view.has_upstream_branch)165 self.assertTrue(self.view.has_upstream_branch)
166166
167 def test_branch_link_text(self):
168 self.configureSharing(set_upstream_branch=True)
169 expected_text = '>lp:%s</a>' % self.view.upstream_branch.unique_name
170 self.assertIn(expected_text, self.view.branch_link.escapedtext)
171
167 def test_is_upstream_translations_enabled__no_packaging_link(self):172 def test_is_upstream_translations_enabled__no_packaging_link(self):
168 # If the source package is not linked to an upstream series,173 # If the source package is not linked to an upstream series,
169 # is_upstream_translations_enabled returns False.174 # is_upstream_translations_enabled returns False.
170175
=== modified file 'lib/lp/translations/javascript/sourcepackage_sharing_details.js'
--- lib/lp/translations/javascript/sourcepackage_sharing_details.js 2011-04-07 15:44:38 +0000
+++ lib/lp/translations/javascript/sourcepackage_sharing_details.js 2011-04-14 15:52:31 +0000
@@ -321,7 +321,7 @@
321 var check = this.get('tsconfig').get('branch');321 var check = this.get('tsconfig').get('branch');
322 if (Y.Lang.isValue(branch)){322 if (Y.Lang.isValue(branch)){
323 check.set_link(323 check.set_link(
324 branch.get('unique_name'), branch.get('web_link'));324 'lp:' + branch.get('unique_name'), branch.get('web_link'));
325 }325 }
326 else {326 else {
327 check.clear_link();327 check.clear_link();
@@ -490,7 +490,7 @@
490 add_activator(picker, '#branch-complete-picker a');490 add_activator(picker, '#branch-complete-picker a');
491 var productseries_picker_config = {491 var productseries_picker_config = {
492 picker_activator: '#packaging-complete-picker a',492 picker_activator: '#packaging-complete-picker a',
493 header : 'Select productseries',493 header : 'Select project series',
494 step_title: 'Search',494 step_title: 'Search',
495 save: Y.bind('select_productseries', sharing_controller),495 save: Y.bind('select_productseries', sharing_controller),
496 context: cache.product496 context: cache.product
@@ -534,7 +534,7 @@
534 var autoimport = sharing_controller.get('tsconfig').get('autoimport');534 var autoimport = sharing_controller.get('tsconfig').get('autoimport');
535 sharing_controller.set_check_picker(autoimport, import_overlay);535 sharing_controller.set_check_picker(autoimport, import_overlay);
536 var usage_overlay = new Y.lazr.FormOverlay({536 var usage_overlay = new Y.lazr.FormOverlay({
537 headerContent: '<h2>Usage settings<h2>',537 headerContent: '<h2>Configure translations<h2>',
538 centered: true,538 centered: true,
539 visible: false539 visible: false
540 });540 });
541541
=== modified file 'lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js'
--- lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js 2011-04-07 15:39:20 +0000
+++ lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js 2011-04-14 15:52:31 +0000
@@ -37,6 +37,18 @@
37 product_series.set_link('ps', 'http://');37 product_series.set_link('ps', 'http://');
38 Y.Assert.isTrue(sharing_config.get('branch').get('enabled'));38 Y.Assert.isTrue(sharing_config.get('branch').get('enabled'));
39 },39 },
40 test_set_branch: function() {
41 var lp_client = new Y.lp.client.Launchpad();
42 var branch = lp_client.wrap_resource('http://example.com', {
43 unique_name: 'unique',
44 web_link: 'http://example.com',
45 resource_type_link: 'http://foo_type'
46 });
47 var sharing_controller = new TranslationSharingController();
48 sharing_controller.set_branch(branch);
49 var check = sharing_controller.get('tsconfig').get('branch');
50 Y.Assert.areEqual('lp:unique', check.get('text'));
51 },
40 test_autoimport: function() {52 test_autoimport: function() {
41 var sharing_config = new TranslationSharingConfig();53 var sharing_config = new TranslationSharingConfig();
42 Y.Assert.isFalse(sharing_config.get('autoimport').get('enabled'));54 Y.Assert.isFalse(sharing_config.get('autoimport').get('enabled'));
@@ -125,7 +137,7 @@
125 Y.Assert.areEqual(137 Y.Assert.areEqual(
126 tsconfig.get('product_series').get('url'), 'http://web1');138 tsconfig.get('product_series').get('url'), 'http://web1');
127 Y.Assert.areEqual(139 Y.Assert.areEqual(
128 tsconfig.get('branch').get('text'), 'title2');140 tsconfig.get('branch').get('text'), 'lp:title2');
129 Y.Assert.isTrue(tsconfig.get('autoimport').get('complete'));141 Y.Assert.isTrue(tsconfig.get('autoimport').get('complete'));
130 Y.Assert.isTrue(142 Y.Assert.isTrue(
131 tsconfig.get('translations_usage').get('complete'));143 tsconfig.get('translations_usage').get('complete'));