Enhance user management and billing integration
- Updated the `UserSummaryDto` to include `BillingEnabled` and `BillingPaidUntil` properties, allowing for better tracking of user billing status. - Refactored the `IdentityService` to populate the new billing fields when retrieving user summaries. - Modified the dashboard and admin user management components to display billing information, including a link to the billing page and a badge for billing status. - Added internationalization support for new billing-related labels in both English and Russian. - Ensured frontend components reflect the updated user data structure, enhancing user experience with billing visibility.
This commit is contained in:
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next'
|
||||
import { Input } from '@/shared/ui/input'
|
||||
import { Button } from '@/shared/ui/button'
|
||||
import { Badge } from '@/shared/ui/badge'
|
||||
import { PaidUntilBadge } from '@/features/billing/PaidUntilBadge'
|
||||
import { listUsers } from '@/features/admin/users/api'
|
||||
import { UserManageDialog } from '@/features/admin/users/UserManageDialog'
|
||||
import type { UserSummaryDto } from '@/shared/api/types'
|
||||
@@ -56,6 +57,7 @@ function AdminUsersPage() {
|
||||
<th className="py-2 font-medium">{t('admin.users.userName')}</th>
|
||||
<th className="py-2 font-medium">{t('admin.users.role')}</th>
|
||||
<th className="py-2 font-medium">{t('admin.users.statusLabel')}</th>
|
||||
<th className="py-2 font-medium">{t('admin.users.billingLabel')}</th>
|
||||
<th className="py-2" />
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -73,6 +75,13 @@ function AdminUsersPage() {
|
||||
: t('admin.users.status.pending')}
|
||||
</Badge>
|
||||
</td>
|
||||
<td className="py-2">
|
||||
{user.billingEnabled ? (
|
||||
<PaidUntilBadge paidUntil={user.billingPaidUntil} />
|
||||
) : (
|
||||
<span className="text-muted-foreground">—</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="py-2 text-right">
|
||||
<Button size="sm" variant="outline" onClick={() => setManaging(user)}>
|
||||
{t('admin.users.manage')}
|
||||
|
||||
Reference in New Issue
Block a user