Commit a9c31fea authored by Anton's avatar Anton

Fix regex in annotation list on viewer

parent 20b8e011
......@@ -7,16 +7,15 @@
//q-list-header
q-item {{videoMeta.title}}
template(v-if="cell.displayType ==='tabs'")
template(v-if="cell.displayType === 'tabss'")
.annotation-tabs-container.column
.annotation-tab(
v-for="(annotation, index) in annotations",
@click="event => {handleTabClick(event, annotation, index)}", :key="index",
:class="{active: index === activeTabIdx}"
)
@click="event => {handleTabClick(event, annotation, index)}", :key="`tab-${index}`",
:class="{'active': isAnnotationActive(annotation, index)}")
div {{index + 1}}
.annotation-content-container
q-item.annotation(v-for="(annotation, index) in annotations", v-show="index === activeTabIdx", :key="index")
q-item.annotation(v-for="(annotation, index) in annotations", v-show="index === activeTabIdx", :key="`annotation-${index}`")
div
.date {{formatSelectorForList(annotation)}}
markdown-display.content(:content="annotation.body.value")
......@@ -89,6 +88,7 @@ export default {
},
async mounted () {
this.videoUuid = this.cell.sourceUuid
console.log('list', this.cell.displayType)
try {
const videoAnnotation = await this.$store.dispatch(
'annotations/get',
......@@ -102,6 +102,7 @@ export default {
console.debug('Unable to fetch metadata for annotation')
}
await this.fetchAnnotations()
console.log(this.annotations)
this.$root.$on('video-time-changed', this.onVideoTimeChanged)
this.$root.$on('grid-datetime', this.onGridDateTime)
......@@ -211,11 +212,26 @@ export default {
}
}
// if (!process.env.IS_VIEWER) {
// annotationsQuery['target.selector.value'] = {
// $gte: startDate.toISO(),
// $lte: endDateISO
// }
// }
// let regCheck
if (this.cell.textfilter) {
annotationsQuery['body.value'] = RegExp(`.*${this.cell.textfilter}.*`, 'ig')
}
else if (this.cell.regexp) {
annotationsQuery['body.value'] = this.cell.regexp
let regexp = this.cell.regexp
if (process.env.IS_VIEWER) {
if (RegExp('^/.+/.*$').test(regexp)) {
const parts = regexp.match(RegExp('^/(.+)/(.*)$'))
regexp = RegExp(parts[1], parts[2])
}
}
annotationsQuery['body.value'] = regexp
}
const annotationsResult = await this.$store.dispatch('annotations/find', annotationsQuery)
......
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