Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
c1903607
authored
Jul 03, 2026
by
feitianbubu
Committed by
GitHub
Jul 03, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: persist channel status filter across page navigation (#5863)
parent
0565e626
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
web/default/src/features/channels/components/channels-table.tsx
+36
-3
No files found.
web/default/src/features/channels/components/channels-table.tsx
View file @
c1903607
...
...
@@ -18,7 +18,12 @@ For commercial licensing, please contact support@quantumnous.com
*/
import
{
useQuery
}
from
'@tanstack/react-query'
import
{
getRouteApi
}
from
'@tanstack/react-router'
import
type
{
OnChangeFn
,
SortingState
,
Row
}
from
'@tanstack/react-table'
import
type
{
ColumnFiltersState
,
OnChangeFn
,
SortingState
,
Row
,
}
from
'@tanstack/react-table'
import
{
Eye
,
EyeOff
}
from
'lucide-react'
import
{
useState
,
useMemo
,
useEffect
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
...
...
@@ -63,6 +68,7 @@ import { DataTableBulkActions } from './data-table-bulk-actions'
const
route
=
getRouteApi
(
'/_authenticated/channels/'
)
const
CHANNELS_COLUMN_VISIBILITY_STORAGE_KEY
=
'channels:column-visibility'
const
CHANNELS_VIEW_MODE_STORAGE_KEY
=
'channels:view-mode'
const
CHANNELS_STATUS_FILTER_STORAGE_KEY
=
'channel-status-filter'
const
CHANNEL_SORTABLE_COLUMNS
=
new
Set
<
ChannelSortBy
>
([
'id'
,
...
...
@@ -111,13 +117,40 @@ export function ChannelsTable() {
},
globalFilter
:
{
enabled
:
true
,
key
:
'filter'
},
columnFilters
:
[
{
columnId
:
'status'
,
searchKey
:
'status'
,
type
:
'array'
},
{
columnId
:
'status'
,
searchKey
:
'status'
,
type
:
'array'
,
deserialize
:
(
value
)
=>
{
if
(
value
!==
undefined
)
return
value
const
stored
=
localStorage
.
getItem
(
CHANNELS_STATUS_FILTER_STORAGE_KEY
)
return
stored
===
'enabled'
||
stored
===
'disabled'
?
[
stored
]
:
[]
},
},
{
columnId
:
'type'
,
searchKey
:
'type'
,
type
:
'array'
},
{
columnId
:
'group'
,
searchKey
:
'group'
,
type
:
'array'
},
{
columnId
:
'model'
,
searchKey
:
'model'
,
type
:
'string'
},
],
})
const
handleColumnFiltersChange
:
OnChangeFn
<
ColumnFiltersState
>
=
(
updater
)
=>
{
onColumnFiltersChange
((
previous
)
=>
{
const
next
=
typeof
updater
===
'function'
?
updater
(
previous
)
:
updater
const
status
=
next
.
find
((
f
)
=>
f
.
id
===
'status'
)?.
value
as
|
string
[]
|
undefined
localStorage
.
setItem
(
CHANNELS_STATUS_FILTER_STORAGE_KEY
,
status
?.[
0
]
??
'all'
)
return
next
})
}
// Extract filters from column filters
const
statusFilter
=
(
columnFilters
.
find
((
f
)
=>
f
.
id
===
'status'
)?.
value
as
string
[])
||
[]
...
...
@@ -290,7 +323,7 @@ export function ChannelsTable() {
?
(
row
:
Row
<
Channel
>
)
=>
!
isTagAggregateRow
(
row
.
original
)
:
false
,
onSortingChange
:
handleSortingChange
,
onColumnFiltersChange
,
onColumnFiltersChange
:
handleColumnFiltersChange
,
onPaginationChange
,
onGlobalFilterChange
,
getSubRows
:
(
row
:
Channel
&
{
children
?:
Channel
[]
})
=>
row
.
children
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment