Commit 31f1db52 authored by Anton's avatar Anton
Browse files

Merge branch 'release_2_2' of...

Merge branch 'release_2_2' of gitlab.rlp.net:motionbank/applications/systems-frontend into release_2_2
parents c3d0e408 5a702253
Pipeline #69250 passed with stage
in 3 minutes and 3 seconds
...@@ -380,7 +380,7 @@ module ...@@ -380,7 +380,7 @@ module
lots of annotations need to be loaded lots of annotations need to be loaded
- Delete map no longer fails when encountering access - Delete map no longer fails when encountering access
denied errors (still suffers from denied errors (still suffers from
[#119](https://gitlab.rlp.net/motionbank/systems-frontend/issues/119)) [#119](https://gitlab.rlp.net/motionbank/applications/systems-frontend/issues/119))
### Removed ### Removed
...@@ -435,7 +435,7 @@ AnnotationList) ...@@ -435,7 +435,7 @@ AnnotationList)
(works from version 15+) (works from version 15+)
- Perform date related queries to MongoDB with - Perform date related queries to MongoDB with
properly formatted timezones (see: properly formatted timezones (see:
[#106](https://gitlab.rlp.net/motionbank/systems-frontend/issues/106)) [#106](https://gitlab.rlp.net/motionbank/applications/systems-frontend/issues/106))
### Changed ### Changed
...@@ -518,25 +518,25 @@ of a video cannot be retrieved ...@@ -518,25 +518,25 @@ of a video cannot be retrieved
- Start proper versioning at 1.0.0 - Start proper versioning at 1.0.0
[Unreleased]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v2.2.0...release_2_2 [Unreleased]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v2.2.0...release_2_2
[2.2.0]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v2.1.2...v2.2.0 [2.2.0]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v2.1.2...v2.2.0
[2.1.2]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v2.1.1...v2.1.2 [2.1.2]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v2.1.1...v2.1.2
[2.1.1]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v2.1.0...v2.1.1 [2.1.1]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v2.1.0...v2.1.1
[2.1.0]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v2.0.0...v2.1.0 [2.1.0]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v2.0.0...v2.1.0
[2.0.0]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.10...v2.0.0 [2.0.0]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.10...v2.0.0
[1.3.10]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.9...v1.3.10 [1.3.10]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.9...v1.3.10
[1.3.9]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.8...v1.3.9 [1.3.9]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.8...v1.3.9
[1.3.8]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.7...v1.3.8 [1.3.8]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.7...v1.3.8
[1.3.7]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.6...v1.3.7 [1.3.7]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.6...v1.3.7
[1.3.6]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.5...v1.3.6 [1.3.6]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.5...v1.3.6
[1.3.5]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.4...v1.3.5 [1.3.5]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.4...v1.3.5
[1.3.4]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.3...v1.3.4 [1.3.4]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.3...v1.3.4
[1.3.3]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.2...v1.3.3 [1.3.3]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.2...v1.3.3
[1.3.2]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.1...v1.3.2 [1.3.2]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.1...v1.3.2
[1.3.1]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.3.0...v1.3.1 [1.3.1]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.3.0...v1.3.1
[1.3.0]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.2.1...v1.3.0 [1.3.0]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.2.1...v1.3.0
[1.2.1]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.2.0...v1.2.1 [1.2.1]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.2.0...v1.2.1
[1.2.0]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.1.1...v1.2.0 [1.2.0]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.1.1...v1.2.0
[1.1.1]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.1.0...v1.1.1 [1.1.1]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.1.0...v1.1.1
[1.1.0]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/v1.0.0...v1.1.0 [1.1.0]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/v1.0.0...v1.1.0
[1.0.0]: https://gitlab.rlp.net/motionbank/systems-frontend/compare/initial...v1.0.0 [1.0.0]: https://gitlab.rlp.net/motionbank/applications/systems-frontend/compare/initial...v1.0.0
...@@ -64,6 +64,21 @@ ...@@ -64,6 +64,21 @@
} }
catch (e) { this.media[i].metadata = {} } catch (e) { this.media[i].metadata = {} }
} }
// const aggs = {
// annotations_per_minute: {
// date_histogram: {
// field: 'target.selector._valueMillis',
// calendar_interval: '1m'
// }
// }
// }
// const query = {
// match: { 'target.id': this.map.id }
// }
// const aggregations = await this.$store.dispatch('search/query', { index: 'annotations', aggs, query })
// console.debug('Aggregations', aggregations)
this.$q.loading.hide() this.$q.loading.hide()
}, },
computed: { computed: {
...@@ -75,12 +90,11 @@ ...@@ -75,12 +90,11 @@
async search () { async search () {
this.$q.loading.show() this.$q.loading.show()
const query = { const query = {
'target.id': this.map.id, match: { 'body.value': this.query }
'body.type': 'TextualBody',
'body.value': RegExp(`.*${this.query}.*`, 'ig')
} }
const result = await this.$store.dispatch('annotations/find', query) const result = await this.$store.dispatch('search/query', { index: 'annotations', query })
this.results = result && Array.isArray(result.items) ? result.items.sort(this.$sort.onRef) : [] this.results = (result && Array.isArray(result.hits) ? result.hits.sort(this.$sort.onRef) : [])
.map(hit => hit._source)
this.$q.loading.hide() this.$q.loading.hide()
}, },
formatDate (millis) { formatDate (millis) {
...@@ -94,7 +108,7 @@ ...@@ -94,7 +108,7 @@
videoEnd = videoStart.plus(video.metadata.duration * 1000) videoEnd = videoStart.plus(video.metadata.duration * 1000)
if (annoTime >= videoStart && annoTime < videoEnd) return video if (annoTime >= videoStart && annoTime < videoEnd) return video
} }
return {} return { annotation: {}, metadata: {} }
} }
} }
} }
......
...@@ -30,7 +30,8 @@ import { ...@@ -30,7 +30,8 @@ import {
queue, queue,
swimLane, swimLane,
vocabularies, vocabularies,
settings settings,
search
} from './modules' } from './modules'
import mediaFactory from './modules/media' import mediaFactory from './modules/media'
...@@ -115,7 +116,8 @@ const modules = { ...@@ -115,7 +116,8 @@ const modules = {
queue, queue,
swimLane, swimLane,
vocabularies, vocabularies,
settings settings,
search
} }
for (let key in mobaApiModules) { for (let key in mobaApiModules) {
if (mobaApiModules[key]) modules[key] = mobaApiModules[key] if (mobaApiModules[key]) modules[key] = mobaApiModules[key]
......
...@@ -10,6 +10,7 @@ import files from './files' ...@@ -10,6 +10,7 @@ import files from './files'
import queue from './queue' import queue from './queue'
import swimLane from './swim-lane' import swimLane from './swim-lane'
import settings from './settings' import settings from './settings'
import search from './search'
import vocabularies from './vocabularies' import vocabularies from './vocabularies'
export { export {
...@@ -25,5 +26,6 @@ export { ...@@ -25,5 +26,6 @@ export {
queue, queue,
swimLane, swimLane,
settings, settings,
search,
vocabularies vocabularies
} }
const axios = require('axios')
const search = {
namespaced: true,
state: {},
actions: {
async query (context, { index, query, aggs }) {
const config = {
headers: {
Authorization: `${this.$router.app.$auth.tokenType} ${this.$router.app.$auth.token}`
}
}
let result = await axios.post(`${process.env.API_HOST}/search/${index}`, { query, aggs }, config)
return result.data
}
}
}
export default search
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