Enhance app management with 'IsRecommended' feature
- Added 'IsRecommended' property to app-related data models, allowing apps to be marked as recommended. - Updated API endpoints for creating and updating apps to include 'IsRecommended' in request bodies. - Modified database schema to accommodate the new 'IsRecommended' field. - Enhanced frontend components to display recommended apps with a star icon and updated forms to manage this property. - Improved sorting logic in app listings to prioritize recommended apps. - Updated documentation to reflect changes in API and data models.
This commit is contained in:
@@ -2,6 +2,7 @@ import { useState } from 'react'
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Star } from 'lucide-react'
|
||||
import { toast } from '@/shared/ui/toast-store'
|
||||
import { Button } from '@/shared/ui/button'
|
||||
import { Badge } from '@/shared/ui/badge'
|
||||
@@ -58,6 +59,9 @@ function AdminAppsPage() {
|
||||
.map((app) => (
|
||||
<div key={app.id} className="flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm">
|
||||
<div className="flex items-center gap-2">
|
||||
{app.isRecommended && (
|
||||
<Star className="h-3.5 w-3.5 shrink-0 fill-yellow-400 text-yellow-400" aria-label={t('admin.apps.recommended')} />
|
||||
)}
|
||||
<span>{app.name}</span>
|
||||
{!app.isEnabled && <Badge variant="outline">{t('admin.apps.disabled')}</Badge>}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user