diff --git a/vue-client/src/components/search/search-form.vue b/vue-client/src/components/search/search-form.vue
index c1e0dd91e2..2b5047b42d 100644
--- a/vue-client/src/components/search/search-form.vue
+++ b/vue-client/src/components/search/search-form.vue
@@ -14,6 +14,10 @@ export default {
default: 'libris',
type: String,
},
+ searchTool: {
+ default: '',
+ type: String,
+ },
},
data() {
return {
@@ -51,13 +55,18 @@ export default {
this.helpToggled = !this.helpToggled;
},
composeQuery() {
- return buildQueryString(this.searchPerimeter === 'libris'
+ return buildQueryString(this.searchPerimeter === 'libris' || this.searchTool === 'changes'
? this.mergedParams
: { q: this.searchPhrase, databases: this.status.remoteDatabases.join() });
},
doSearch() {
this.helpToggled = false;
- const path = `/search/${this.searchPerimeter}?${this.composeQuery()}`;
+ let path = '';
+ if (this.searchPerimeter === 'libris' || this.searchPerimeter === 'remote') {
+ path = `/search/${this.searchPerimeter}?${this.composeQuery()}`;
+ } else if (this.searchTool === 'changes') {
+ path = `${this.$route.path}?${this.composeQuery()}`;
+ }
this.$router.push({ path });
},
clearInputs() {
@@ -98,7 +107,7 @@ export default {
return PropertyMappings[0];
},
setType() {
- if (this.$route.params.perimeter === 'remote') {
+ if (this.$route.params.perimeter === 'remote' || this.searchTool === 'changes') {
return this.activeSearchType; // Don't change while remote searching
}
const performedQuery = cloneDeep(this.$route.query);
@@ -183,7 +192,13 @@ export default {
return this.searchPhrase.length > 0;
},
inputPlaceholder() {
- return this.searchPerimeter === 'remote' ? 'ISBN eller valfria sökord' : 'Search';
+ if (this.searchPerimeter === 'remote') {
+ return 'ISBN eller valfria sökord';
+ }
+ if (this.searchTool === 'changes') {
+ return 'Sök bland ändringar'; // TODO: i18n
+ }
+ return 'Search';
},
composedSearchParam() { // pair current search param with searchphrase
let composed = {};
@@ -197,7 +212,15 @@ export default {
return composed;
},
composedTypes() {
- return this.activeSearchType && this.activeSearchType.length > 0 ? { '@type': this.activeSearchType } : { '@type': null };
+ let type = null;
+ if (this.activeSearchType && this.activeSearchType.length > 0) {
+ if (this.searchPerimeter === 'libris') {
+ type = this.activeSearchType;
+ } else if (this.searchTool === 'changes') {
+ type = 'AdministrativeNotice';
+ }
+ }
+ return { '@type': type };
},
prefSort() {
if (this.user && this.user.settings.sort) {
@@ -238,6 +261,12 @@ export default {
this.resetSearchParam();
}
},
+ searchTool(newVal, oldVal) {
+ if (newVal !== oldVal && newVal === 'changes') {
+ this.clearInputs();
+ this.doSearch();
+ }
+ },
searchPerimeter(newVal, oldVal) {
if (newVal !== oldVal) {
this.$nextTick(() => {
@@ -337,7 +366,7 @@ export default {
+ :class="{ 'in-remote': searchPerimeter === 'remote' || searchTool === 'changes' }" tabindex="0" v-show="hasInput" @keyup.enter="clearInputs()" @click="clearInputs()">