Skip to content

Lease portfolio ​

Leases page screenshot

Overview ​

The All Leases page displays the portfolio and summary counts.

  • Route: /leases (protected)
  • Source: front/src/pages/AllLeases.tsx
  • Layout: DashboardLayout
  • Components: LeaseTable, Button, LoadingSpinner

User actions ​

  • Search, status filter, and asset-type filter. Each filter change triggers a reload; this page requests page 1 with limit 100.
  • Navigate to lease creation.
  • Export leases as CSV.
  • Delete, terminate, or reactivate a lease after browser confirmation.
  • Table links navigate to lease detail/edit routes.

APIs and data flow ​

  • Initial mount and filter changes call GET /leases with available query parameters and GET /leases/summary in parallel.
  • Mutations call DELETE /leases/:id, POST /leases/:id/terminate, or POST /leases/:id/reactivate, then reload list and summary.
  • Export calls GET /leases/export?format=csv as a blob.
  • Lease API response objects are mapped to the frontend Lease type by leaseService.

States ​

  • Shows loading spinner and a failure message with Retry.
  • Failed actions/export are logged and shown with alert().
  • A zero-row result is rendered through the table mapping; no dedicated empty-state message was confirmed.

Source references: front/src/pages/AllLeases.tsx, front/src/components/dashboard/LeaseTable.tsx, front/src/services/api/leaseService.ts.

See Lease API.