Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54e7e28046 |
+2
-2
File diff suppressed because one or more lines are too long
Binary file not shown.
+1
-1
File diff suppressed because one or more lines are too long
Binary file not shown.
-2
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
-1
File diff suppressed because one or more lines are too long
Vendored
BIN
Binary file not shown.
+2
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
+1
File diff suppressed because one or more lines are too long
Vendored
BIN
Binary file not shown.
@@ -51,7 +51,8 @@ export default {
|
||||
count: state => state.Search.count,
|
||||
noresults: state => state.Search.noresults,
|
||||
limit: state => state.Search.limit,
|
||||
searchId: state => state.Search.searchId
|
||||
searchId: state => state.Search.searchId,
|
||||
keys: state => state.Search.keys
|
||||
}),
|
||||
// items is a sparse array (pages placed by offset); drop the holes left by
|
||||
// pages that returned fewer results than the limit before rendering.
|
||||
@@ -59,7 +60,23 @@ export default {
|
||||
return this.items.filter(Boolean)
|
||||
}
|
||||
},
|
||||
// Title of the browser tab: the phrase searched (F3).
|
||||
metaInfo () {
|
||||
return {
|
||||
title: this.keys && this.keys.length ? this.keys.join(', ') : 'Base'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// terms of an URL: a JSON list, possibly malformed in an old or edited
|
||||
// link; never break the page for it (F3).
|
||||
parseTerms (value) {
|
||||
try {
|
||||
const terms = JSON.parse(value)
|
||||
return Array.isArray(terms) ? terms : []
|
||||
} catch (e) {
|
||||
return []
|
||||
}
|
||||
},
|
||||
...mapActions({
|
||||
newSearch: 'Search/newSearch',
|
||||
nextPage: 'Search/nextPage'
|
||||
@@ -87,7 +104,7 @@ export default {
|
||||
if (params.has('terms')) {
|
||||
console.log('Base created, has terms', params.get('terms'))
|
||||
// this.$store.commit('Search/setTerms', params.get('terms').split(','))
|
||||
this.$store.commit('Search/setTerms', JSON.parse(params.get('terms')))
|
||||
this.$store.commit('Search/setTerms', this.parseTerms(params.get('terms')))
|
||||
} else {
|
||||
this.$store.commit('Search/reSetTerms')
|
||||
}
|
||||
@@ -105,7 +122,7 @@ export default {
|
||||
// to.query.terms is a raw JSON string (see SearchForm.submit) and must be
|
||||
// parsed like in created(), otherwise getResults() double-encodes it and
|
||||
// the backend silently drops the terms (less relevant results).
|
||||
this.$store.commit('Search/setTerms', JSON.parse(to.query.terms))
|
||||
this.$store.commit('Search/setTerms', this.parseTerms(to.query.terms))
|
||||
}else{
|
||||
this.$store.commit('Search/reSetTerms')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user