Commit bb2ad0ad authored by ujvari's avatar ujvari

Remove past data support from stream filter

The processed streamfilter does not send back anything,
more_hits message can give back annotations
parent 74519983
...@@ -64,9 +64,6 @@ class AppController ...@@ -64,9 +64,6 @@ class AppController
else else
$scope.dialog.visible = false $scope.dialog.visible = false
# Skip the remaining if this is the first evaluation.
return if oldVal is undefined
# Update any edits in progress. # Update any edits in progress.
for draft in drafts.all() for draft in drafts.all()
annotator.publish 'beforeAnnotationCreated', draft annotator.publish 'beforeAnnotationCreated', draft
...@@ -91,7 +88,6 @@ class AppController ...@@ -91,7 +88,6 @@ class AppController
identity.logout() identity.logout()
$scope.loadMore = (number) -> $scope.loadMore = (number) ->
unless streamfilter.getPastData().hits then return
streamer.send({messageType: 'more_hits', moreHits: number}) streamer.send({messageType: 'more_hits', moreHits: number})
$scope.clearSelection = -> $scope.clearSelection = ->
...@@ -146,7 +142,6 @@ class AnnotationViewerController ...@@ -146,7 +142,6 @@ class AnnotationViewerController
annotator.loadAnnotations(rows) annotator.loadAnnotations(rows)
streamfilter streamfilter
.setPastDataNone()
.setMatchPolicyIncludeAny() .setMatchPolicyIncludeAny()
.addClause('/references', 'first_of', id, true) .addClause('/references', 'first_of', id, true)
.addClause('/id', 'equals', id, true) .addClause('/id', 'equals', id, true)
......
...@@ -261,7 +261,6 @@ class QueryParser ...@@ -261,7 +261,6 @@ class QueryParser
class StreamFilter class StreamFilter
strategies: ['include_any', 'include_all', 'exclude_any', 'exclude_all'] strategies: ['include_any', 'include_all', 'exclude_any', 'exclude_all']
past_modes: ['none','hits','time']
filter: filter:
match_policy : 'include_any' match_policy : 'include_any'
...@@ -270,13 +269,10 @@ class StreamFilter ...@@ -270,13 +269,10 @@ class StreamFilter
create: true create: true
update: true update: true
delete: true delete: true
past_data:
load_past: "none"
constructor: -> constructor: ->
getFilter: -> return @filter getFilter: -> return @filter
getPastData: -> return @filter.past_data
getMatchPolicy: -> return @filter.match_policy getMatchPolicy: -> return @filter.match_policy
getClauses: -> return @filter.clauses getClauses: -> return @filter.clauses
getActions: -> return @filter.actions getActions: -> return @filter.actions
...@@ -284,23 +280,6 @@ class StreamFilter ...@@ -284,23 +280,6 @@ class StreamFilter
getActionUpdate: -> return @filter.actions.update getActionUpdate: -> return @filter.actions.update
getActionDelete: -> return @filter.actions.delete getActionDelete: -> return @filter.actions.delete
setPastDataNone: ->
@filter.past_data =
load_past: 'none'
this
setPastDataHits: (hits) ->
@filter.past_data =
load_past: 'hits'
hits: hits
this
setPastDataTime: (time) ->
@filter.past_data =
load_past: 'hits'
go_back: time
this
setMatchPolicy: (policy) -> setMatchPolicy: (policy) ->
@filter.match_policy = policy @filter.match_policy = policy
this this
...@@ -355,7 +334,6 @@ class StreamFilter ...@@ -355,7 +334,6 @@ class StreamFilter
@setActionCreate(true) @setActionCreate(true)
@setActionUpdate(true) @setActionUpdate(true)
@setActionDelete(true) @setActionDelete(true)
@setPastDataNone()
@noClauses() @noClauses()
this this
......
...@@ -18,6 +18,7 @@ class StreamSearchController ...@@ -18,6 +18,7 @@ class StreamSearchController
$scope.search.query = $routeParams.q $scope.search.query = $routeParams.q
terms = searchfilter.generateFacetedFilter $scope.search.query terms = searchfilter.generateFacetedFilter $scope.search.query
queryparser.populateFilter streamfilter, terms queryparser.populateFilter streamfilter, terms
streamer.send({filter: streamfilter.getFilter()})
# Perform the search # Perform the search
searchParams = searchfilter.toObject $scope.search.query searchParams = searchfilter.toObject $scope.search.query
......
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