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
2281c9e3
authored
Jul 05, 2026
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(web): refine mobile user cards
parent
4a64b870
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
12 deletions
+37
-12
web/default/src/components/data-table/layout/card-row-content.tsx
+21
-3
web/default/src/features/users/components/users-columns.tsx
+10
-4
web/default/src/i18n/locales/fr.json
+1
-1
web/default/src/i18n/locales/ja.json
+1
-1
web/default/src/i18n/locales/ru.json
+1
-1
web/default/src/i18n/locales/vi.json
+1
-1
web/default/src/i18n/locales/zh.json
+1
-1
web/default/src/tanstack-table.d.ts
+1
-0
No files found.
web/default/src/components/data-table/layout/card-row-content.tsx
View file @
2281c9e3
...
@@ -16,13 +16,27 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
...
@@ -16,13 +16,27 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
For commercial licensing, please contact support@quantumnous.com
*/
*/
import
type
{
Row
}
from
'@tanstack/react-table'
import
type
{
Cell
,
Row
}
from
'@tanstack/react-table'
import
*
as
React
from
'react'
import
*
as
React
from
'react'
import
{
StatusBadgeTypeContext
}
from
'@/components/status-badge'
import
{
StatusBadgeTypeContext
}
from
'@/components/status-badge'
import
{
getCellLabel
,
renderCellContent
}
from
'./card-cell-utils'
import
{
getCellLabel
,
renderCellContent
}
from
'./card-cell-utils'
function
orderCardCells
<
TData
>
(
cells
:
Cell
<
TData
,
unknown
>
[]
):
Cell
<
TData
,
unknown
>
[]
{
return
[...
cells
].
sort
((
a
,
b
)
=>
{
const
aOrder
=
a
.
column
.
columnDef
.
meta
?.
mobileOrder
const
bOrder
=
b
.
column
.
columnDef
.
meta
?.
mobileOrder
if
(
aOrder
==
null
&&
bOrder
==
null
)
return
0
if
(
aOrder
==
null
)
return
1
if
(
bOrder
==
null
)
return
-
1
return
aOrder
-
bOrder
})
}
/**
/**
* Shared, column-meta-driven card content rendering for TanStack rows.
* Shared, column-meta-driven card content rendering for TanStack rows.
*
*
...
@@ -62,13 +76,15 @@ function CompactContent<TData>({ row }: { row: Row<TData> }) {
...
@@ -62,13 +76,15 @@ function CompactContent<TData>({ row }: { row: Row<TData> }) {
const
titleCell
=
allCells
.
find
((
_
,
i
)
=>
cellMetas
[
i
]?.
mobileTitle
)
const
titleCell
=
allCells
.
find
((
_
,
i
)
=>
cellMetas
[
i
]?.
mobileTitle
)
const
badgeCell
=
allCells
.
find
((
_
,
i
)
=>
cellMetas
[
i
]?.
mobileBadge
)
const
badgeCell
=
allCells
.
find
((
_
,
i
)
=>
cellMetas
[
i
]?.
mobileBadge
)
const
actionsCell
=
allCells
.
find
((
c
)
=>
c
.
column
.
id
===
'actions'
)
const
actionsCell
=
allCells
.
find
((
c
)
=>
c
.
column
.
id
===
'actions'
)
const
fieldCells
=
allCells
.
filter
(
const
fieldCells
=
orderCardCells
(
allCells
.
filter
(
(
c
,
i
)
=>
(
c
,
i
)
=>
c
!==
titleCell
&&
c
!==
titleCell
&&
c
!==
badgeCell
&&
c
!==
badgeCell
&&
c
!==
actionsCell
&&
c
!==
actionsCell
&&
!
cellMetas
[
i
]?.
mobileHidden
!
cellMetas
[
i
]?.
mobileHidden
)
)
)
return
(
return
(
<>
<>
...
@@ -135,9 +151,11 @@ function FallbackContent<TData>({ row }: { row: Row<TData> }) {
...
@@ -135,9 +151,11 @@ function FallbackContent<TData>({ row }: { row: Row<TData> }) {
)
)
const
actionsCell
=
allCells
.
find
((
c
)
=>
c
.
column
.
id
===
'actions'
)
const
actionsCell
=
allCells
.
find
((
c
)
=>
c
.
column
.
id
===
'actions'
)
const
contentCells
=
allCells
.
filter
(
const
contentCells
=
orderCardCells
(
allCells
.
filter
(
(
c
,
i
)
=>
c
.
column
.
id
!==
'actions'
&&
!
cellMetas
[
i
]?.
mobileHidden
(
c
,
i
)
=>
c
.
column
.
id
!==
'actions'
&&
!
cellMetas
[
i
]?.
mobileHidden
)
)
)
return
(
return
(
<>
<>
...
...
web/default/src/features/users/components/users-columns.tsx
View file @
2281c9e3
...
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
...
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
For commercial licensing, please contact support@quantumnous.com
*/
*/
import
{
type
ColumnDef
}
from
'@tanstack/react-table'
import
type
{
ColumnDef
}
from
'@tanstack/react-table'
import
{
useTranslation
}
from
'react-i18next'
import
{
useTranslation
}
from
'react-i18next'
import
{
BadgeCell
}
from
'@/components/data-table'
import
{
BadgeCell
}
from
'@/components/data-table'
...
@@ -40,7 +40,7 @@ import {
...
@@ -40,7 +40,7 @@ import {
USER_ROLES
,
USER_ROLES
,
isUserDeleted
,
isUserDeleted
,
}
from
'../constants'
}
from
'../constants'
import
{
type
User
}
from
'../types'
import
type
{
User
}
from
'../types'
import
{
DataTableRowActions
}
from
'./data-table-row-actions'
import
{
DataTableRowActions
}
from
'./data-table-row-actions'
function
getQuotaProgressColor
(
percentage
:
number
):
string
{
function
getQuotaProgressColor
(
percentage
:
number
):
string
{
...
@@ -80,11 +80,14 @@ export function useUsersColumns(): ColumnDef<User>[] {
...
@@ -80,11 +80,14 @@ export function useUsersColumns(): ColumnDef<User>[] {
header
:
t
(
'ID'
),
header
:
t
(
'ID'
),
cell
:
({
row
})
=>
{
cell
:
({
row
})
=>
{
return
(
return
(
<
TableId
value=
{
row
.
getValue
(
'id'
)
as
number
}
className=
'w-[60px]'
/>
<
TableId
value=
{
row
.
getValue
(
'id'
)
as
number
}
className=
'w-[60px] text-sm'
/>
)
)
},
},
size
:
80
,
size
:
80
,
meta
:
{
mobile
Hidden
:
true
},
meta
:
{
mobile
Order
:
10
},
},
},
{
{
accessorKey
:
'username'
,
accessorKey
:
'username'
,
...
@@ -224,6 +227,7 @@ export function useUsersColumns(): ColumnDef<User>[] {
...
@@ -224,6 +227,7 @@ export function useUsersColumns(): ColumnDef<User>[] {
)
)
},
},
size
:
170
,
size
:
170
,
meta
:
{
mobileOrder
:
40
},
},
},
{
{
accessorKey
:
'group'
,
accessorKey
:
'group'
,
...
@@ -242,6 +246,7 @@ export function useUsersColumns(): ColumnDef<User>[] {
...
@@ -242,6 +246,7 @@ export function useUsersColumns(): ColumnDef<User>[] {
return
group
.
includes
(
searchValue
)
return
group
.
includes
(
searchValue
)
},
},
size
:
140
,
size
:
140
,
meta
:
{
mobileOrder
:
30
},
},
},
{
{
accessorKey
:
'role'
,
accessorKey
:
'role'
,
...
@@ -268,6 +273,7 @@ export function useUsersColumns(): ColumnDef<User>[] {
...
@@ -268,6 +273,7 @@ export function useUsersColumns(): ColumnDef<User>[] {
},
},
enableSorting
:
false
,
enableSorting
:
false
,
size
:
120
,
size
:
120
,
meta
:
{
mobileOrder
:
20
},
},
},
{
{
id
:
'invite_info'
,
id
:
'invite_info'
,
...
...
web/default/src/i18n/locales/fr.json
View file @
2281c9e3
...
@@ -3718,7 +3718,7 @@
...
@@ -3718,7 +3718,7 @@
"Right to Left"
:
"De droite à gauche"
,
"Right to Left"
:
"De droite à gauche"
,
"Role"
:
"Rôle"
,
"Role"
:
"Rôle"
,
"Roleplay"
:
"Roleplay"
,
"Roleplay"
:
"Roleplay"
,
"Root"
:
"R
acine
"
,
"Root"
:
"R
oot
"
,
"Rose Garden"
:
"Jardin de roses"
,
"Rose Garden"
:
"Jardin de roses"
,
"Route"
:
"Route"
,
"Route"
:
"Route"
,
"Route active"
:
"Route active"
,
"Route active"
:
"Route active"
,
...
...
web/default/src/i18n/locales/ja.json
View file @
2281c9e3
...
@@ -3718,7 +3718,7 @@
...
@@ -3718,7 +3718,7 @@
"Right to Left"
:
"右から左"
,
"Right to Left"
:
"右から左"
,
"Role"
:
"ロール"
,
"Role"
:
"ロール"
,
"Roleplay"
:
"ロールプレイ"
,
"Roleplay"
:
"ロールプレイ"
,
"Root"
:
"
ルート
"
,
"Root"
:
"
Root
"
,
"Rose Garden"
:
"ローズガーデン"
,
"Rose Garden"
:
"ローズガーデン"
,
"Route"
:
"ルート"
,
"Route"
:
"ルート"
,
"Route active"
:
"ルート有効"
,
"Route active"
:
"ルート有効"
,
...
...
web/default/src/i18n/locales/ru.json
View file @
2281c9e3
...
@@ -3718,7 +3718,7 @@
...
@@ -3718,7 +3718,7 @@
"Right to Left"
:
"Справа налево"
,
"Right to Left"
:
"Справа налево"
,
"Role"
:
"Роль"
,
"Role"
:
"Роль"
,
"Roleplay"
:
"Ролевые игры"
,
"Roleplay"
:
"Ролевые игры"
,
"Root"
:
"
Корень
"
,
"Root"
:
"
Root
"
,
"Rose Garden"
:
"Розовый сад"
,
"Rose Garden"
:
"Розовый сад"
,
"Route"
:
"Маршрут"
,
"Route"
:
"Маршрут"
,
"Route active"
:
"Маршрут активен"
,
"Route active"
:
"Маршрут активен"
,
...
...
web/default/src/i18n/locales/vi.json
View file @
2281c9e3
...
@@ -3718,7 +3718,7 @@
...
@@ -3718,7 +3718,7 @@
"Right to Left"
:
"Phải sang trái"
,
"Right to Left"
:
"Phải sang trái"
,
"Role"
:
"Vai trò"
,
"Role"
:
"Vai trò"
,
"Roleplay"
:
"Nhập vai"
,
"Roleplay"
:
"Nhập vai"
,
"Root"
:
"
Gốc
"
,
"Root"
:
"
Root
"
,
"Rose Garden"
:
"Vườn hoa hồng"
,
"Rose Garden"
:
"Vườn hoa hồng"
,
"Route"
:
"Tuyến đường"
,
"Route"
:
"Tuyến đường"
,
"Route active"
:
"Tuyến đang hoạt động"
,
"Route active"
:
"Tuyến đang hoạt động"
,
...
...
web/default/src/i18n/locales/zh.json
View file @
2281c9e3
...
@@ -3718,7 +3718,7 @@
...
@@ -3718,7 +3718,7 @@
"Right to Left"
:
"从右到左"
,
"Right to Left"
:
"从右到左"
,
"Role"
:
"角色"
,
"Role"
:
"角色"
,
"Roleplay"
:
"角色扮演"
,
"Roleplay"
:
"角色扮演"
,
"Root"
:
"
根
"
,
"Root"
:
"
Root
"
,
"Rose Garden"
:
"玫瑰花园"
,
"Rose Garden"
:
"玫瑰花园"
,
"Route"
:
"路由"
,
"Route"
:
"路由"
,
"Route active"
:
"路由已启用"
,
"Route active"
:
"路由已启用"
,
...
...
web/default/src/tanstack-table.d.ts
View file @
2281c9e3
...
@@ -28,5 +28,6 @@ declare module '@tanstack/react-table' {
...
@@ -28,5 +28,6 @@ declare module '@tanstack/react-table' {
mobileTitle
?:
boolean
// card title area (left, larger text)
mobileTitle
?:
boolean
// card title area (left, larger text)
mobileBadge
?:
boolean
// status badge alongside title (right)
mobileBadge
?:
boolean
// status badge alongside title (right)
mobileHidden
?:
boolean
// hide this column on mobile entirely
mobileHidden
?:
boolean
// hide this column on mobile entirely
mobileOrder
?:
number
// lower values appear first in card field area
}
}
}
}
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