Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix history filter (develop) #11661

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading