Note: I'm opening this issue to discuss this. I'm not sure yet about this, but now that we have the job items overview, this is starting to make more and more sense and it would allow for some UX improvements that would like to see.

Right now, we have two different views, both filter on the type explicitly. That was a lot easier to get started and initially, we didn't have the job items view, so the jobs view was still the main interaction point and i didn't want to "pollute" that.

Things to think about/would have to be implemented...

* Exposed filter for job type, show job type. Maybe a special state icon for them instead (loop, infinity, ...?). Legend would have to show it then.
* local action would move to jobs overview
* Status and others might need special cases for continuous, open should show them, what about active/unprocessed? Maybe we could expose the continuous type filter as part of state, would be consistent with showing it as state. We would definitely need a custom filter plugin then, as we'd dynamically filter on different fields.
* I'd like to have access control for all those things (filter, type, legend, local task) based on the existence of a translation provider (plugin) that supports continuous. When there are none, don't show any of that. Would avoid a lot of confusion for many users that couldn't use it anyway.
* We need to make sure to not show progress/words/tags for them (import: also not preload/calculate it), as there might be a huge amount of job items. Although progress could be argued about, maybe only show status of active ob items. not sure about performance.
* Should we make job items the first local task/menu link to indicate that is the main day-to-day overview (for reviewers)?

CommentFileSizeAuthor
#41 merge_normal_and-2678332-41.patch34.62 KBthenchev
#41 merge_normal_and-2678332-40-41-interdiff.txt4.02 KBthenchev
#40 merge_normal_and-2678332-40.patch31.68 KBthenchev
#40 merge_normal_and-2678332-38-40-interdiff.txt3.93 KBthenchev
#38 merge_normal_and-2678332-38.patch31.8 KBthenchev
#38 merge_normal_and-2678332-29-38-interdiff.txt22.58 KBthenchev
#37 merge_normal_and-2678332-37-interdiff.txt1.58 KBmbovan
#37 merge_normal_and-2678332-37.patch44.93 KBmbovan
#35 conti_update.png34.27 KBmbovan
#35 merge_normal_and-2678332-35-interdiff.txt1.63 KBmbovan
#35 merge_normal_and-2678332-35.patch45.68 KBmbovan
#29 merge_normal_and-2678332-29.patch44.05 KBthenchev
#29 interdiff-2678332-27-29.txt1.06 KBthenchev
#27 merge_normal_and-2678332-27.patch43.39 KBthenchev
#27 interdiff-2678332-25-27.txt844 bytesthenchev
#25 merge_normal_and-2678332-25.patch29.12 KBthenchev
#25 interdiff-2678332-23-25.txt3.03 KBthenchev
#23 merge_normal_and-2678332-23.patch26.56 KBthenchev
#23 interdiff-2678332-20-23.txt44.82 KBthenchev
#20 merge_normal_and-2678332-20.patch30.38 KBthenchev
#20 interdiff-2678332-18-20.txt637 bytesthenchev
#18 merge_normal_and-2678332-18.patch30.37 KBthenchev
#18 interdiff-2678332-15-18.txt1.74 KBthenchev
#17 loop-gray.txt502 bytesjohnchque
#15 interdiff-2678332-12-15.txt2.08 KBthenchev
#15 Job overview D8.png94.85 KBthenchev
#15 merge_normal_and-2678332-15.patch30.33 KBthenchev
#14 Screenshot from 2016-03-04 15:32:49.png7.46 KBjohnchque
#14 loop1.txt502 bytesjohnchque
#12 merge_normal_and-2678332-12.patch29.82 KBthenchev
#12 Job overview D8.png99.01 KBthenchev
#12 interdiff-2678332-8-12.txt4.58 KBthenchev
#8 Job overview D8.png81.17 KBthenchev
#8 merge_normal_and-2678332-8.patch29.14 KBthenchev
#6 Job overview D8.png100.78 KBthenchev
#4 Screen Shot 2016-03-03 at 01.51.57 .png17.81 KBmiro_dietiker
#3 Screen Shot 2016-03-03 at 01.28.01 .png21.2 KBmiro_dietiker

Comments

Berdir created an issue. See original summary.

berdir’s picture

See screenshots in #2676118: Improving continuous job form., if we do not hide the add form, we need a better UI.

miro_dietiker’s picture

Issue summary: View changes
StatusFileSize
new21.2 KB

Much wanted. The current overview at admin/tmgmt is overlong and as a user i'm loosing overview in the current items listed.

Still not sure about the exact naming that will result on admin/tmgmt when the two are merged.

Is it then "Jobs" and will show items - or "Job items" and offer an alternate job tab? ;-)
We could also say "Jobs + Items" but that might be a bit creative.

Yeah, i think the job items should be the main action point and jobs are more hidden.

miro_dietiker’s picture

StatusFileSize
new17.81 KB

Also providing the tabs from before.

Would be great to have an exact resulting structure outlined as list or visually proposed.

berdir’s picture

Huh? This is about merging the two *job* overviews. And moving job items before/above jobs. Then there is no label question, it's simply "Jobs", like now?

I don't know how you want to merge Jobs into job items or have it hidden behind that? I'm just talking about switching the order around.

thenchev’s picture

Assigned: Unassigned » thenchev
StatusFileSize
new100.78 KB

Are we going for something in this direction?

miro_dietiker’s picture

Ha! No idea where i was with my thoughts.

Yeah let's merge the job overviews first and then discuss how to continue.

thenchev’s picture

Status: Active » Needs review
StatusFileSize
new29.14 KB
new81.17 KB

Exposed filter for job type, show job type. Maybe a special state icon for them instead...

For now showing job type as text. Do we want an icon here or maybe in the states we can add an ring around it to indicate its a continuous job so we can loose the job type, just a thought. Painted one around a state so we can see how it looks.

local action would move to jobs overview

Moved.

We need to make sure to not show progress/words/tags for them

Removed all for now for continuous.

Should we make job items the first local task/menu link to indicate that is the main day-to-day overview (for reviewers)?

Done.

Work in progress. Continuing with the 2 more steps and fixing tests.

Status: Needs review » Needs work

The last submitted patch, 8: merge_normal_and-2678332-8.patch, failed testing.

johnchque’s picture

The idea of adding a circle around the icon looks good, maybe we can use the same color of the icon to make it fit better. would be an option to avoid adding an extra column. :D

berdir’s picture

+++ b/src/Plugin/views/field/Progress.php
@@ -21,6 +21,10 @@ class Progress extends StatisticsBase {
   public function render(ResultRow $values) {
     $entity = $values->_entity;
+    // If job is continuous we don't show anything.
+    if ($entity->isContinuous()) {
+      return;
+    }

we also have to change the parent class to avoid that the data for this is loaded.

About the icon. All other states have no meaning for continuous. So I think a completely separate icon would be better.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new4.58 KB
new99.01 KB
new29.82 KB

Modified parent class.
Added an image for continuous. This is just an png, I have to configure gimp and online converters are horrible for svg. If someone wants to work on the svg that would be great :)

Status: Needs review » Needs work

The last submitted patch, 12: merge_normal_and-2678332-12.patch, failed testing.

johnchque’s picture

StatusFileSize
new502 bytes
new7.46 KB

Nice icon idea, IMHO this one with this color would be a good idea for continuous.

I have uploaded the icon on a txt file, to use it just change the extension to .svg

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new30.33 KB
new94.85 KB
new2.08 KB

Using the svg

Status: Needs review » Needs work

The last submitted patch, 15: merge_normal_and-2678332-15.patch, failed testing.

johnchque’s picture

StatusFileSize
new502 bytes

Discussed with @Miro, this icon should be good for continuous jobs. (It is the same icon in gray color). Also change the extension to svg to use it.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new1.74 KB
new30.37 KB

This should fix some tests and added new image.

Status: Needs review » Needs work

The last submitted patch, 18: merge_normal_and-2678332-18.patch, failed testing.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new637 bytes
new30.38 KB

Ups wrong entity type id. Cache wasn't cleared properly.

Status: Needs review » Needs work

The last submitted patch, 20: merge_normal_and-2678332-20.patch, failed testing.

mbovan’s picture

Discussed now with @Denchev and we are not sure what are the possible job states for continuous jobs?
Is it:
- Only "Continuous" = Active - entity types and providers selected
- Unprocessed - a continuous job with no entity types or providers selected
- And possible and in the future "Paused" - a continuous job was active but then all entity types are unselected which makes a job "Inactive"?

What about Finished/Aborted? Do we want to support this for continuous jobs as well at some point of time?

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new44.82 KB
new26.56 KB

Didn't run the tests after the rebase have to see here if i broke something.

So first i have a question about custom access check for entity.tmgmt_job.add_form in tmgmt.links.action.yml. Do i have to extend LocalActionDefault and get some access check in or is there some other way?

Also we have Ignore status changes for continuous jobs that introduces new sates for continuous. Are we going in this direction now? Should we maybe first commit that issue and i work on top of that?

Status: Needs review » Needs work

The last submitted patch, 23: merge_normal_and-2678332-23.patch, failed testing.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new3.03 KB
new29.12 KB

Access check for add continuous job link and tests.

Status: Needs review » Needs work

The last submitted patch, 25: merge_normal_and-2678332-25.patch, failed testing.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new844 bytes
new43.39 KB

Testing if this fixes tests.

Status: Needs review » Needs work

The last submitted patch, 27: merge_normal_and-2678332-27.patch, failed testing.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new1.06 KB
new44.05 KB
berdir’s picture

Status: Needs review » Needs work
  1. diff --git a/config/install/views.view.tmgmt_continuous_job_overview.yml b/config/install/views.view.tmgmt_continuous_job_overview.yml
    deleted file mode 100644
    

    Now we have an interesting problem. We have an update function that creates this view.

    We need to make sure that updating from the previous beta version works. It doesn't need to result in the exactly same configuration, but it shouldn't break.

    So we likely need to at least disable the update function that adds that view. And maybe do some more changes.

    Test by installing beta2 (switch to that tag), then update to the latest version with your patch, run updates and see what happens.

    If it fails, fix it. If it kind of works but the is missing some filter/fields that's OK. But please post a screenshot of that.

  2. +++ b/config/install/views.view.tmgmt_job_overview.yml
    @@ -883,31 +883,39 @@ display:
    -            operator_id: ''
    -            label: ''
    +            operator_id: job_type_op
    +            label: 'Job Type'
    

    We have continuous exposed as job status now, lets use that instead of adding another filter. That should already just work.

  3. +++ b/sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php
    @@ -119,7 +119,6 @@ class ContentEntitySource extends SourcePluginBase implements SourcePreviewInter
           foreach ($field as $index => $field_item) {
             $format = NULL;
    -        $translatable_properties = 0;
    

    This looks like a bad rebase, make sure you merge the latest changes.

  4. +++ b/src/Form/ContinuousJobForm.php
    @@ -120,7 +123,29 @@ class ContinuousJobForm extends JobForm {
    +      $translator_type = $translator_manager->createInstance($type);
    +      if ($translator_type instanceof ContinuousTranslatorInterface) {
    +        return AccessResult::allowedIfHasPermissions($account, ['create translation jobs']);
    +      }
    

    did you check that it works when you add a new translator that has this ability, without clearing any other caches?

    We might need addCacheTag('config:tmgmt_translator_list') on both the allowed and forbidden access result.

  5. +++ b/src/Tests/TMGMTUiTest.php
    @@ -741,17 +741,10 @@ class TMGMTUiTest extends EntityTestBase {
         $this->drupalGet('admin/tmgmt/jobs');
    -    $this->assertNoText($continuous_job->label(), 'Continuous job is not displayed on job overview page.');
    -
    -    // Test that continuous jobs are shown in the continuous job overview.
    -    $this->drupalGet('admin/tmgmt/continuous_jobs');
    -    $this->assertText($continuous_job->label(), 'Continuous job is displayed on continuous job overview page.');
    -
    -    // Test that normal jobs are not shown in the continuous job overview.
    -    $this->assertNoText($job1->label(), 'Normal job is not displayed on continuous job overview page.');
    +    $this->assertText($continuous_job->label(), 'Continuous job is displayed on job overview page.');
    

    Instead of just removing this, we should check the job status filter now here. By default, it's shown, showing e.g. active jobs only should not show it, selecting continuous jobs should show it.

  6. +++ b/src/Tests/TMGMTUiTest.php
    @@ -791,11 +789,8 @@ class TMGMTUiTest extends EntityTestBase {
    -    // Test that continuous job overview page does not have Submit link.
    -    $this->assertNoLink('Submit', 'There is no Submit link on continuous job overview.');
    +    $this->drupalGet('admin/tmgmt/jobs');
    +    $this->assertText($continuous_job_label, 'Created continuous job is displayed on job overview page.');
    

    We lost this test, we still need to check that continuous jobs can't be submitted.

    I guess it fails because we do have jobs now that can be submitted. You can fix that by switching to the continuous filter (I think submitting the form doesn't work with views, just copy the URL with the active filter).

miro_dietiker’s picture

Some notes from my first test.

So i applied and reinstalled.

If i go to job overview, i see the state "Continuous" in the exposed filter, but neither a job nor a button to create it. The reason for this is that i didn't have any translator that supports ContinuousTranslatorInterface. I thought we want to hide the states then completely.

I still don't get how i can make the continuous stuff fully show up.

When adding a continuous job (Suddently the button still appeared, no idea why) i see "Google (unsupported)" although i have google applied with the latest patch to implement ContinuousTranslatorInterface.

The continuous icon is still green instead of grey like defined above. Also we start to have many icons - i'm losing overview.

I selected all source items and clicked the "Check for continuous jobs" button. And another item was created for an item that was already in a job.
Yeah, that item was previously added to a different translator but it still pending. So i have the item now twice on the pending job item list...

Also after bulk adding, i have the job item for "TMGMT Demo" (from tmgmt_demo) but the item does not show up on the sources overview as pending item. I guess the reason is that the job is in one of the new continuous job states. But that's wrong.

berdir’s picture

* Yes, continuous should only be shown when there are continuous translators. This isn't even part of this issue, but I forgot to point that out in #2682771: Ignore status changes for continuous jobs. Lets fix it here.

* Everything should show up if you have a translator that supports continuous, which according to the tests, seems to be working fine.

* Yes, as already discussed, continuous jobs currently only check in their own context for existing job items. That's for #2679949: Never allow duplicate submission of an item while in process to generalize.

* Again yes, the active job item check is likely not including the new job state. Since that is also not related to this issue, lets fix that separately, with tests.

johnchque’s picture

About the icons I think the gray and turquoise color icons have been added in #2682771: Ignore status changes for continuous jobs to make the difference with the inactive state.

mbovan’s picture

When adding a continuous job (Suddently the button still appeared, no idea why) i see "Google (unsupported)" although i have google applied with the latest patch to implement ContinuousTranslatorInterface.

I got the same problem. In the initial load source and target language are not properly set which tells Google that these "languages" are not supported. When you change a target language, there is an ajax update and languages are properly set - Google supports translations again.

There is a message in checkout settings for this: Google can not translate from Not specified to English..

Edit: I see this is at least a week old problem.

The continuous icon is still green instead of grey like defined above. Also we start to have many icons - i'm losing overview.

As we have two states for continuous jobs now (continuous and continuous_inactive), #2682771: Ignore status changes for continuous jobs added green (continuous) and gray (continuous inactive) icons.

mbovan’s picture

Status: Needs work » Needs review
StatusFileSize
new45.68 KB
new1.63 KB
new34.27 KB

Agreed with @Denchev that I will check #30.1

Made some changes in update functions. It seems it's working fine, some filters are not correct/working (like open jobs for continuous jobs). The screenshot below.

Continuous update

berdir’s picture

Don't renumber update functions. Just remove the content of the one we no longer have, and comment that it was removed as we no longer create this view.

mbovan’s picture

thenchev’s picture

Should cover #30
and from #31 removed continuous from exposed filter when no continuous translators are available.

berdir’s picture

Status: Needs review » Needs work
  1. +++ b/src/Plugin/views/filter/JobState.php
    @@ -101,4 +105,20 @@ class JobState extends ManyToOne {
    +   */
    +  public function checkIfContinuousTranslatorAvailable() {
    +    $translator_manager = \Drupal::service('plugin.manager.tmgmt.translator');
    +    $translator_plugins = $translator_manager->getDefinitions();
    +    foreach ($translator_plugins as $type => $definition) {
    +      $translator_type = $translator_manager->createInstance($type);
    +      if ($translator_type instanceof ContinuousTranslatorInterface) {
    +        return TRUE;
    +      }
    +    }
    

    can we make this available somewhere, e.g. in continuous manager, so we don't have to duplicate that code in multiple places?

  2. +++ b/tmgmt.install
    @@ -57,15 +57,9 @@ function tmgmt_update_8003() {
    -  $storage_controller->create($values)->save();
    -}
    +// Update function tmgmt_update_8004() has been removed since we are not
    +// creating a separate view for continuous jobs. It has been replaced with a
    +// single job overview for both continuous and normal translation jobs.
     
    

    What I meant is to keep the function and have the comment inside.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new3.93 KB
new31.68 KB

Covers #39

thenchev’s picture

This test should now fail because of the add continuous button not appearing after we install an translator that supports continuous.

Status: Needs review » Needs work

The last submitted patch, 41: merge_normal_and-2678332-41.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new35.45 KB
new1015 bytes
new553 bytes

Ok. So there's a problem with translator dependencies. They are missing and that results that in the test, we do not actually remove and re-create them.

However, after that it still fails, despite me seeing he right cache tags.

This could be a core bug. The attached patch passes for me with the also attached core patch. *Somehow*, in my testing, #cache of the links don't bubble up. Could be because above we have the content key which doesn't contain anything except #cache and children, I don't know. Note that the core patch is actually incomplete and is missing to properly merge cache tags of multiple local actions, but it's enough to confirm this.

Considering to comment this test out for now and open a follow-up. I can live with having to clear cache manually for now in this scenario.

Could use someone else confirming that the core change indeed fixes it.

The last submitted patch, 43: merge_normal_and-2678332-43.patch, failed testing.

thenchev’s picture

With the core patch is works for me test is green and in the ui it behaves like it should.

thenchev’s picture

Status: Needs review » Needs work

The last submitted patch, 46: merge_normal_and-2678332-46.patch, failed testing.

thenchev’s picture

Status: Needs work » Needs review
StatusFileSize
new454 bytes
new35.26 KB

Revering changes from #43
Test should be passing now.

miro_dietiker’s picture

Status: Needs review » Needs work

Not so sure about the icon situation. I'm much unsatisfied about our status usability. Too many icons now instead of simplification through a few icons.

But that can be a followup! :-)

miro_dietiker’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Fixed

Nice!

This looks good enough to me to commit it. We have some follow-ups.

beta to beta update is a bit tricky because the job state filter still has the group configuration which no longer works so well. I guess we can ignore that for now and just tell users to re-import the default view.

berdir’s picture

  • Berdir committed f4fe593 on 8.x-1.x authored by Denchev
    Issue #2678332 by Denchev, mbovan: Merge normal and continuous job...

Status: Fixed » Closed (fixed)

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