Skip to content
Snippets Groups Projects
Commit 5ff05ba6 authored by moon's avatar moon
Browse files

#78: Fixed Condensate Search from the home page is...

#78: Fixed Condensate Search from the home page is buggy - Selecting a suggestion doesn't go to the respective detail page
parent 4de05d9d
No related branches found
No related tags found
No related merge requests found
......@@ -271,6 +271,8 @@ export default {
onSelect(item) {
if (item.type === 'protein') {
this.keyword = '(' + item.id + ')';
} else if (item.type === 'condensate') {
this.keyword = '(' + item.canonical_id + ')';
} else if (item.type === 'search') {
this.keyword = item.id.replace(/\#/g, '');
} else {
......@@ -331,10 +333,9 @@ export default {
// console.log(json.data);
const ret = _.uniqBy(_.map(json.data, (c) => {
if(c.gene_name) {
// console.log(c)
return {id: c.uniprot_id, species_name: c.species_name, gene_name: c.gene_name, name: c.name, type: 'protein'}
} else {
return {id: c.name, species_name: c.species_name, type: 'condensate'}
return {id: c.name, species_name: c.species_name, canonical_id: c.canonical_id, type: 'condensate'}
}
}), 'id');
......@@ -345,7 +346,6 @@ export default {
}
// console.log(ret);
return ret;
});
},
......
......@@ -140,7 +140,24 @@ export default {
vm.$refs.search.fetchProteinList(q, s);
}
} else if (t === 'condensate') {
vm.$refs.search.fetchCondensateList(q, s);
if(q.includes('('))
{
const id = /\((\S*)\)/gm.exec(q)[1]
const url = `/condensate/${id}`;
vm.$router.replace({
name: 'home',
query: {
q: '',
t: vm.pick,
s: s,
}})
// eslint-disable-next-line
vm.$router.push(url)
} else {
vm.$refs.search.fetchCondensateList(q, s);
}
}
// /* eslint-disable no-console */
// console.log(this.searchKeyword)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment