Commit 1d32620e authored by Robert Knight's avatar Robert Knight

Add documentation to explain what search-filter and view-filter are for

It is not particularly clear from the naming of these modules what they
are for and how they relate to things the user can do in the
application. Add some comments to clarify this.
parent 734244b9
...@@ -230,6 +230,13 @@ function generateFacetedFilter(searchtext) { ...@@ -230,6 +230,13 @@ function generateFacetedFilter(searchtext) {
}; };
} }
/**
* Parse annotation filter queries into structured representations.
*
* Provides methods to parse Lucene-style queries ("foo tag: bar")
* into structured representations which are then used by other services to
* filter annotations displayed to the user or fetched from the API.
*/
// @ngInject // @ngInject
function searchFilter() { function searchFilter() {
return { return {
......
...@@ -4,6 +4,14 @@ ...@@ -4,6 +4,14 @@
// breaks browserify-ngannotate. // breaks browserify-ngannotate.
let unused; // eslint-disable-line let unused; // eslint-disable-line
/**
* Filter annotations against parsed search queries.
*
* When the user enters a query in the search box, the query is parsed using
* `generateFacetedFilter` and the currently loaded annotations are then matched
* against the parsed query by the `filter` method of this class. Annotations
* which do not match the filter are then hidden.
*/
// @ngInject // @ngInject
function viewFilter(unicode) { function viewFilter(unicode) {
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment