Introduce organization management system with CRUD, pagination, and member handling

- Added core components: `OrganizationListTable`, `OrganizationFormDialog`, `OrganizationActionMenu`, `OrganizationManagementContent`.
- Implemented full organization CRUD and member management functionality via React Query hooks (`useCreateOrganization`, `useUpdateOrganization`, `useDeleteOrganization`, `useGetOrganization`, `useOrganizationMembers`).
- Replaced placeholder content on the Organization Management page with production-ready functionality, including table skeletons for loading states, empty states, and pagination.
- Introduced `zod` schemas for robust form validation and error handling.
- Enhanced UI feedback through toasts and alert dialogs for organization actions.
- Achieved forward compatibility with centralized API client and organization types.
This commit is contained in:
Felipe Cardoso
2025-11-06 19:57:42 +01:00
parent 96ae9295d3
commit 01e0b9ab21
6 changed files with 974 additions and 31 deletions

View File

@@ -9,6 +9,7 @@ import type { Metadata } from 'next';
import Link from 'next/link';
import { ArrowLeft } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { OrganizationManagementContent } from '@/components/admin/organizations/OrganizationManagementContent';
/* istanbul ignore next - Next.js metadata, not executable code */
export const metadata: Metadata = {
@@ -19,43 +20,17 @@ export default function AdminOrganizationsPage() {
return (
<div className="container mx-auto px-6 py-8">
<div className="space-y-6">
{/* Back Button + Header */}
{/* Back Button */}
<div className="flex items-center gap-4">
<Link href="/admin">
<Button variant="outline" size="icon" aria-label="Back to Admin Dashboard">
<ArrowLeft className="h-4 w-4" aria-hidden="true" />
</Button>
</Link>
<div>
<h1 className="text-3xl font-bold tracking-tight">
Organizations
</h1>
<p className="mt-2 text-muted-foreground">
Manage organizations and their members
</p>
</div>
</div>
{/* Placeholder Content */}
<div className="rounded-lg border bg-card p-12 text-center">
<h3 className="text-xl font-semibold mb-2">
Organization Management Coming Soon
</h3>
<p className="text-muted-foreground max-w-md mx-auto">
This page will allow you to view all organizations, manage their
members, and perform administrative tasks.
</p>
<p className="text-sm text-muted-foreground mt-4">
Features will include:
</p>
<ul className="text-sm text-muted-foreground mt-2 max-w-sm mx-auto text-left">
<li> Organization list with search and filtering</li>
<li> View organization details and members</li>
<li> Manage organization memberships</li>
<li> Organization statistics and activity</li>
<li> Bulk operations</li>
</ul>
</div>
{/* Organization Management Content */}
<OrganizationManagementContent />
</div>
</div>
);