Add Ctrl+Enter search on the subscriber query exp box

This commit is contained in:
Kailash Nadh 2020-07-09 12:49:42 +05:30
parent ab8dbd8314
commit eae88c1add

View file

@ -35,6 +35,7 @@
<div v-if="isSearchAdvanced">
<b-field>
<b-input v-model="queryParams.queryExp"
@keydown.native.enter="onAdvancedQueryEnter"
type="textarea" ref="queryExp"
placeholder="subscribers.name LIKE '%user%' or subscribers.status='blacklisted'">
</b-input>
@ -43,8 +44,7 @@
<span class="is-size-6 has-text-grey">
Partial SQL expression to query subscriber attributes.{{ ' ' }}
<a href="https://listmonk.app/docs/querying-and-segmentation"
target="_blank" rel="noopener noreferrer">
Learn more <b-icon icon="link" size="is-small" />.
target="_blank" rel="noopener noreferrer"> Learn more.
</a>
</span>
</b-field>
@ -287,6 +287,13 @@ export default Vue.extend({
this.queryParams.queryExp = `(name ~* '${q}' OR email ~* '${q}')`;
},
// Ctrl + Enter on the advanced query searches.
onAdvancedQueryEnter(e) {
if (e.ctrlKey) {
this.querySubscribers();
}
},
// Search / query subscribers.
querySubscribers() {
this.$api.getSubscribers({