Skip to content
Snippets Groups Projects
Commit 99eda7e1 authored by Manikanth Dindigala's avatar Manikanth Dindigala
Browse files

Merge branch 'feature/#285-search-header' into 'develop'

feat/#285: Implementing of search in header and navigating to home or search page accordingly

See merge request !31
parents 260ae75c a32156a2
No related branches found
No related tags found
1 merge request!31feat/#285: Implementing of search in header and navigating to home or search page accordingly
Pipeline #215865 passed
......@@ -75,6 +75,16 @@ export default {
keyboardLayouts: ['arabic', 'syriac']
}
},
watch:{
'$route.query': {
handler(query) {
if (query.searchTerm) {
this.input = query.searchTerm;
}
},
immediate: true,
},
},
methods: {
emitSearch() {
this.$emit('search', this.input);
......
......@@ -28,6 +28,16 @@ export default {
size: 10
}
},
watch:{
'$route.query': {
handler(query) {
if (query.searchTerm) {
this.onSearchInput(query.searchTerm);
}
},
immediate: true,
},
},
methods: {
onSearchInput(query) {
this.query = query;
......@@ -43,7 +53,7 @@ export default {
if (searchResponse) {
const items = searchResponse.hits?.hits;
if (items) {
this.items = items;
this.items = items.map(x=>({...x, searchTerm: value}));
}
}
}
......
......@@ -64,7 +64,7 @@ export default {
} else if (item.lang === 'syc') {
language = 'syriac'
}
return this.viewerBaseUrl + '/' + language + '/#/?itemurl=' + item.item
return `${this.viewerBaseUrl}/${language}/#/?itemurl=${item.item}&source=external&searchTerm=${item.searchTerm}`;
},
},
watch: {
......
import {baseUrlViewer} from "./constants";
export default [
{ title: 'Syriac Texts', to: baseUrlViewer + '/syriac' },
{ title: 'Arabic and Kashuni Texts', to: baseUrlViewer + '/arabic-karshuni' },
{ title: 'Syriac Texts', to: baseUrlViewer + '/syriac/?source=external' },
{ title: 'Arabic and Kashuni Texts', to: baseUrlViewer + '/arabic-karshuni/?source=external' },
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment