Bug 729524

Summary: Copy button in webtrans instantly saves instead of allowing edits
Product: [Retired] Zanata Reporter: David Mason <damason>
Component: Component-UIAssignee: James Ni <jni>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: unspecified Docs Contact:
Priority: high    
Version: 1.3-alpha-3CC: jni, sflaniga, zanata-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: 1.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-28 07:05:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 729533    

Description David Mason 2011-08-10 03:20:57 UTC
Description of problem:Copy button in webtrans editor table should copy source to editor window without saving, but instead copies source and saves without opening an editor window.

Version-Release number of selected component (if applicable):

How reproducible: always

Steps to Reproduce:
1.Sign in and select 'Translate' to open webtrans editor
2.Click the copy from source button
Actual results:No editor window is opened, source string is copied to target and saved as approved.

Expected results: Editor window is opened for the row on which the copy button was pressed, source string is copied to the editor window, editor window has focus, no save operation is performed (before the user invokes a save operation or navigates away from the editor).

Additional info:

Comment 1 Sean Flanigan 2011-08-10 03:24:46 UTC
This button should cause the corresponding editor to open, give it focus, and position the cursor at the end of the text.  The Save shouldn't happen until the Save button is clicked, or the editor loses focus (ie standard "implicit save").

Comment 2 James Ni 2011-08-11 02:24:31 UTC
I have fixed this issue, the reason that caused this issue is sourcePanel has a click handler to perform 'implicit save', it means if user click the sourcePanel, the sourcePanel will close the editor and save the content in editor. Since copy button is moved to sourcePanel and become a child widget of sourcePanel, if user click the copy button, it will also trigger this click handler, then cause the problem. 

I move the click handler to Lable widget inside the sourcePanel, then clicking copy button will not trigger the 'implicit save' now.

I once tried to detect the onBlur event of editor, but it is difficult to distinguish which cause the onBlur event, it could be clicking the sourcePanel, it also could be clicking the copy button, so i have to add a click handler to detect the click event.

Comment 3 Ding-Yi Chen 2011-08-15 04:56:45 UTC
VERIFIED with Zanata version 1.4-SNAPSHOT (20110815-0602)

With Firefox 5.0 and Google Chrome 13.0.782.107