Bug 803538

Summary: Search remains "active" after opening new file
Product: [Retired] Zanata Reporter: Hedda Peters <hpeters>
Component: Component-UIAssignee: David Mason <damason>
Status: CLOSED CURRENTRELEASE QA Contact: Joyce Chang <jochang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.5CC: damason, fvalen, petersen, sflaniga, zanata-bugs
Target Milestone: ---   
Target Release: 1.6-beta-1   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Zanata version 1.6.0-beta-2-SNAPSHOT (20120518-0026). Doc Type: Bug Fix
Doc Text:
Cause "Source and Target" searches within a document are stored in the history token. When a new document is loaded, the search in the history token was not updated. Consequence Searches within one document remain active when a new document is loaded. If the search returns no results in the new document, this can interact with a known issue in which the search box is hidden when loading a new document to make clearing of the search impossible without manipulating the URL. Fix "Source and Target" searches are now cleared from the history token when loading a different document. Result No "Source and Target" search will be active when loading a new document.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-22 00:58:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Showing file B, missing search box (FF 3.1) none

Description Hedda Peters 2012-03-14 23:40:56 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1

The search criteria entered into the search box in the workspace of a file does not get cleared automatically when leaving this file and opening a new one. The new file therefore also only shows messages matching the search criteria entered in the old file. 

Reproducible: Always

Steps to Reproduce:
1. Open file A
2. Type in a word "something" in search box, hit enter. 
3. Go back to document list
4. Open file B
Actual Results:  
The search for word "something" is still active when opening file B, hence only showing messages that contain a match for this search criteria.

Expected Results:  
All messages should be displayed in file B. The search should have been cleared automatically when leaving file A.

Francesco (using FF 3.1) also reported that in file B the search box is not even displayed any more (see screenshot). Hence he had no way of clearing the search criteria.
For myself (using FF 9.0.1) the search box in file B is displayed fine, showing the search criteria I entered in file A. I think the search criteria should not be carried through to the next file though.

Comment 1 Hedda Peters 2012-03-14 23:42:44 UTC
Created attachment 570135 [details]
Showing file B, missing search box (FF 3.1)

Comment 2 David Mason 2012-05-17 08:04:10 UTC
Source-and-target search is now cleared when a new document is selected.

See: https://github.com/zanata/zanata/commit/875c83df0894b426c91be35436fe05efaadd8387

Comment 3 Joyce Chang 2012-05-18 02:57:53 UTC
verified with Zanata version 1.6.0-beta-2-SNAPSHOT (20120518-0026).

Comment 4 David Mason 2012-06-06 02:45:57 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
"Source and Target" searches within a document are stored in the history token. When a new document is loaded, the search in the history token was not updated.

Consequence
Searches within one document remain active when a new document is loaded. If the search returns no results in the new document, this can interact with a known issue in which the search box is hidden when loading a new document to make clearing of the search impossible without manipulating the URL.

Fix
"Source and Target" searches are now cleared from the history token when loading a different document.

Result
No "Source and Target" search will be active when loading a new document.