forked from baron/baron-sso
클라이언트 동의 내역 페이지 전체 목록 조회 및 UX 개선
This commit is contained in:
@@ -46,7 +46,7 @@ function ClientConsentsPage() {
|
|||||||
} = useQuery({
|
} = useQuery({
|
||||||
queryKey: ["consents", clientId, subject],
|
queryKey: ["consents", clientId, subject],
|
||||||
queryFn: () => fetchConsents(subject, clientId),
|
queryFn: () => fetchConsents(subject, clientId),
|
||||||
enabled: subject.length > 0,
|
enabled: clientId.length > 0, // Removed subject.length > 0 check
|
||||||
});
|
});
|
||||||
const revokeMutation = useMutation({
|
const revokeMutation = useMutation({
|
||||||
mutationFn: (payload: { subject: string }) =>
|
mutationFn: (payload: { subject: string }) =>
|
||||||
@@ -174,23 +174,14 @@ function ClientConsentsPage() {
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{subject.length === 0 && !isLoading && !error ? (
|
|
||||||
<div className="flex flex-col items-center justify-center py-16 text-center text-muted-foreground">
|
|
||||||
<Search className="mb-4 h-12 w-12 opacity-20" />
|
|
||||||
<h3 className="mb-1 text-lg font-semibold text-foreground">사용자 검색 필요</h3>
|
|
||||||
<p className="max-w-sm text-sm">
|
|
||||||
보안상의 이유로 전체 목록은 제공되지 않습니다.<br/>
|
|
||||||
사용자 ID, 이메일, 또는 이름으로 검색하여 동의 내역을 확인하세요.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Table>
|
<Table>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>User</TableHead>
|
<TableHead>User</TableHead>
|
||||||
|
<TableHead>Tenant</TableHead>
|
||||||
<TableHead>Status</TableHead>
|
<TableHead>Status</TableHead>
|
||||||
<TableHead>Granted Scopes</TableHead>
|
<TableHead>Granted Scopes</TableHead>
|
||||||
|
<TableHead>First Granted</TableHead>
|
||||||
<TableHead>Last Authenticated</TableHead>
|
<TableHead>Last Authenticated</TableHead>
|
||||||
<TableHead className="text-right">Action</TableHead>
|
<TableHead className="text-right">Action</TableHead>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
@@ -198,8 +189,8 @@ function ClientConsentsPage() {
|
|||||||
<TableBody>
|
<TableBody>
|
||||||
{rows.length === 0 && !isLoading ? (
|
{rows.length === 0 && !isLoading ? (
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell colSpan={5} className="h-24 text-center">
|
<TableCell colSpan={7} className="h-24 text-center">
|
||||||
검색 결과가 없습니다.
|
No consents found.
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
) : (
|
) : (
|
||||||
@@ -220,6 +211,16 @@ function ClientConsentsPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<span className="text-sm font-semibold">
|
||||||
|
{row.tenantName || "N/A"}
|
||||||
|
</span>
|
||||||
|
<span className="text-xs text-muted-foreground">
|
||||||
|
{row.tenantId}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Badge variant="success">Active</Badge>
|
<Badge variant="success">Active</Badge>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -237,7 +238,12 @@ function ClientConsentsPage() {
|
|||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="text-sm text-muted-foreground">
|
<TableCell className="text-sm text-muted-foreground">
|
||||||
{row.authenticatedAt || "-"}
|
{new Date(row.createdAt).toLocaleString()}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="text-sm text-muted-foreground">
|
||||||
|
{row.authenticatedAt
|
||||||
|
? new Date(row.authenticatedAt).toLocaleString()
|
||||||
|
: "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="text-right">
|
<TableCell className="text-right">
|
||||||
<Button
|
<Button
|
||||||
@@ -271,8 +277,6 @@ function ClientConsentsPage() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<div className="grid gap-6 md:grid-cols-3">
|
<div className="grid gap-6 md:grid-cols-3">
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ export type ConsentSummary = {
|
|||||||
clientName?: string;
|
clientName?: string;
|
||||||
grantedScopes: string[];
|
grantedScopes: string[];
|
||||||
authenticatedAt?: string;
|
authenticatedAt?: string;
|
||||||
|
createdAt: string;
|
||||||
|
tenantId?: string;
|
||||||
|
tenantName?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ConsentListResponse = {
|
export type ConsentListResponse = {
|
||||||
|
|||||||
Reference in New Issue
Block a user