Problem/Motivation

Now that we have #2679361: Add way to view unpublished or protected source content in source content, we can let translators access to see the original content they are going to translate.
Let's show this link in LocalTaskItemForm.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

edurenye created an issue. See original summary.

edurenye’s picture

Status: Active » Needs review
StatusFileSize
new60.13 KB
new4.08 KB

Done, also added the rest of info elements.

berdir’s picture

Wondering about the preview URL. It doesn't really make sense, but we might want to use the new preliminary stuff here as well to be able to preview the translation? It could be a button on the form that saves and then displays the preview link?

miro_dietiker’s picture

Status: Needs review » Needs work

Yeah the header was completely missing.
And the link to the source should show the untranslated source.

I also thought this issue was about offering the new preview functionality. But it seems only to be about original source content.
I think we should create a separate issue about the preview.

Anyway back to work for missing test coverage. ;-)

edurenye’s picture

Status: Needs work » Needs review
StatusFileSize
new1000 bytes
new5.06 KB

Added tests and created the other issue #2682337: Add the preview feature to translator local.

The last submitted patch, 5: let_translators_view-2680119-5-test_only.patch, failed testing.

berdir’s picture

Just to make sure that everything works together, can we also make sure that it allows us to see unpublished sources in the test?

Do we have any tests that are testing with content entity as a source? I guess not...

edurenye’s picture

The test added to ContentEntitySourceUiTest in this issue #2679361: Add way to view unpublished or protected source content is testing it.

berdir’s picture

I know, but that just tests the API, really. We have no test that a local translator can access an unpublished node, we don't even have a test that he can see the link to any kind of node right now.

edurenye’s picture

So, should I modify test_source to support preview or use tmgmt_content?

miro_dietiker’s picture

I guess we should explicitly test this combined with an entity source test such as ContentEntitySourceUiTest?

sanja_m’s picture

Assigned: Unassigned » sanja_m

Assigning to me.

mbovan’s picture

Status: Needs review » Needs work
sanja_m’s picture

Status: Needs work » Needs review
StatusFileSize
new10.67 KB
new5.61 KB

Added some tests, still working on it, not sure what could be the problem, because there are some failing tests locally but not here.

berdir’s picture

#2682337: Add the preview feature to translator local and this issue are going to add very similar tests. I would suggest we postpone one on the other.

berdir’s picture

Status: Needs review » Needs work
+++ b/translators/tmgmt_local/src/Form/LocalTaskItemForm.php
@@ -40,7 +41,60 @@ class LocalTaskItemForm extends ContentEntityForm {
+      '#type' => 'container',
+      '#attributes' => array('class' => array('tmgmt-ui-localTask-info', 'clearfix')),
+      '#weight' => 0,

mixing camel case and - is strange, use local-task.

I'd also leave out the ui in those classes. You can't have non-ui css classes, so it is useless information (I guess you copied it from tmgmt, where it is a left-over of having a tmgmt_ui module in 7.x).

So, just tmgmt-local-task-info.

The classes below are re-used, so I guess we can keep them for now.

berdir’s picture

#2682337: Add the preview feature to translator local is in now, please add your tests to the new test added there.

sanja_m’s picture

Status: Needs work » Needs review
StatusFileSize
new7.61 KB
new8.71 KB

Updated patch.

berdir’s picture

Status: Needs review » Needs work
+++ b/translators/tmgmt_local/src/Tests/LocalTranslatorPreviewTest.php
@@ -24,9 +24,14 @@ class LocalTranslatorPreviewTest extends LocalTranslatorTestBase {
    */
   public function testPreview() {
+    $user_permissions = $this->localManagerPermissions;
+    $user_permissions[] = 'view own unpublished content';
+    $this->loginAsAdmin($user_permissions);

why do you need this permission? the code below just uses the API, you shouldn't even have to log in for it.

Looks good otherwise.

sanja_m’s picture

Status: Needs work » Needs review
StatusFileSize
new6.9 KB
new1.24 KB

Fixed bug from #19.

  • Berdir committed 55ab3db on 8.x-1.x authored by sanja_m
    Issue #2680119 by sanja_m, edurenye: Let translators view unpublished or...
berdir’s picture

Status: Needs review » Fixed

Nice, committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.