Skip to content

Commit

Permalink
perf(filters): add additional presets to state filter (#1836)
Browse files Browse the repository at this point in the history
Co-authored-by: dinesh reddy j <dinesh.reddy@juspay.in>
  • Loading branch information
jagadam97 and dinesh reddy j authored Aug 8, 2024
1 parent 422cee2 commit 32b104f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
27 changes: 25 additions & 2 deletions src/components/Navbar/SideWidgets/FilterSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,27 @@ function selectActive() {
]
}
function selectError() {
statusFilter.value = [
TorrentState.ERROR,
TorrentState.MISSING_FILES,
TorrentState.UNKNOWN
]
}
function selectOffline() {
statusFilter.value = [
TorrentState.ERROR,
TorrentState.MISSING_FILES,
TorrentState.UNKNOWN,
TorrentState.MOVING,
TorrentState.DL_PAUSED,
TorrentState.UL_PAUSED,
TorrentState.CHECKING_DISK,
TorrentState.CHECKING_RESUME_DATA
]
}
function selectAllCategories() {
categoryFilter.value = []
}
Expand All @@ -57,7 +78,7 @@ function selectAllTrackers() {
<v-list class="pb-0 inherit-fg">
<v-list-item class="px-0 pb-3">
<v-list-item-title class="px-0 text-uppercase ml-1 font-weight-light text-subtitle-2">
{{ t('navbar.side.filters.state') }}
{{ t('navbar.side.filters.state.title') }}
</v-list-item-title>
<v-select
v-model="statusFilter"
Expand All @@ -71,7 +92,9 @@ function selectAllTrackers() {
variant="solo">
<template v-slot:prepend-item>
<v-list-item :title="$t('common.disable')" @click="selectAllStatuses" />
<v-list-item :title="$t('common.active')" @click="selectActive" />
<v-list-item :title="$t('navbar.side.filters.state.active')" @click="selectActive" />
<v-list-item :title="$t('navbar.side.filters.state.error')" @click="selectError" />
<v-list-item :title="$t('navbar.side.filters.state.offline')" @click="selectOffline" />
<v-divider />
</template>
<template v-slot:selection="{ item, index }">
Expand Down
8 changes: 6 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"_comments": "Content generated by Tolgee app. NEVER EDIT MANUALLY AS IT WILL BE OVERRIDDEN",
"common": {
"active": "Active",
"cancel": "Cancel",
"close": "Close",
"delete": "Delete",
Expand Down Expand Up @@ -512,7 +511,12 @@
"activeFilter": "{n} filters active",
"category": "Category Filter",
"disabled": "(Disabled)",
"state": "Torrent State Filter",
"state":{
"title": "Torrent State Filter",
"active": "Active",
"error": "Error",
"offline": "Offline"
},
"tag": "Tag Filter",
"tracker": "Tracker Filter",
"uncategorized": "(Uncategorized)",
Expand Down

0 comments on commit 32b104f

Please sign in to comment.