Bug 1103947 - [Translation Editor] Dialog "Invalid translation" failed to obtain input focus.
Summary: [Translation Editor] Dialog "Invalid translation" failed to obtain input focus.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Zanata
Classification: Retired
Component: Component-UI
Version: 3.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.4
Assignee: Alex Eng
QA Contact: Ding-Yi Chen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-03 00:57 UTC by Ding-Yi Chen
Modified: 2014-07-17 06:39 UTC (History)
2 users (show)

Fixed In Version: 3.4.2-SNAPSHOT (git-server-3.4.1-16-gcaeed7b)
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-07-17 06:39:45 UTC
Embargoed:


Attachments (Terms of Use)
Screenshot: Dialog "Invalid Translation" failed to get focus (99.98 KB, image/png)
2014-06-03 01:15 UTC, Ding-Yi Chen
no flags Details
Screen cast of bug reproduced in Chrome (6.57 MB, video/ogg)
2014-06-10 02:03 UTC, Ding-Yi Chen
no flags Details

Description Ding-Yi Chen 2014-06-03 00:57:28 UTC
Description of problem:
After user entered an invalid translation, a dialog "You are trying to save an invalid translation" poped up.

However, the page was dimmed, and the dialog did not get input focus.
Consequently, translator could do nothing other than press 'Esc' to close the dialog.

Version-Release number of selected component (if applicable):
Zanata 3.5.0-SNAPSHOT (git-server-3.4.1-52-g47cdeb5)
Firefox 24.4.0

How reproducible:
Easy always with Firefox

Steps to Reproduce:
1. Log in as a project maintainer or admin.
2. Go to project setting -> translation, and change the validation of Leading/trailing newline (\n) to "Error"
3. Go to any version, any language, any document
4. In any entry, trigger an error by adding an additional newline in the end of string.
5. Save as translated by clicking at the save button.
6. Click "Return to editor"
7. Click "Save as fuzzy"

Actual results:
 After 5: 
   Dialog "You are trying to save an invalid translation" was dimmed.
   Layer of dialog was not on the top. (See attachment)
  

 After 6: Nothing happened
 After 7: Nothing happened
  

Expected results:
 After 5: 
   Dialog "You are trying to save an invalid translation" should be emphasized..
   Layer of dialog should be on the tup
  
 After 6: Should be returned to the entry that trigger error.
 After 7: The entry should be saved as fuzzy.


Additional info:
1. Temporary workaround: Press 'Esc' to return to editor.
2. This bug also shown in Chrome, but occasionally.

Comment 1 Ding-Yi Chen 2014-06-03 01:15:53 UTC
Created attachment 901553 [details]
Screenshot: Dialog "Invalid Translation" failed to get focus

Comment 2 Ding-Yi Chen 2014-06-03 01:26:35 UTC
Tested with Chrome 35.0.1916.114

Steps to reproduce in Chrome:
1-5 are same with firefox.
After 5. it may seems it as if it was saving the entry (but it was not).

6. Click the entry that trigger the error.

7. Save as translated.

After step 7, the symptom is same with firefox.

Comment 3 Alex Eng 2014-06-03 06:25:22 UTC
Pull request:
https://github.com/zanata/zanata-server/pull/485

Comment 4 Ding-Yi Chen 2014-06-05 08:06:19 UTC
Tested with Zanata 3.4.2-SNAPSHOT (git-server-3.4.1-7-g1ed6db1):

With Firefox 24.4.0:
Button "Return to editor" does not work"


With Chrome 35.0.1916.114
1. Button "Return to editor" does not work"
2. "Save as Fuzzy" bring you back to the entry, but it does not save as fuzzy,
   and you cannot leave the entry even if you saved as fuzzy.
3. The first entry that trigger the error still showing as it is saving.


I also found that set newline checking as "ERROR" does not trigger an ERROR, it still a warning. But that should be tracked in other bug.

Please use "Positional printf (XSI extension)"  to trigger the error.

Reassigned.

Comment 5 Ding-Yi Chen 2014-06-06 01:59:12 UTC
The newline not showing error bug is tracked with Bug 1105375.

Comment 6 Alex Eng 2014-06-09 22:00:29 UTC
Tested from https://github.com/zanata/zanata-server/pull/485 seems alright. Can you let me know where did you get the WAR file from?

Comment 8 Ding-Yi Chen 2014-06-10 00:48:12 UTC
Tested with Zanata 3.4.2-SNAPSHOT (git-server-3.4.1-7-g1ed6db1) 

With Firefox 24.4.0:
Button "Return to editor" does work, but it tooks 4.7 seconds on my local machine for it to disappear. It might be worse in production server.
Otherwise it is good.


With Chrome 35.0.1916.114
1. If you trigger an invalid Error the first time on the session,
   it shows "Saving...", but it is not actually saving, and validator failed to 
   show the "Invalid translation" Dialog.
  
   The javascript console shows following error:

(-:-) 2014-06-10 10:40:48,476 [FATAL] uncaught exception
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at Unknown.$collect(JsArrayString.java:42)
    at Unknown.fillInStackTrace_3(StackTraceCreator.java:174)
    at Unknown.fillInStackTrace_1(StackTraceCreator.java:501)
    at Unknown.fillInStackTrace(Throwable.java:72)
    at Unknown.$$init_12(Throwable.java:46)
    at Unknown.Throwable_1(Throwable.java:52)
    at Unknown.Exception_1(Exception.java:29)
    at Unknown.RuntimeException_1(RuntimeException.java:29)
    at Unknown.IndexOutOfBoundsException_1(IndexOutOfBoundsException.java:29)
    at Unknown.indexOutOfBounds(AbstractList.java:191)
    at Unknown.checkIndex(AbstractList.java:183)
    at Unknown.$get_8(ArrayList.java:157)
    at Unknown.get_32(ArrayList.java:156)
    at Unknown.$onSuccess_32(TransUnitSaveService.java:202)
    at Unknown.onSuccess_35(TransUnitSaveService.java:200)
    at Unknown.$onSuccess_30(SeamDispatchAsync.java:97)
    at Unknown.onSuccess_33(SeamDispatchAsync.java:96)
    at Unknown.onResponseReceived(RequestCallbackAdapter.java:232)
    at Unknown.$fireOnResponseReceived(Request.java:287)
    at Unknown.onReadyStateChange(RequestBuilder.java:395)
    at Unknown.anonymous(XMLHttpRequest.java:351)
    at Unknown.apply_3(Impl.java:189)
    at Unknown.entry0(Impl.java:242)
    at Unknown.anonymous(Impl.java:70)

2. Save to fuzzy failed to save the invalid as fuzzy, nor it is display properly.

Comment 9 Ding-Yi Chen 2014-06-10 02:03:26 UTC
Created attachment 906801 [details]
Screen cast of bug reproduced in Chrome

Screen cast of bug reproduced in Chrome

Comment 10 Ding-Yi Chen 2014-06-11 00:45:57 UTC
Tested with Zanata 3.4.2-SNAPSHOT (git-server-3.4.1-8-g1553fb4)

Common problem that appear both Firefox and Chrome
Steps to reproduced:
Start from Step 4. In any entry, trigger an error by adding an additional newline in the end of string.
6. Click the next page (or switch any other page)
7. Click "Save as Fuzzy"

Expected:
Entry that trigger should be saved as fuzzy.

Actual:
Entry that trigger was not saved at all.

With Firefox 24.4.0:
Button "Return to editor" does work, but it tooks 4.7 seconds on my local machine for it to disappear.

Comment 11 Ding-Yi Chen 2014-06-16 01:30:17 UTC
VERIFIED with Zanata 3.4.2-SNAPSHOT (git-server-3.4.1-16-gcaeed7b)
Firefox ESR 24.5.0
Google Chrome 35.0.1916.153

Note that Firefox is still slow to hide the dialog, but there was an loading indicator, so user won't think it's stop working and click on "Return to editor" multiple time.


Note You need to log in before you can comment on or make changes to this bug.