Fixed broken logging

This commit is contained in:
Eliot Berriot 2019-06-24 15:30:17 +02:00
parent 32de134e4a
commit 68b21d706c
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
8 changed files with 121 additions and 13 deletions

View file

@ -6,6 +6,14 @@
<label><translate translate-context="Content/Search/Input.Label/Noun">Search</translate></label>
<input name="search" type="text" v-model="search" :placeholder="labels.searchPlaceholder" />
</div>
<div class="field">
<label><translate translate-context="Content/Moderation/*/Adjective">Is present on allow-list</translate></label>
<select class="ui dropdown" v-model="allowed">
<option :value="null"><translate translate-context="*/*/*">All</translate></option>
<option :value="true"><translate translate-context="*/*/*">Yes</translate></option>
<option :value="false"><translate translate-context="*/*/*">No</translate></option>
</select>
</div>
<div class="field">
<label><translate translate-context="Content/Search/Dropdown.Label/Noun">Ordering</translate></label>
<select class="ui dropdown" v-model="ordering">
@ -93,7 +101,8 @@ import TranslationsMixin from '@/components/mixins/Translations'
export default {
mixins: [OrderingMixin, TranslationsMixin],
props: {
filters: {type: Object, required: false}
filters: {type: Object, required: false},
allowListEnabled: {type: Boolean, default: false},
},
components: {
Pagination,
@ -108,6 +117,7 @@ export default {
page: 1,
paginateBy: 50,
search: '',
allowed: null,
orderingDirection: defaultOrdering.direction || '+',
ordering: defaultOrdering.field,
orderingOptions: [
@ -124,12 +134,16 @@ export default {
},
methods: {
fetchData () {
let params = _.merge({
let baseFilters = {
'page': this.page,
'page_size': this.paginateBy,
'q': this.search,
'ordering': this.getOrderingAsString()
}, this.filters)
'ordering': this.getOrderingAsString(),
}
if (this.allowed !== null) {
baseFilters.allowed = this.allowed
}
let params = _.merge(baseFilters, this.filters)
let self = this
self.isLoading = true
self.checked = []
@ -179,6 +193,9 @@ export default {
page () {
this.fetchData()
},
allowed () {
this.fetchData()
},
ordering () {
this.fetchData()
},