Skip to content

Commit

Permalink
Applying new fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CarliPinell committed Dec 24, 2024
1 parent a1abe93 commit f137c04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
6 changes: 1 addition & 5 deletions resources/js/inbox-rules/components/InboxRuleButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<b-button size="sm"
variant="light"
class="inbox-rule-buttons-border inbox-rule-buttons-font"
@click="callResetFilters">
@click="$emit('reset-filters')">
<img src="/img/eraser-fill.svg" :alt="$t('Clear unsaved filters')"/>
{{ $t('Clear unsaved filters') }}
</b-button>
Expand Down Expand Up @@ -106,12 +106,8 @@
});
},
methods: {
callResetFilters() {
this.$emit('reset-filters');
},
onSelect(option) {
this.selectedOption = option;
this.callResetFilters();
this.$emit('saved-search-id-changed', option.value);
this.showMenu(false);
},
Expand Down
15 changes: 11 additions & 4 deletions resources/js/inbox-rules/components/InboxRuleFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@
resetFilters() {
this.savedSearchAdvancedFilter = _.cloneDeep(this.originalSavedSearchAdvancedFilter);
},
resetSavedSearch() {
this.loadSavedSearch();
},
defaultTaskFilters() {
return {
order: {by: 'id', direction: 'desc'},
Expand Down Expand Up @@ -199,6 +202,7 @@
} else {
filter.filters = [this.userIdFilter()];
}
return filter;
},
userIdFilter() {
Expand Down Expand Up @@ -238,12 +242,15 @@
this.columns = _.cloneDeep(cols);
this.defaultColumns = _.cloneDeep(cols);
}
const advancedFilter = response.data.advanced_filter ?? this.defaultSavedSearchFilters();
const processedFilter = this.addRequiredSavedSearchFilters(advancedFilter);
if (this.savedSearchAdvancedFilter === null) {
const advancedFilter = response.data.advanced_filter ?? this.defaultSavedSearchFilters();
this.originalSavedSearchAdvancedFilter = _.cloneDeep(this.savedSearchAdvancedFilter);
this.savedSearchAdvancedFilter = this.addRequiredSavedSearchFilters(advancedFilter);
this.originalSavedSearchAdvancedFilter = _.cloneDeep(processedFilter);
}
this.savedSearchAdvancedFilter = processedFilter;
this.ready = true;
});
Expand Down

0 comments on commit f137c04

Please sign in to comment.