Commit 50fe32b8 authored by Anton's avatar Anton

Add textfilter and regular expressions to AnnotationList cell

parent 74ba7072
......@@ -154,6 +154,26 @@
errorMessage: 'Needs to be a valid number',
value: 0,
path: 'duration'
},
{
inputType: 'text',
type: 'Annotation-List',
label: 'Textfilter',
help: 'Filter annotations by search string',
error: false,
errorMessage: '',
value: undefined,
path: 'textfilter'
},
{
inputType: 'text',
type: 'Annotation-List',
label: 'RegExp',
help: 'Filter annotations by regular expression',
error: false,
errorMessage: '',
value: undefined,
path: 'regexp'
}]
}
}
......
......@@ -196,6 +196,14 @@ export default {
$lte: endDateISO
}
}
if (this.cell.textfilter) {
annotationsQuery['body.value'] = RegExp(`.*${this.cell.textfilter}.*`, 'ig')
}
else if (this.cell.regexp) {
annotationsQuery['body.value'] = this.cell.regexp
}
const annotationsResult = await this.$store.dispatch('annotations/find', annotationsQuery)
let annotations = annotationsResult.items.filter(a => {
return Date.parse(a.target.selector.value) >= this.videoTime
......
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