diff --git a/app/javascript/packs/vue/repository_filter.js b/app/javascript/packs/vue/repository_filter.js index 055dec525..16d589d4a 100644 --- a/app/javascript/packs/vue/repository_filter.js +++ b/app/javascript/packs/vue/repository_filter.js @@ -32,11 +32,11 @@ window.initRepositoryFilter = () => { }, computed: { filtersJSON() { - return this.filters.map((f) => { + return this.filters.filter((f) => !f.isBlank).map((f) => { return { repository_column_id: f.column.id, - operator: f.operator, - parameters: { ...f.data, isBlank: f.isBlank } + operator: f.data.operator, + parameters: f.data.parameters } }); } diff --git a/app/javascript/vue/repository_filter/filters/repositoryAssetValue.vue b/app/javascript/vue/repository_filter/filters/repositoryAssetValue.vue index a4526a62e..3192069f8 100644 --- a/app/javascript/vue/repository_filter/filters/repositoryAssetValue.vue +++ b/app/javascript/vue/repository_filter/filters/repositoryAssetValue.vue @@ -12,8 +12,7 @@ type="text" name="value" v-model="value" - :placeholder="i18n.t('repositories.show.repository_filter.enter_text')" - @input="updateFilter" + :placeholder="i18n.t('repositories.show.repository_filter.filters.types.RepositoryAssetValue.input_placeholder')" /> @@ -43,6 +42,10 @@ watch: { operator() { if(this.operator !== 'file_contains') this.value = ''; + }, + value() { + this.parameters = this.operator === 'file_contains' ? { text: this.value } : {} + this.updateFilter(); } }, components: { diff --git a/app/javascript/vue/repository_filter/filters/repositoryChecklistValue.vue b/app/javascript/vue/repository_filter/filters/repositoryChecklistValue.vue index 37511da81..088ace6ff 100644 --- a/app/javascript/vue/repository_filter/filters/repositoryChecklistValue.vue +++ b/app/javascript/vue/repository_filter/filters/repositoryChecklistValue.vue @@ -43,10 +43,15 @@ components: { DropdownSelector }, + watch: { + value() { + this.parameters = { item_ids: this.value }; + this.updateFilter(); + } + }, methods: { updateValue(value) { this.value = value - this.updateFilter(); } }, computed: { diff --git a/app/javascript/vue/repository_filter/filters/repositoryDateTimeValue.vue b/app/javascript/vue/repository_filter/filters/repositoryDateTimeValue.vue index 7dc60b37d..73bf5d7eb 100644 --- a/app/javascript/vue/repository_filter/filters/repositoryDateTimeValue.vue +++ b/app/javascript/vue/repository_filter/filters/repositoryDateTimeValue.vue @@ -30,6 +30,7 @@ mixins: [FilterMixin, DateTimeFilterMixin], data() { return { + timeType: 'datetime', operators: [ { value: 'today', label: this.i18n.t('repositories.show.repository_filter.filters.operators.today') }, { value: 'yesterday', label: this.i18n.t('repositories.show.repository_filter.filters.operators.yesterday') }, @@ -55,6 +56,12 @@ DropdownSelector, DateTimePicker }, + watch: { + value() { + this.parameters = this.value; + this.updateFilter(); + } + }, methods: { formattedDate(date) { return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}` diff --git a/app/javascript/vue/repository_filter/filters/repositoryDateValue.vue b/app/javascript/vue/repository_filter/filters/repositoryDateValue.vue index ba826ff12..df625eab7 100644 --- a/app/javascript/vue/repository_filter/filters/repositoryDateValue.vue +++ b/app/javascript/vue/repository_filter/filters/repositoryDateValue.vue @@ -30,6 +30,7 @@ mixins: [FilterMixin, DateTimeFilterMixin], data() { return { + timeType: 'date', operators: [ { value: 'today', label: this.i18n.t('repositories.show.repository_filter.filters.operators.today') }, { value: 'yesterday', label: this.i18n.t('repositories.show.repository_filter.filters.operators.yesterday') }, @@ -55,6 +56,12 @@ DropdownSelector, DateTimePicker }, + watch: { + value() { + this.parameters = this.value; + this.updateFilter(); + } + }, methods: { formattedDate(date) { return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}` diff --git a/app/javascript/vue/repository_filter/filters/repositoryListValue.vue b/app/javascript/vue/repository_filter/filters/repositoryListValue.vue index e6982f995..a6c71d04c 100644 --- a/app/javascript/vue/repository_filter/filters/repositoryListValue.vue +++ b/app/javascript/vue/repository_filter/filters/repositoryListValue.vue @@ -42,10 +42,15 @@ components: { DropdownSelector }, + watch: { + value() { + this.parameters = { item_ids: this.value }; + this.updateFilter(); + } + }, methods: { updateValue(value) { - this.value = value - this.updateFilter(); + this.value = value; } }, computed: { diff --git a/app/javascript/vue/repository_filter/filters/repositoryMyModuleValue.vue b/app/javascript/vue/repository_filter/filters/repositoryMyModuleValue.vue index 8c2ce4ac6..30adb3a89 100644 --- a/app/javascript/vue/repository_filter/filters/repositoryMyModuleValue.vue +++ b/app/javascript/vue/repository_filter/filters/repositoryMyModuleValue.vue @@ -42,10 +42,15 @@ components: { DropdownSelector }, + watch: { + value() { + this.parameters = { my_module_ids: this.value }; + this.updateFilter(); + } + }, methods: { updateValue(value) { - this.value = value - this.updateFilter(); + this.value = value; } }, computed: { diff --git a/app/javascript/vue/repository_filter/filters/repositoryNumberValue.vue b/app/javascript/vue/repository_filter/filters/repositoryNumberValue.vue index 41fdfd519..e4517cce0 100644 --- a/app/javascript/vue/repository_filter/filters/repositoryNumberValue.vue +++ b/app/javascript/vue/repository_filter/filters/repositoryNumberValue.vue @@ -8,7 +8,6 @@ />