feat(B3): add tenant management UI (CRUD + tenant selector)

- frontend/src/api/tenants.ts: Tenant CRUD API client (getTenants, getTenant, createTenant, updateTenant, deleteTenant)
- frontend/src/pages/Tenants.tsx: Admin page with table, create/edit modals, delete confirm, and cross-tenant selector persisted in localStorage
- App.tsx: /tenants route (AdminRoute-guarded)
- Layout.tsx: Tenants sidebar link (admin-only, Building2 icon)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 16:13:26 +01:00
parent 995339959e
commit 82bf46725b
4 changed files with 514 additions and 1 deletions
+9
View File
@@ -16,6 +16,7 @@ import ProductDetailPage from './pages/ProductDetail'
import NewProductOrderPage from './pages/NewProductOrder'
import NotificationsPage from './pages/Notifications'
import PreferencesPage from './pages/Preferences'
import TenantsPage from './pages/Tenants'
function ProtectedRoute({ children }: { children: React.ReactNode }) {
const token = useAuthStore((s) => s.token)
@@ -57,6 +58,14 @@ export default function App() {
</AdminRoute>
}
/>
<Route
path="tenants"
element={
<AdminRoute>
<TenantsPage />
</AdminRoute>
}
/>
<Route path="materials" element={<MaterialsPage />} />
<Route path="activity" element={<WorkerActivityPage />} />
<Route path="products" element={<ProductLibraryPage />} />