29 lines
2.0 KiB
Markdown
29 lines
2.0 KiB
Markdown
# Profile details modal and notes: implementation plan (2026-10-04)
|
|||
|
|
|
||
|
|
Goal: on the **Certificates** page, rows become clickable. A click opens a modal with the main profile details and a free-text **note** that can be saved. Profiles have no note field today, so a minimal Profiler change is required to store it.
|
||
|
|
|
||
|
|
## Steps
|
||
|
|
|
||
|
|
### 1. Profiler backend (`APP_PROFILER/`)
|
||
|
|
- `models.py`: `UserProfile.note = Column(Text, nullable=True)`.
|
||
|
|
- `schemas.py`: `note: Optional[str]` in the response schema; new `UserProfileNoteUpdate` (max 1000 chars, empty string becomes `None`).
|
||
|
|
- Startup migration: idempotent "add column if missing" step (pattern from `APP_CORE/db.py`), so existing databases do not fail with `no such column`.
|
||
|
|
- `routers/profiles.py`: `PUT /profiles/{profile_id}/note` returns the updated profile; 404 if not found; JWT required (router-level `verify_token`). PUT is used because CORS does not allow PATCH.
|
||
|
|
|
||
|
|
### 2. UI (`APP_UI/`)
|
||
|
|
- New `src/components/ProfileDetailsModal.vue` built on `BaseModal.vue` (pattern: `NewClientModal.vue`): username, status badge, created, expiration, days remaining, revoked date, file path, note textarea, Save / Close.
|
||
|
|
- `src/views/Certificates.vue`: clickable rows (active and expired/revoked), `@click.stop` on the download/revoke buttons, `saveNote()` via `profilesApiClient.put`, reload and toast.
|
||
|
|
|
||
|
|
### 3. Tests (minimal)
|
||
|
|
- One pytest test in `APP_PROFILER`: `PUT /profiles/{id}/note` stores the note and `GET /profiles` returns it (temporary DB, auth dependency overridden).
|
||
|
|
- No UI tests (no test infrastructure in `APP_UI`).
|
||
|
|
|
||
|
|
### 4. Build and verification (containers)
|
||
|
|
- Tests and build run in containers; the result is deployed with `docker-compose` on this host for manual checks.
|
||
|
|
|
||
|
|
### 5. Documentation
|
||
|
|
- `DOCS/Profiler_Management/API_Reference.md`, `DOCS/General/Index.md`, `README.md` (Changes table).
|
||
|
|
- Summary of the work: `DOCS/Changes/2026-10-04_Profile_Notes.md` (written at the end).
|
||
|
|
|
||
|
|
## Out of scope
|
||
|
|
Note history, per-user permissions, search by note, other pages.
|