Merge lp:~jtv/launchpad/translationimportqueueentry-info into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Jeroen T. Vermeulen on 2010-02-11 | ||||
| Approved revision: | not available | ||||
| Merged at revision: | not available | ||||
| Proposed branch: | lp:~jtv/launchpad/translationimportqueueentry-info | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
586 lines (+459/-40) 7 files modified
lib/lp/translations/browser/configure.zcml (+1/-0) lib/lp/translations/browser/tests/test_translationimportqueueentry.py (+164/-0) lib/lp/translations/browser/translationimportqueue.py (+86/-4) lib/lp/translations/stories/importqueue/xx-entry-details.txt (+106/-0) lib/lp/translations/stories/importqueue/xx-entry-error-output.txt (+46/-0) lib/lp/translations/templates/translationimportqueueentry-index.pt (+13/-0) lib/lp/translations/templates/translationimportqueueentry-portlet-details.pt (+43/-36) |
||||
| To merge this branch: | bzr merge lp:~jtv/launchpad/translationimportqueueentry-info | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Curtis Hovey (community) | ui | 2010-02-09 | Approve on 2010-02-11 |
| Henning Eggers (community) | code | 2010-02-09 | Approve on 2010-02-10 |
|
Review via email:
|
|||
Commit Message
Show translation upload details on approval form.
| Jeroen T. Vermeulen (jtv) wrote : | # |
| Henning Eggers (henninge) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Jeroen,
thanks for working late and creating this branch. Great work!
Am 10.02.2010 00:36, Jeroen T. Vermeulen schrieb:
> = Bug 519556 =
>
> When reviewing translations uploads, we translations admins often want quick access to the following information on the approval page:
> * The uploader.
> * The file's contents.
> * The project: what's its license status, is it already using Translations?
> * The release series: does it have any templates yet, and which ones?
> * When was the entry last updated? The current UI fails to show this anywhere.
Wonderful! That is very helpful information!
>
> In addition, it may occasionally be convenient to have a copy of the entry's error_output shown. That makes this page a great place to go when analyzing failures.
Actually, as you know, I have a branch ready that displays the
error_output in a text field as part of the form, so this part might go
out again, soon. No offence meant. ;-)
>
> In this branch I add all of this information. It's at the bottom of the page, since I want it to be unobtrusive. It wouldn't do to force admins to scroll down before they get to the input fields. (Only translations admins and the Ubuntu translation coordinates can access this page).
Yes, I agree with that, although a two-column layout wouldn't have been
bad, either. The form would go on the left, the information on the
right. But I am not sure if that is easy to do and would fit with our UI
guidelines.
As I can see, you managed to pull this off without adding any view code.
Impressive. ;-) I am going to ask you, though, to move some things to
the view code to keep the TAL clearer. Hope you can go along with that.
review needs-fixing code
Cheers,
Henning
> === added file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -0,0 +1,121 @@
> += Entry details =
> +
> +The translation import queue entry page shows various details about an
> +entry and its target that may be helpful in queue review.
> +
> + >>> from zope.security.proxy import removeSecurityProxy
> + >>> from lp.translations
> + ... TranslationImpo
> +
> + >>> filename = 'po/foo.pot'
> +
> + >>> login(ANONYMOUS)
> + >>> queue = TranslationImpo
> + >>> product = factory.
> + >>> removeSecurityP
I wonder if removeSecurityProxy would be necessary here if you logged in
as foo.bar?
> + >>> trunk = product.
> + >>> uploader = factory.
> + >>> entry = queue.addOrUpda
> + ... filename, '# empty', False, uploader, productseries=
> + >>> entry_url = canonical_
> + >>> logout()
> +
> + >>> admin_browser.
> + >>> details = find_tag_
> + >>> details_text = extract_
> + ...
| Henning Eggers (henninge) wrote : | # |
For the UI review, here are two screenshots, one of an entry for a template file with error outpout, one for a normal translation file without error output. The review is just about the stuff that comes under the actions.
http://
http://
| Jeroen T. Vermeulen (jtv) wrote : | # |
Hi Henning, thank you for the surprise review! And a thorough job you did of it, too. Glad you like it, because this branch did contribute to a headache. :-)
> Actually, as you know, I have a branch ready that displays the
> error_output in a text field as part of the form, so this part might go
> out again, soon. No offence meant. ;-)
I considered that. But the error_output can be pages and pages of text in some cases. Viewing those in the queue UI isn't very convenient, and neither is scrolling through long and wide text in an input box. So I figured we might sometimes appreciate having it displayed more plainly. It's an extra, so I did put it at the bottom of the page.
> Yes, I agree with that, although a two-column layout wouldn't have been
> bad, either. The form would go on the left, the information on the
> right. But I am not sure if that is easy to do and would fit with our UI
> guidelines.
I'm not sure we can do that with generic forms. I did try it with the yui table layout, but had no luck.
In any case, this is nice and compact, no?
> As I can see, you managed to pull this off without adding any view code.
> Impressive. ;-) I am going to ask you, though, to move some things to
> the view code to keep the TAL clearer. Hope you can go along with that.
Quite right you are. TAL can be nice for prototyping though.
> > === added file 'lib/lp/
> details.txt'
> > --- lib/lp/
> 1970-01-01 00:00:00 +0000
> > +++ lib/lp/
> 2010-02-09 23:36:23 +0000
> > @@ -0,0 +1,121 @@
> > += Entry details =
> > +
> > +The translation import queue entry page shows various details about an
> > +entry and its target that may be helpful in queue review.
> > +
> > + >>> from zope.security.proxy import removeSecurityProxy
> > + >>> from lp.translations
> > + ... TranslationImpo
> > +
> > + >>> filename = 'po/foo.pot'
> > +
> > + >>> login(ANONYMOUS)
> > + >>> queue = TranslationImpo
> > + >>> product = factory.
> > + >>> removeSecurityP
>
> I wonder if removeSecurityProxy would be necessary here if you logged in
> as foo.bar?
Maybe not, but it's yet another dependency on the test data with implicit meaning ("logging in as this user because it's an admin"). Stripping the proxy was easy enough.
> > +In that case, the product is also shown to have translatable series.
> > +
> > + >>> print details_text
> > + Upload attached to
> > + ...
> > + Project has translatable series.
> > + ...
> > +
>
> Would it be too much to list these series here?
Almost, but I did it anyway. :-) It now lists up to three series (with linkified names), and if there's more, it adds an ellipsis.
> > +The string "1 template" neatly adjusts to the actual number of
> > +templates.
> > +
> > + >>> login(ANONYMOUS)
> > + >>> template = factory.
> > + >>> logout()
> > +
> > + >>> admin_browser.
> > + >>> detail...
| Henning Eggers (henninge) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Jeroen,
thanks for this improvement. I have a few little issues but please land
this when you are done with them.
review approve code
Cheers,
Henning
> === added file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -0,0 +1,165 @@
> +# Copyright 2010 Canonical Ltd. This software is licensed under the
> +# GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +"""Unit tests for translation import queue views."""
> +
> +from datetime import datetime
> +from pytz import timezone
> +from unittest import TestLoader
> +
> +from zope.component import getMultiAdapter
> +from zope.security.proxy import removeSecurityProxy
> +
> +from canonical.testing import LaunchpadFuncti
> +
> +from canonical.
> +from canonical.
> +from canonical.
> +from lp.registry.
> +from lp.testing import TestCaseWithFactory
> +from lp.translations
> + TranslationImpo
Don't you get an warnings about this? Should test code be importing from
model code? I thought I remember that rule (and it makes sense if we
profess to test against Interfaces).
> +
> +
> +class TestTranslation
> + """Tests for the queue entry review form."""
> +
> + layer = LaunchpadFuncti
> +
> + def setUp(self):
> + super(TestTrans
> + '<email address hidden>')
> + self.queue = TranslationImpo
I think this should really be:
self.queue = getUtility(
> + self.uploader = self.factory.
> +
> + def _makeProductSer
> + """Set up a product series for a translatable product."""
> + product = self.factory.
> + product.
> + return product.
> +
> + def _makeView(self, entry):
> + """Create view for a queue entry."""
> + request = LaunchpadTestRe
> + setFirstLayer(
> + view = getMultiAdapter
> + view.initialize()
> + return view
> +
> + def _makeEntry(self, productseries=None, distroseries=None,
> + sourcepackagena
> + filename = self.factory.
> + contents = self.factory.
> + entry = self.queue.
> + filename, contents, False, self.uploader,
> + productseries=
> + sourcepackagena
> + return removeSecurityP
> +
> + def test_import_
> + # If the ...
| Jeroen T. Vermeulen (jtv) wrote : | # |
> > === added file
> 'lib/lp/
> > --- lib/lp/
> 1970-01-01 00:00:00 +0000
> > +++ lib/lp/
> 2010-02-10 13:06:21 +0000
> > @@ -0,0 +1,165 @@
> > +# Copyright 2010 Canonical Ltd. This software is licensed under the
> > +# GNU Affero General Public License version 3 (see the file LICENSE).
> > +
> > +"""Unit tests for translation import queue views."""
> > +
> > +from datetime import datetime
> > +from pytz import timezone
> > +from unittest import TestLoader
> > +
> > +from zope.component import getMultiAdapter
> > +from zope.security.proxy import removeSecurityProxy
> > +
> > +from canonical.testing import LaunchpadFuncti
> > +
> > +from canonical.
> > +from canonical.
> > +from canonical.
> > +from lp.registry.
> > +from lp.testing import TestCaseWithFactory
> > +from lp.translations
> > + TranslationImpo
>
> Don't you get an warnings about this? Should test code be importing from
> model code? I thought I remember that rule (and it makes sense if we
> profess to test against Interfaces).
No warnings, but now that you mention it, I'm not sure this is allowed.
Changed.
> > +class TestTranslation
> > + """Tests for the queue entry review form."""
> > +
> > + layer = LaunchpadFuncti
> > +
> > + def setUp(self):
> > + super(TestTrans
> > + '<email address hidden>')
> > + self.queue = TranslationImpo
>
> I think this should really be:
> self.queue = getUtility(
Done.
> > + def test_import_
> > + # If the entry has a DistroSeries and a SourcePackageName, the
> > + # import_target is the corresponding SourcePackage.
> > + series = self.factory.
> > + packagename = self.factory.
> > + package = SourcePackage(
>
> package = self.factory.
>
> Works just as well ... ;-)
Oh, nice! Saves me an import.
> > + # No translatable series.
> > + series_text = view.product_
> > + self.assertEqua
> series_text)
> > +
> > + # One translatable series.
> > + extra_series = self.factory.
> > + self.factory.
> > + series_text = view.product_
> > + self.assertIn(
> > + # A link follows, and the sentence ends in a period.
> > + self.assertEqua
>
> I am not all too happy about this testing style and wonder if doing this
...
| Jeroen T. Vermeulen (jtv) wrote : | # |
UI reviewer: the "translatable series" text now links to the individual series. Updated screenshots at http://
| Curtis Hovey (sinzui) wrote : | # |
This is fine to land. This is not the first form to but seondary, and possibly distracting information below the form. I had a minor concern that the use of un restrained left and right columns produces a large gutter of white-space between them. I do not see this since I keep my browser narrow, and U do not think you rosetta admins care.
We did discussed two webkit issues that are other bugs: the odd white space between form and buttons and the fact that this page is unreachable in webkit because the edit icons do not render (the fix is already in progress).
| Curtis Hovey (sinzui) wrote : | # |
The broken icon is because there is space between the anchor and the span in translation-

= Bug 519556 =
When reviewing translations uploads, we translations admins often want quick access to the following information on the approval page:
* The uploader.
* The file's contents.
* The project: what's its license status, is it already using Translations?
* The release series: does it have any templates yet, and which ones?
* When was the entry last updated? The current UI fails to show this anywhere.
In addition, it may occasionally be convenient to have a copy of the entry's error_output shown. That makes this page a great place to go when analyzing failures.
In this branch I add all of this information. It's at the bottom of the page, since I want it to be unobtrusive. It wouldn't do to force admins to scroll down before they get to the input fields. (Only translations admins and the Ubuntu translation coordinates can access this page).
For Q/A, I intend to visit a whole bunch of pages for translation import queue entries and see that they all make sense.
To test: xx-entry
{{{
./bin/test -vv -t importqueue/
}}}
No lint.
Jeroen