Commit 7a5529de authored by christianrhansen's avatar christianrhansen

removed unused js

parent 0efb70a2
......@@ -3,7 +3,7 @@
back-button(slot="backButton")
template(slot="form-title") Annotations Table
.q-mt-lg
data-table(v-if="annotations", :config="config", path="annotations", :query="queryNew")
data-table(v-if="query", :config="config", path="annotations", :query="query")
</template>
<script>
......@@ -16,15 +16,14 @@
data () {
const _this = this
return {
queryNew: undefined,
annotations: undefined,
query: undefined,
video: undefined,
timeline: undefined,
metadata: undefined,
config: {
pagination: {
sortBy: 'date',
descending: true
sortBy: 'starting_point',
descending: false
},
columns: [
{
......@@ -61,7 +60,6 @@
if (this.$route.params.id) {
this.$q.loading.show()
await this.getVideo()
await this.getAnnotations()
this.$q.loading.hide()
}
},
......@@ -72,38 +70,12 @@
if (this.video) {
this.metadata = await this.$store.dispatch('metadata/get', this.video)
}
this.queryNew = {
this.query = {
'target.id': this.timeline.id,
'target.type': constants.MAP_TYPE_TIMELINE,
'target.selector.value': { $gte: this.video.target.selector.value },
'body.type': { $in: ['TextualBody', 'VocabularyEntry'] }
}
// let data = await this.$store.dispatch('annotations/find', this.query)
// console.log(data)
},
async getAnnotations () {
const
_this = this,
query = {
'target.id': this.timeline.id,
'target.type': constants.MAP_TYPE_TIMELINE,
'target.selector.value': { $gte: this.video.target.selector.value },
'body.type': { $in: ['TextualBody', 'VocabularyEntry'] }
}
if (this.metadata.duration) {
const start = DateTime.fromISO(this.video.target.selector.value, { setZone: true })
query['target.selector.value']['$lte'] = start.plus(this.metadata.duration * 1000).toISO()
}
const results = await this.$store.dispatch('annotations/find', query)
for (let item of results.items) {
if (item.body.type === 'VocabularyEntry') {
const entry = await this.$vocabularies.getEntry(item.body.source.id)
item.body.value = entry.value
}
}
if (results && Array.isArray(results.items)) {
_this.annotations = results.items.sort(this.$sort.onRef)
}
}
}
}
......
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