Skip to content

[Frontend] Build Create Asset Modal with Form Validation #453

@yusuftomilola

Description

@yusuftomilola

A slide-in or centred modal form for registering a new asset. Opened from the Assets list page.

Requirements

Form fields:

  • Name (required)
  • Category (required — dropdown populated from GET /api/categories)
  • Department (required — dropdown populated from GET /api/departments)
  • Assigned To (optional — dropdown from GET /api/users)
  • Serial Number, Manufacturer, Model (optional strings)
  • Purchase Date, Warranty Expiration (optional dates)
  • Purchase Price, Current Value (optional numbers)
  • Condition (required — enum dropdown)
  • Status (optional — enum dropdown, defaults to ACTIVE)
  • Location (optional string)
  • Tags (optional — comma-separated or tag-input)
  • Notes (optional textarea)

Validation: Zod schema via react-hook-form. Required fields show inline errors.

On success: Close modal, refetch the assets list.

Acceptance Criteria

  • All dropdowns populated with live data from the API
  • Required fields validated before submission
  • Modal closes and list refreshes on success

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions