diff --git a/webapp/frontend/src/components/common/ClinicalText.vue b/webapp/frontend/src/components/common/ClinicalText.vue index 308d0a47..37fdbc31 100644 --- a/webapp/frontend/src/components/common/ClinicalText.vue +++ b/webapp/frontend/src/components/common/ClinicalText.vue @@ -36,8 +36,18 @@ export default { ents: Array, loading: String, currentEnt: Object, - currentRelStartEnt: Object, - currentRelEndEnt: Object, + currentRelStartEnt: { + default () { + return {} + }, + type: Object, + }, + currentRelEndEnt: { + default () { + return {} + }, + type: Object, + }, addAnnos: Boolean }, data () { @@ -73,9 +83,9 @@ export default { styleClass = `highlight-task-${btnIndex}` } - if ((this.ents[i] === this.currentRelStartEnt) || (this.ents[i].id === (this.currentRelStartEnt || {}).id)) { + if (this.ents[i] === this.currentRelStartEnt) { styleClass += ' current-rel-start' - } else if ((this.ents[i] === this.currentRelEndEnt) || (this.ents[i].id === (this.currentRelEndEnt || {}).id)) { + } else if (this.ents[i] === this.currentRelEndEnt) { styleClass += ' current-rel-end' } diff --git a/webapp/frontend/src/components/common/ConceptSummary.vue b/webapp/frontend/src/components/common/ConceptSummary.vue index 791ea06f..d6c1c726 100644 --- a/webapp/frontend/src/components/common/ConceptSummary.vue +++ b/webapp/frontend/src/components/common/ConceptSummary.vue @@ -200,22 +200,6 @@ export default { }) }, deep: true - }, - 'project': { - handler () { - let that = this - if (this.project.cdb_search_filter.length > 0) { - this.$http.get(`/api/concept-dbs/${this.project.cdb_search_filter[0]}/`).then(resp => { - if (resp.data) { - // this is a bit hacky - backend should just return the correct CDB search filter - that.$set(that, 'searchFilterDBIndex', `${resp.data.name}_id_${that.project.cdb_search_filter}`) - this.fetchDetail(this.selectedEnt, this.searchFilterDBIndex, () => { - that.cleanProps() - }) - } - }) - } - } } } } diff --git a/webapp/frontend/src/views/Demo.vue b/webapp/frontend/src/views/Demo.vue index 7d305670..2a3c28ce 100644 --- a/webapp/frontend/src/views/Demo.vue +++ b/webapp/frontend/src/views/Demo.vue @@ -18,21 +18,17 @@ -
- - -
-
@@ -57,13 +53,13 @@ export default { projects: [], selectedProject: {}, cuiFilters: '', - typeIDsFilters: '', ents: [], currentEnt: {}, annotatedText: '', loadingMsg: null, task: TASK_NAME, - taskValues: VALUES + taskValues: VALUES, + searchFilterDBIndex: null } }, created () { @@ -89,7 +85,6 @@ export default { project_id: this.selectedProject.id, message: this.exampleText, cuis: this.cuiFilters, - tuis: this.tuiFilters } this.loadingMsg = 'Annotating Text...' this.$http.post('/api/annotate-text/', payload).then(resp => { @@ -105,6 +100,22 @@ export default { }, selectEntity (entIndex) { this.currentEnt = this.ents[entIndex] + }, + fetchCDBSearchIndex () { + if (this.selectedProject.cdb_search_filter.length > 0) { + this.$http.get(`/api/concept-dbs/${this.selectedProject.cdb_search_filter[0]}/`).then(resp => { + if (resp.data) { + this.searchFilterDBIndex = `${resp.data.name}_id_${this.selectedProject.cdb_search_filter}` + } + }) + } + } + }, + watch: { + 'selectedProject': { + handler () { + this.fetchCDBSearchIndex() + } } } }