Closed (fixed)
Project:
Translation Management Tool
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
21 Feb 2016 at 21:17 UTC
Updated:
10 Apr 2016 at 20:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sanja_m commentedAssigning to me.
Comment #3
sanja_m commentedInitial patch.
Comment #5
miro_dietikerGreat to see some progress with delete limitation and aborting.
However i have no idea what you do with the "Resubmit" action.
What i'm saying is that if you try to add an item, it might not be possible if it is already part of an active job.
However, once you can abort the item, it will be possible to add it using the regular tools.
But this issue should only disallow deletion after submission and add the abort operation on an item level.
Comment #6
sanja_m commentedUpdated patch, removed resubmit action and fixed test fails.
Comment #7
johnchqueShould not be this operations['abort'] ?
Comment #8
sanja_m commentedI was looking for some example in JobListBuilder.php and there is 'cancel' for abort action, so I added 'cancel' too, dunno should I replace it with 'abort' ?
Comment #9
miro_dietikerThe current Abort button was previously named Cancel until the term Abort was introduced.
I'm happy if you switch the current 'cancel' key to 'abort' also as part of this issue.
Comment #10
miro_dietikerAs a critical piece:
Translators might still update this item as it was submitted and no translator checks the item for the abort state currently.
But we need to definitely avoid saving the data back after abort. The button "Accept" needs to disappear on the review form.
Also autoaccept needs to suppress aborted items!
The confirm form should state that abort is an internal decision and the translator/provider does not know about that it.
Comment #11
sanja_m commentedUpdated patch.
Comment #12
miro_dietikerAnd we need for sure all variants of test coverage.
Comment #13
sanja_m commentedUpdated test a bit.
Comment #14
miro_dietikerLooks pretty good, with some feedback.
I would expect that we throw an exception if abortTranslation() fails.
A similar construct exists in tmgmt_write_request_messages() and JobAbortForm() for Job and JobItemForm...
Possibly something for a followup refactoring.
Comment #15
sanja_m commentedUpdated patch.
Comment #16
miro_dietikerNow you changed abortTranslation interface that needs declaration plus a proper try / catch for callers.
Yeah now you dropped JobInterface of $job and misleadingly it is still called $job what sometimes also is a JobItem.
BTW similar code to cover is also in tmgmt_file. ;-)
Thus we either need a separate interface for getMessagesSince() or two separate typed methods - one for Job and one for JobItem case.
I'm unhappy with this global procedural wrapper and unsure if a wrapper like printMessagesSince() needs to go to Job and JobItem.
Unsure it we should just add the duplicated code and address this refactoring in a separate issue.
At least Berdir should provide feedback first.
Comment #17
berdirhow can the entity be active and aborted at the same time? shouldn't be necessary to check both?
I don't understand why we would allow to delete then (other than deleting as part of the whole job). Since we don't notify the provider anyway, this extra step would be kinda pointless if we then can delete anyway?
same, aborted is a different step, it can't be in needs review and aborted at the same time?
This is why delete in many cases is a link now, not a button.
copied from job, this is a lie! :)
we don't ask the plugin, we don't really return true/false but throw an exception, ..
Yes, removing this is problematic. At least we should have a specific interface for the methods we need here. Seems like that could be a separate issue, we can just duplicate the few lines of code for now.
this is wrong, getMessage() already returns a translated string.
Comment #18
sanja_m commentedUpdated patch and created follow-up issue for code refactoring - #2689025: Refactor code where getMessagesSince() is used.
Comment #19
berdirwhat happens for continuous jobs for this?
We might be able to just rely on the job item status now. what about needs review? I think you can abort then too.
I think we can simplify this by only allowing access if the job item is inactive, if not, always unset. Then the other if doesn't have to duplicate the unset.
And actually, this logic belongs in JobItemAccessControlHandler I'd say.
Aborted job items can no longer be accepted. The provider will not be notified.
that doesn't seem very useful.
this todo can be removed now.
We need to check that a job changes to finished if all job items are either accepted or aborted. See tmgmt_job_check_finished()
Comment #20
sanja_m commentedFixed bugs from #19.
Comment #21
berdirAlmost there now I think.
Now that yo uadded it to checkAccess(), this should just work and you can delete this. Check how the parent implementation checks delete access.
Sorry for not being clear. I think we can remove the @return completely (also in the implementation). If it doesn't work then we throw an exception, so we don't have to return anything on success.
Comment #22
sanja_m commentedFixed bugs from #21 too.
Comment #23
miro_dietikerQuickly discussed with Eduard about reviewing job items when source changed and sometimes the reviewer possibly even prefers to abort the item to resubmit the item for translation again.
FOLLOWUP Allow to re-submit an aborted job item easily.
Comment #24
mbovan commentedTitle is not used here.
Maybe we want to update message similary to one for deleting jobs: "Are you sure you want to abort the job item %title?"
This can throw an exception, I think we want to handle it?
This will require a custom access check. We should check if a job item is not already in any state other than "Active" (which gives an Exception right now)
Comment #25
sanja_m commentedUpdated patch.
Comment #27
berdirI guess this couldn't really happen since you wouldn't be able to access that page anymore. But doesn't hurt to have it.
Thanks, committed.
Comment #28
miro_dietikerExtending title since the term "item abort" is missing and the feature was added here.