Skip to content

Commit

Permalink
Fix history filter (develop) (#11661)
Browse files Browse the repository at this point in the history
  • Loading branch information
medariox authored Mar 18, 2024
1 parent e388137 commit aed24cf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions medusa/server/api/v2/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get(self, series_slug, path_param):
'date': 'date',
'action': 'action',
'statusname': 'action',
'provider.id': 'provider',
'providerId': 'provider',
'clientstatus': 'client_status',
'size': 'size',
'quality': 'quality'
Expand All @@ -95,7 +95,7 @@ def get(self, series_slug, path_param):

if filter is not None and filter.get('columnFilters'):
size = filter['columnFilters'].pop('size', None)
provider = filter['columnFilters'].pop('provider.id', None)
provider = filter['columnFilters'].pop('providerId', None)
resource = filter['columnFilters'].pop('resource', None)

if size:
Expand Down
15 changes: 14 additions & 1 deletion themes-default/slim/src/components/history-detailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@
<input placeholder="Resource" class="'form-control input-sm vgt-input" @input="updateResource">
</span>

<span v-else-if="column.field === 'providerId'">
<input placeholder="Provider | Group" class="'form-control input-sm vgt-input" @input="updateProvider">
</span>

<span v-else-if="column.field === 'quality'">
<select class="form-control form-control-inline input-sm vgt-select" @input="updateQualityFilter">
<option value="">Filter Quality</option>
Expand Down Expand Up @@ -204,7 +208,7 @@ export default {
hidden: getCookie('Quality')
}, {
label: 'Provider',
field: 'provider.id',
field: 'providerId',
filterOptions: {
enabled: true
},
Expand Down Expand Up @@ -374,6 +378,15 @@ export default {
this.remoteHistory.filter.columnFilters.resource = resource;
this.loadItemsDebounced();
},
updateProvider(provider) {
provider = provider.currentTarget.value;
if (!this.remoteHistory.filter) {
this.remoteHistory.filter = { columnFilters: {} };
}
this.remoteHistory.filter.columnFilters.providerId = provider;
this.loadItemsDebounced();
},
// Load items is what brings back the rows from server
loadItems() {
const { getHistory } = this;
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/src/store/modules/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const actions = {
}

if (filter) {
params.filter = filter;
params.filter = JSON.stringify(filter);
}

if (showSlug) {
Expand Down

0 comments on commit aed24cf

Please sign in to comment.