Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Fixed `reset` not clearing query on subscriber search UI

Kailash Nadh7ead052054ed
diff --git a/frontend/src/components/EmptyPlaceholder.vue b/frontend/src/components/EmptyPlaceholder.vue
index ff5c1fd2..0500e118 100644
--- a/frontend/src/components/EmptyPlaceholder.vue
+++ b/frontend/src/components/EmptyPlaceholder.vue
@@ -4,7 +4,7 @@
<p>
<b-icon :icon="!icon ? 'plus' : icon" size="is-large" />
</p>
- <p>{{ !label ? 'Nothing here yet' : label }}</p>
+ <p>{{ !label ? 'Nothing here' : label }}</p>
</div>
</section>
</template>
diff --git a/frontend/src/views/Subscribers.vue b/frontend/src/views/Subscribers.vue
index 9936f94c..36986094 100644
--- a/frontend/src/views/Subscribers.vue
+++ b/frontend/src/views/Subscribers.vue
@@ -20,7 +20,7 @@
<form @submit.prevent="querySubscribers">
<div>
<b-field grouped>
- <b-input @input="onSimpleQueryInput"
+ <b-input @input="onSimpleQueryInput" v-model="queryInput"
placeholder="E-mail or name" icon="account-search-outline" ref="query"
:disabled="isSearchAdvanced"></b-input>
<b-button native-type="submit" type="is-primary" icon-left="account-search-outline"
@@ -52,7 +52,7 @@
<div class="buttons">
<b-button native-type="submit" type="is-primary"
icon-left="account-search-outline">Query</b-button>
- <b-button @click.prevent="toggleAdvancedSearch" icon-left="close">Reset</b-button>
+ <b-button @click.prevent="toggleAdvancedSearch" icon-left="cancel">Reset</b-button>
</div>
</div><!-- advanced query -->
</div>
@@ -208,6 +208,8 @@ export default Vue.extend({
all: false,
},
+ queryInput: '',
+
// Query params to filter the getSubscribers() API call.
queryParams: {
// Search query expression.
@@ -232,7 +234,12 @@ export default Vue.extend({
// Toggling to simple search.
if (!this.isSearchAdvanced) {
this.$nextTick(() => {
+ this.queryInput = '';
+ this.queryParams.queryExp = '';
+ this.queryParams.page = 1;
this.$refs.query.focus();
+
+ this.querySubscribers();
});
return;
}