Addresses WTD-1506 (context menu does not disappear after
action is chosen); listen for click events on the menu
itself and dismiss the menu when these occur.
Use the parent id as the location for a model.
This greatly reduces the recursive work that must be done
during move operations to keep the location accurate.
Additionally, the locationService now implements a method
`persistLocation` which can be used to persist the current object
location as it's original location.
When moving an object that supports composition, child objects which
are originals must have their location updated as well. Children which
are links should not have their location updated, nor should any of
their children be updated.
MockLinkService.perform returns a promise for the linked domainObject.
When resolving the promise and not specifying an object to resolve it
with, it will resolve it with the domainObject that was originally
passed to it.
When indexing items initially, the generic
provider listens for mutations in case an
item's composition changes, so it can then
index the new children.
DomainObjects with a context capability also gain a LocationCapability.
This capability allows you to determine the location of the current
instance of a domain object, and also provides methods for determining
if the current instance of a domain object is a link, or if it is an
original.
Slight tweak to the padding of the search view,
which affects where the top of the scroll bar
appears. Also removed the search scroll div
because it was unused.
The controller's loadMore function now sends
new queries to the search service if the
controller's full results list does not have
enough results in it to load more.
The elasticsearch provider returns an empty
result when elasticsearch throws an error
(probably a bad request). This prevents the
aggregator from thinking that ES is loading
infinitely.
The aggregator now returns a result object similar
to that of the providers, but the hits array contains
domain objects rather than searchResult objects.
Also removed overly complicated filterRepeats
function from the aggregator and replaced it with a
simpler one.
The provider now returns an object that has
a hits property which contains what it
previously returned, and also a total property
which contains the total number of results.
Removed the name field from the ElasticSearch provider
search query string, so now it will check all of the
fields of the domain object (such as type).
Updated comments and documentation. Changed the generic
worker to return results as {id: score} key value pairs
rather than {id: {score: score}} format. Removed unused
getLatestResults and getLatestTimestamps functions from
the providers.
Removed the timestamp as an optional parameter
of the search aggregator's query(), and now it
instead automattically generates one before
querying the providers.
Also attempted to fix loading, but did not
complete (commented out).
The search service's interface now just consists
of the two functions query() and isLoading().
query() returns a promise for an array or results,
which eliminates the need for timeout polling like
was previously done. The search providers
have also been changed to reutrn promises.
Cleaning up code in generic serach provider. Removed
unnecissary return statements. Moved indexing via web
worker from getItems() loop to within itemsHelper().
Commented out timeout, becuase seems unnecissary.
Changed all date.getTime() to Date.now(). Indexing
has undefined checking.
Changed the generic search provider to index the
file tree only once when it is initially called.
This assumes that the contents of the file tree
will not change significantly within the course
of a use session (and some changes may be caught
by other search providers).
Updated documentation. Removed most unused funtions.
Removed references to the search service in the
search template -- necissary functions added to
the search controller.
(Search in a 'working' state again.)
Moved the polling for most recent results
from the search controller to the search
aggregator.
Also changed ng-change back to ng-keyup
in the search template.
Made the search bar text input go to ngModel.input,
rather than getting the text manually from the DOM
element. Additionally, removed the search service
from the search controller's scope.
Moving the responsibility of polling for updates
from the search controller to the search aggregator.
In progress. Previously this prototype was what
could be called semi-stable, but now it is no longer.
The tree is now hidden whenever there is
text in the search bar. (This allows for
the case when there are no search results,
but text in the search bar.)