Merge lp:~adiroiban/launchpad/bug-402235 into lp:launchpad
Status: | Merged |
---|---|
Merged at revision: | 10871 |
Proposed branch: | lp:~adiroiban/launchpad/bug-402235 |
Merge into: | lp:launchpad |
Diff against target: |
381 lines (+239/-18) 3 files modified
lib/canonical/launchpad/javascript/translations/pofile.js (+88/-15) lib/lp/translations/templates/currenttranslationmessage-translate-one.pt (+2/-1) lib/lp/translations/windmill/tests/test_pofile_translate.py (+149/-2) |
To merge this branch: | bzr merge lp:~adiroiban/launchpad/bug-402235 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+23973@code.launchpad.net |
Commit message
Make diverge and force suggestion checkboxes mutually exclusive.
Description of the change
= Bug 402235 =
In the view for a TranslationMessage ("zoomed-in"), both options "Make this translation specific to" and "Someone should review this translation" can be selected although they are mutually exclusive. Doing so currently does no harm but simply ignores the diverged option in favour of the suggestion option.
== Proposed fix ==
Make "Make this translation specific to" and "Someone should review this translation" mutually exclusive ... checking one will disable the other. Un-checking will enable the other.
There is an exception: when all translations are marked for dismissal, un-checking the diverge checkbox will keep the "force suggestion" checkbox disabled.
== Pre-implementation notes ==
None yet.
== Implementation details ==
I have also fixed a small bug in the setupSuggestion
The progressive Javascript initialization was refactored in the fix for bug 201749, but Henning was a bit busy and that branch was not landed yet.
Prior of landing this branch it would be nice to land the other one and then merge the changes.
https:/
== Tests ==
lp-tt test_pofile_
== Demo and Q/A ==
Login as admin.
Unfortunately the default database does not contains any translation messages that can be diverged so you will have to create one.
Go to this translation page and add a translation.
Come back and this time add a suggestion (tick "Someone should review this translation").
No come back one again :)
You should see three check boxes:
"Confirm this translation and dismiss all suggestions." (aka dismiss)
"Make this translation specific to evolution tralala..." (aka diverge)
"Someone should review this translation." (aka force_suggestion)
Click the diverge and dismiss checkboxes and when one is selected the other should be disabled.
Click the dismiss checkbox. Diverge should be still active while all other are disabled.
Checking and un-checking the diverge will not enable force_suggestion.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files:
lib/canonical
== JSLint notices ==
jslint: Lint found in '/home/
Line 316 character 18: Be careful when making functions within a loop. Consider putting the function in a closure.
},
Line 323 character 18: Be careful when making functions within a loop. Consider putting the function in a closure.
}, '#' + fields[key], 'down:68+
Line 329 character 18: Be careful when making functions within a loop. Consider putting the function in a closure.
}, '#' + fields[key], 'down:48+
Line 384 character 14: Be careful when making functions within a loop. Consider putting the function in a closure.
},
Line 403 character 14: Be careful when making functions within a loop. Consider putting the function in a closure.
},
jslint: 1 file to lint.
Hi Adi,
nice work! I have just a few formal nitpicks, see below.
> === modified file 'lib/lp/ translations/ windmill/ tests/test_ pofile_ translate. py' translations/ windmill/ tests/test_ pofile_ translate. py 2010-04-11 20:07:25 +0000 translations/ windmill/ tests/test_ pofile_ translate. py 2010-04-23 01:14:24 +0000 launchpad. windmill. testing import constants, lpuser .windmill. testing import TranslationsWin dmillLayer ationFieldKeybi ndings( WindmillTestCas e): 0_new_select' ) translation_ autoselect( _select_ id) onActions( WindmillTestCas e): dmillLayer uncheck_ force_suggestio n(self) :
> --- lib/lp/
> +++ lib/lp/
> @@ -6,9 +6,11 @@
> __metaclass__ = type
> __all__ = []
>
> +import transaction
> +
> from canonical.
> from lp.translations
> -from lp.testing import WindmillTestCase
> +from lp.testing import login, logout, WindmillTestCase
>
>
> class POFileNewTransl
> @@ -81,3 +83,147 @@
> '_translation_
> self._check_
> start_url, new_translation_id, new_translation
> +
> +
> +class POFileTranslati
> + """Tests for actions that can be done on a translation message."""
> +
> + layer = TranslationsWin
> + suite_name = 'POFile Translation Actions'
> +
> + def test_dismiss_
> + """Test the unchecking of force suggestion on dismissal.
> +
> + Checking the dismiss all suggestions checkbox will uncheck a
> + previously checkbox that force submitting the current translation as a
s/previously checkbox/previously ticked checkbox/
s/force/forces/
> + suggestion. TRANSLATIONS_ ADMIN translations. launchpad. dev:8085/ ' trunk/+ pots/evolution- 2.2/es/ 5/+translate' ) 5_force_ suggestion' open(url= url) waits.forPageLo ad(timeout= constants. PAGE_LOAD) user.ensure_ login(self. client) waits.forElemen t( constants. FOR_ELEMENT) waits.forElemen t( suggestion_ id, timeout= constants. FOR_ELEMENT)
> + """
> +
> + self.test_user = lpuser.
> + # Test the zoom out view for Evolution trunk Spanish (es).
> + url = ('http://
> + 'evolution/
> + dismiss_id = u'msgset_5_dismiss'
> + force_suggestion_id = u'msgset_
> +
> + # Go to the translation page.
> + self.client.
> + self.client.
> + self.test_
> + self.client.
> + id=dismiss_id, timeout=
> + self.client.
> + id=force_
> +
> + # Check that initialy the checkboxes are not selected.
s/initialy/ initially/
> + self.client. asserts. assertNotChecke d(id=dismiss_ id) asserts. assertNotChecke d(id=force_ suggestion_ id) click(id= force_suggestio n_id) asserts. assertChecked( id=force_ suggestion_ id) click(id= dismiss_ id) asserts. assertChecked( id=dismiss_ id) asserts. assertNotChecke d(id=force_ suggestion_ id) and_force_ suggestion_ mutual_ exclusion( self):
> + self.client.
> +
> + # Click the force suggestion checkbox and verify that it is checked.
> + self.client.
> + self.client.
> +
> + self.client.
> + self.client.
> + self.client.
> +
> + def test_diverge_
> + """Test the mutual exclusion of diverge and force suggestion.
> +
> + Diverge current translation and force suggestion checkbox ...