chore: bump package version to 0.4.15 and refactor user action components

- Updated package version in package.json and package-lock.json from 0.4.1 to 0.4.15.
- Upgraded @remnawave/backend-contract dependency from 0.0.74 to 0.0.75.
- Refactored user action components by removing ViewUserActionFeature and its related files, replacing it with UserActionsFeature in the user table widget for improved functionality.
- Adjusted padding in the UsernameColumnEntity for better UI alignment.
This commit is contained in:
kastov 2025-01-09 22:08:45 +03:00
parent ac6acc72ee
commit ca639030c8
No known key found for this signature in database
GPG key ID: 1B27BE29057F4C90
10 changed files with 70 additions and 44 deletions

12
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "@remnawave/frontend",
"version": "0.4.0",
"version": "0.4.15",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@remnawave/frontend",
"version": "0.4.0",
"version": "0.4.15",
"license": "MIT",
"dependencies": {
"@hello-pangea/dnd": "^17.0.0",
@ -24,7 +24,7 @@
"@mantine/nprogress": "^7.12.2",
"@monaco-editor/react": "^4.6.0",
"@paralleldrive/cuid2": "github:paralleldrive/cuid2",
"@remnawave/backend-contract": "0.0.74",
"@remnawave/backend-contract": "0.0.75",
"@stablelib/base64": "^2.0.1",
"@stablelib/x25519": "^2.0.1",
"@tabler/icons-react": "^3.24.0",
@ -1697,9 +1697,9 @@
}
},
"node_modules/@remnawave/backend-contract": {
"version": "0.0.74",
"resolved": "https://registry.npmjs.org/@remnawave/backend-contract/-/backend-contract-0.0.74.tgz",
"integrity": "sha512-kYzfaSIIpYVO6A4ZGTyG7LCeuteQJQbIuJ6anu02G+vJ2KXBBCa6wLBukmUHURfWn4Ktm6Bjl/77MmvOBcDikA==",
"version": "0.0.75",
"resolved": "https://registry.npmjs.org/@remnawave/backend-contract/-/backend-contract-0.0.75.tgz",
"integrity": "sha512-BHpyBmmaNQvIZ0RPmhC671fpF5nlKr+h5xvMiENOIYtyWJuJZnJfvR/0lT7+cmGoQiWGfndCLNiF/ILyOrUjLg==",
"license": "ISC",
"dependencies": {
"zod": "^3.22.4"

View file

@ -2,7 +2,7 @@
"name": "@remnawave/frontend",
"private": false,
"type": "module",
"version": "0.4.1",
"version": "0.4.15",
"license": "MIT",
"author": "REMNAWAVE <github.com/remnawave>",
"homepage": "https://github.com/remnawave",
@ -44,7 +44,7 @@
"@mantine/nprogress": "^7.12.2",
"@monaco-editor/react": "^4.6.0",
"@paralleldrive/cuid2": "github:paralleldrive/cuid2",
"@remnawave/backend-contract": "0.0.74",
"@remnawave/backend-contract": "0.0.75",
"@stablelib/base64": "^2.0.1",
"@stablelib/x25519": "^2.0.1",
"@tabler/icons-react": "^3.24.0",

View file

@ -10,7 +10,7 @@ export function UsernameColumnEntity(props: IProps) {
const timeAgo = getTimeAgoUtil(user.onlineAt)
return (
<Group align="center" gap="md" wrap="nowrap">
<Group align="center" gap="md" pl={10} wrap="nowrap">
<Indicator color={color} inline processing size={12} zIndex={10} />
<Box w="100%">
<Text fw={500} size="sm" truncate="end">

View file

@ -0,0 +1 @@
export * from './user-actions.feature'

View file

@ -0,0 +1,50 @@
import { Button, CopyButton, Group, Tooltip } from '@mantine/core'
import { PiCheck, PiCopy, PiEyeDuotone } from 'react-icons/pi'
import { useUserModalStoreActions } from '@entities/dashboard/user-modal-store/user-modal-store'
import { IProps } from './interfaces'
export function UserActionsFeature(props: IProps) {
const { userUuid, subscriptionUrl } = props
const actions = useUserModalStoreActions()
const handleOpenModal = async () => {
await actions.setUserUuid(userUuid)
actions.changeModalState(true)
}
return (
<Group gap={'xs'} justify={'center'} wrap={'nowrap'}>
<CopyButton timeout={2000} value={subscriptionUrl}>
{({ copied, copy }) => (
<Tooltip label={copied ? 'Copied!' : 'Copy subscription URL'}>
<Button
color={copied ? 'teal' : 'cyan'}
onClick={copy}
radius="md"
size="xs"
variant={copied ? 'light' : 'outline'}
>
{copied ? (
<PiCheck style={{ width: '1.2rem', height: '1.2rem' }} />
) : (
<PiCopy style={{ width: '1.2rem', height: '1.2rem' }} />
)}
</Button>
</Tooltip>
)}
</CopyButton>
<Button
leftSection={<PiEyeDuotone size={'1.5rem'} />}
onClick={handleOpenModal}
radius="md"
size="xs"
type="button"
>
View
</Button>
</Group>
)
}

View file

@ -1 +0,0 @@
export * from './view-user-action.feature'

View file

@ -1,31 +0,0 @@
import { Button, Group } from '@mantine/core'
import { PiEyeDuotone } from 'react-icons/pi'
import { useUserModalStoreActions } from '@entities/dashboard/user-modal-store/user-modal-store'
import { IProps } from './interfaces'
export function ViewUserActionFeature(props: IProps) {
const { userUuid } = props
const actions = useUserModalStoreActions()
const handleOpenModal = async () => {
await actions.setUserUuid(userUuid)
actions.changeModalState(true)
}
return (
<Group gap={'xs'} justify={'center'} wrap={'nowrap'}>
<Button
leftSection={<PiEyeDuotone size={'1.5rem'} />}
onClick={handleOpenModal}
radius="md"
size="xs"
type="button"
>
View
</Button>
</Group>
)
}

View file

@ -11,7 +11,7 @@ import { useState } from 'react'
import { UserActionGroupFeature } from '@features/dashboard/users/users-action-group/action-group.feature'
import { useUserTableColumns } from '@features/dashboard/users/users-table/model/use-table-columns'
import { ViewUserActionFeature } from '@features/ui/dashboard/users/view-user-action'
import { UserActionsFeature } from '@features/ui/dashboard/users/user-actions'
import { DataTableShared } from '@shared/ui/table'
import { useGetUsersV2 } from '@shared/api/hooks'
@ -103,8 +103,14 @@ export function UserTableWidget() {
sorting
},
enableRowActions: true,
renderRowActions: ({ row }) => <ViewUserActionFeature userUuid={row.original.uuid} />,
displayColumnDefOptions: { 'mrt-row-actions': { size: 120 } }
renderRowActions: ({ row }) => (
<UserActionsFeature
subscriptionUrl={row.original.subscriptionUrl}
userUuid={row.original.uuid}
/>
),
displayColumnDefOptions: { 'mrt-row-actions': { size: 160 } }
})
return (