-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from source-data/EEB13/use-new-endpoint
EEB 13: Use the new endpoint, overall functionality improvements
- Loading branch information
Showing
20 changed files
with
293 additions
and
801 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 30 additions & 18 deletions
48
frontend/src/components/filtering/by-simple-search-query.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,43 @@ | ||
<template lang="pug"> | ||
v-text-field( | ||
v-model="query" | ||
:loading="loadingRecords" | ||
placeholder="keywords, authors, doi" | ||
prepend-icon="mdi-magnify" | ||
hide-details | ||
@keyup.enter="onSubmit" | ||
) | ||
v-card(flat).flex-grow-1 | ||
v-card-title Search for terms | ||
v-card-text.d-flex.d-flex-row.align-center | ||
v-text-field( | ||
:value="currentQuery" v-on:keyup.enter="currentQuery = $event.target.value" | ||
:loading="loadingRecords" | ||
placeholder="keywords, authors, doi" | ||
prepend-icon="mdi-magnify" | ||
hide-details | ||
outlined | ||
).mt-0.pt-0 | ||
v-tooltip(bottom transition="fade-transition") | ||
template(v-slot:activator="{ on, hover, attrs }") | ||
v-btn(text v-bind="attrs" v-on="on" @click="currentQuery = ''" icon :disabled="query === ''") | ||
v-icon(dense) mdi-close-circle | ||
span Clear search | ||
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex' | ||
export default { | ||
data: function() { | ||
return { | ||
query: '' | ||
} | ||
}, | ||
computed: { | ||
...mapState('fulltextSearch', ['loadingRecords']) | ||
...mapState('byFilters', ['query', 'loadingRecords']), | ||
currentQuery: { | ||
set(value) { | ||
this.$vuetify.goTo(0); | ||
this.$store.commit("byFilters/setQuery", value); | ||
}, | ||
get() { | ||
return this.query | ||
} | ||
} | ||
}, | ||
methods: { | ||
onSubmit() { | ||
this.$store.dispatch('fulltextSearch/search', this.query).then( | ||
() => {this.$store.dispatch('highlights/listByCurrent', 'fulltextSearch')} | ||
) | ||
}, | ||
} | ||
methods: {} | ||
} | ||
</script> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.