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
1=== modified file 'lib/lp/translations/browser/sourcepackage.py'
2--- lib/lp/translations/browser/sourcepackage.py 2011-04-11 17:16:28 +0000
3+++ lib/lp/translations/browser/sourcepackage.py 2011-04-14 15:52:31 +0000
4@@ -151,7 +151,7 @@
5 if self.has_upstream_branch:
6 # Normally should use BranchFormatterAPI(branch).link(None), but
7 # on this page, that information is redundant.
8- title = self.upstream_branch.unique_name
9+ title = 'lp:' + self.upstream_branch.unique_name
10 url = canonical_url(self.upstream_branch)
11 else:
12 title = ''
13
14=== modified file 'lib/lp/translations/browser/tests/test_sharing_details.py'
15--- lib/lp/translations/browser/tests/test_sharing_details.py 2011-04-11 21:52:14 +0000
16+++ lib/lp/translations/browser/tests/test_sharing_details.py 2011-04-14 15:52:31 +0000
17@@ -164,6 +164,11 @@
18 self.configureSharing(set_upstream_branch=True)
19 self.assertTrue(self.view.has_upstream_branch)
20
21+ def test_branch_link_text(self):
22+ self.configureSharing(set_upstream_branch=True)
23+ expected_text = '>lp:%s</a>' % self.view.upstream_branch.unique_name
24+ self.assertIn(expected_text, self.view.branch_link.escapedtext)
25+
26 def test_is_upstream_translations_enabled__no_packaging_link(self):
27 # If the source package is not linked to an upstream series,
28 # is_upstream_translations_enabled returns False.
29
30=== modified file 'lib/lp/translations/javascript/sourcepackage_sharing_details.js'
31--- lib/lp/translations/javascript/sourcepackage_sharing_details.js 2011-04-07 15:44:38 +0000
32+++ lib/lp/translations/javascript/sourcepackage_sharing_details.js 2011-04-14 15:52:31 +0000
33@@ -321,7 +321,7 @@
34 var check = this.get('tsconfig').get('branch');
35 if (Y.Lang.isValue(branch)){
36 check.set_link(
37- branch.get('unique_name'), branch.get('web_link'));
38+ 'lp:' + branch.get('unique_name'), branch.get('web_link'));
39 }
40 else {
41 check.clear_link();
42@@ -490,7 +490,7 @@
43 add_activator(picker, '#branch-complete-picker a');
44 var productseries_picker_config = {
45 picker_activator: '#packaging-complete-picker a',
46- header : 'Select productseries',
47+ header : 'Select project series',
48 step_title: 'Search',
49 save: Y.bind('select_productseries', sharing_controller),
50 context: cache.product
51@@ -534,7 +534,7 @@
52 var autoimport = sharing_controller.get('tsconfig').get('autoimport');
53 sharing_controller.set_check_picker(autoimport, import_overlay);
54 var usage_overlay = new Y.lazr.FormOverlay({
55- headerContent: '<h2>Usage settings<h2>',
56+ headerContent: '<h2>Configure translations<h2>',
57 centered: true,
58 visible: false
59 });
60
61=== modified file 'lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js'
62--- lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js 2011-04-07 15:39:20 +0000
63+++ lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js 2011-04-14 15:52:31 +0000
64@@ -37,6 +37,18 @@
65 product_series.set_link('ps', 'http://');
66 Y.Assert.isTrue(sharing_config.get('branch').get('enabled'));
67 },
68+ test_set_branch: function() {
69+ var lp_client = new Y.lp.client.Launchpad();
70+ var branch = lp_client.wrap_resource('http://example.com', {
71+ unique_name: 'unique',
72+ web_link: 'http://example.com',
73+ resource_type_link: 'http://foo_type'
74+ });
75+ var sharing_controller = new TranslationSharingController();
76+ sharing_controller.set_branch(branch);
77+ var check = sharing_controller.get('tsconfig').get('branch');
78+ Y.Assert.areEqual('lp:unique', check.get('text'));
79+ },
80 test_autoimport: function() {
81 var sharing_config = new TranslationSharingConfig();
82 Y.Assert.isFalse(sharing_config.get('autoimport').get('enabled'));
83@@ -125,7 +137,7 @@
84 Y.Assert.areEqual(
85 tsconfig.get('product_series').get('url'), 'http://web1');
86 Y.Assert.areEqual(
87- tsconfig.get('branch').get('text'), 'title2');
88+ tsconfig.get('branch').get('text'), 'lp:title2');
89 Y.Assert.isTrue(tsconfig.get('autoimport').get('complete'));
90 Y.Assert.isTrue(
91 tsconfig.get('translations_usage').get('complete'));