GOOGLE-155 Enable searching of collapsed GDrive folders



Keyboard shortcuts  
Summarize the review outcomes (optional)


Warning: no files are visible, they have all been filtered.
Participant Role Time Spent Comments Latest Comment
Author 57m 7 Yes, exactly.
Reviewer - 100% reviewed 5m 2 hostName is not used anywhere other than line 540. Maybe ...
Reviewer - Complete 10m    
Reviewer - 100% reviewed 3m    
Patrick Haggood (deleted user)
Reviewer - 0% reviewed      
Reviewer - Complete 41m 3 Comment here would be great
Reviewer - Complete 16m 2 Great to check using JSLink.
Reviewer - Complete 6m    
Total   2h 18m 14  


With the implementation of the new GDrive UI with jsTree, folder data is only loaded from Google Drive when requested by the user when they expand folders. Therefore, GDrive doesn't know about the contents of the folders and cannot perform an accurate search.

To remedy this, we make use of a jsTree API feature which allows us to specify an Ajax function (although it doesn't need to be Ajax) that will determine what folder data needs to be loaded before a search is run.

This has an added benefit that the current page view caches the folder data, making subsequent folder expansions and searches quicker.

Commit comments:


Added pre-search Ajax function to assemble a list of tree nodes that should be loaded (because they contain search results) before the search code is run.

Added code to only perform search if search text has changed, because some browser events (switching tabs, windows, or even between applications) was causing the search to be run again.

When a new search begins, clear the old search.

Keep a list of outstanding search Ajax requests so that they can be aborted just before a new search starts.

Disabled the jsTree web worker feature, which was interfering with our Ajax calls.

Changes unrelated to this issue:

Changed console.log() calls to console.warn() so that browsers that have a warning indicator will show it.

Fixed the order of arguments received from $.ajax() calls by error callback functions.


getDriveFile(): Surprisingly, this method has been using the error callback's arguments in the wrong order for a long time. I've fixed this and also changed the code to use the "promise" model in an attempt to improve error handling. It didn't help, but it didn't hurt. The promise model is recommended for new jQuery code, so I'll keep this code.

_getGoogleDriveUrl(): Simplified and clarified by using meaningful, descriptive variable names.

Also, JSLint recommended changes and simplified some other code.

Branches in review


Issues Raised From Comments

Key Summary State Assignee

General Comments

There are no general comments on this review.
/umich/google/.../js/google-drive-utils.js Changed 8
/umich/google/.../webapps/js/googleDriveLti.js Changed 6

Review updated: Reload | Ignore | Collapse

You cannot reload the review while writing a comment.

Create issue

Assign To Me

Log time against