diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ecbe113 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,45 @@ +# Changelog + +All notable changes to IssueManager are documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Sprint 3 + +#### Added + +- **Issue Filters & Search** (#116) + - `GET /api/v1/issues` now supports `page`, `pageSize`, `searchTerm`, `authorName`, `statusName`, and `categoryName` query parameters + - IssuesPage component wires all filters to the API call for real-time filtering + - Search term performs regex-based matching on issue titles and descriptions (case-insensitive) + +- **Category Archive API** (#120) + - `DELETE /api/v1/categories/{id}` endpoint for admin-only category archiving (soft-delete) + - Archived categories are marked with `Archived=true` and `ArchivedBy` timestamp + - Archived categories no longer appear in issue creation forms + - Preserves historical data while removing active usage + +- **Status Archive API** (#121) + - `DELETE /api/v1/statuses/{id}` endpoint for admin-only status archiving (soft-delete) + - Archived statuses are marked with `Archived=true` and `ArchivedBy` timestamp + - Archived statuses no longer appear in issue workflow selectors + - Preserves historical data while removing active usage + +- **Category Archive UI** (#124) + - Admin-only Archive button in CategoriesPage grid + - Confirmation dialog to prevent accidental archiving + - Archived categories excluded from display + +- **Status Archive UI** (#123) + - Admin-only Archive button in StatusesPage grid + - Confirmation dialog to prevent accidental archiving + - Archived statuses excluded from display + +#### Documentation + +- Added comprehensive API documentation for issue filtering +- Added soft-delete behavior documentation for categories and statuses +- Added admin UI workflow documentation for archiving operations diff --git a/docs/features/categories.md b/docs/features/categories.md new file mode 100644 index 0000000..9832f06 --- /dev/null +++ b/docs/features/categories.md @@ -0,0 +1,62 @@ +# Categories API & UI + +## Overview + +Categories allow issues to be classified by type (e.g., "Bug", "Feature Request", "Documentation"). Admins can manage categories, including archiving (soft-deleting) them to prevent new usage while preserving historical data. + +## DELETE /api/v1/categories/{id} + +Archives (soft-deletes) a category. Only administrators can perform this action. + +### Authorization + +- **Required Role:** Administrator +- **Response:** `204 No Content` on success or `403 Forbidden` if user lacks permissions + +### Behavior + +When a category is archived: +- The category document is marked with `Archived = true` +- The `ArchivedBy` field is set to the current user's ID +- The `ArchivedAt` timestamp is recorded +- Archived categories **do not appear** in issue creation forms +- Existing issues with archived categories remain visible but cannot be reassigned to that category +- The category can be restored by a squad member with database access (manual intervention) + +### Example Request + +``` +DELETE /api/v1/categories/507f1f77bcf86cd799439011 +Authorization: Bearer {token} +``` + +### Example Response + +``` +HTTP/1.1 204 No Content +``` + +## CategoriesPage.razor + +The CategoriesPage component displays a grid of all active categories and provides admin controls. + +### Features + +- **Category Grid:** Displays all active (non-archived) categories +- **Archive Button:** Admin-only action to archive a category +- **Confirmation Dialog:** Protects against accidental archiving +- **Read-only for Non-Admins:** Non-administrators can view but cannot take actions + +### Admin Workflow + +1. Navigate to the Categories page +2. Locate the category to archive +3. Click the **Archive** button +4. Confirm the action in the dialog +5. The category is marked as archived and removed from all issue creation forms + +### Implementation Notes + +- Archive confirmation uses a modal dialog to prevent accidental data loss +- Archived categories are excluded from the display grid to reduce clutter +- Only users with the Administrator role can see and use the Archive button diff --git a/docs/features/issues.md b/docs/features/issues.md new file mode 100644 index 0000000..a5fc488 --- /dev/null +++ b/docs/features/issues.md @@ -0,0 +1,81 @@ +# Issues API & UI + +## Overview + +The Issues API provides endpoints to create, read, update, and list issues. The UI surfaces these capabilities through the IssuesPage component with integrated filtering and search. + +## GET /api/v1/issues + +Retrieves a paginated list of issues with optional filtering and search. + +### Query Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `page` | integer | No | Page number (0-indexed, default: 0) | +| `pageSize` | integer | No | Results per page (default: 10, max: 100) | +| `searchTerm` | string | No | Searches issue titles and descriptions (regex-based, case-insensitive) | +| `authorName` | string | No | Filter by issue author name (exact match, case-insensitive) | +| `statusName` | string | No | Filter by status name (e.g., "Open", "In Progress", "Closed") | +| `categoryName` | string | No | Filter by category name (e.g., "Bug", "Feature Request") | + +### Example Requests + +**List first 10 issues:** +``` +GET /api/v1/issues?page=0&pageSize=10 +``` + +**Search for issues with "login" in title/description:** +``` +GET /api/v1/issues?searchTerm=login&page=0&pageSize=10 +``` + +**Filter by author and status:** +``` +GET /api/v1/issues?authorName=john&statusName=Open&page=0&pageSize=10 +``` + +**Combine search and filters:** +``` +GET /api/v1/issues?searchTerm=auth&categoryName=Bug&statusName=Open&page=0&pageSize=20 +``` + +### Response + +Returns an `IssuesPage` object: +```json +{ + "page": 0, + "pageSize": 10, + "totalCount": 42, + "items": [ + { + "id": "507f1f77bcf86cd799439011", + "title": "Login page is broken", + "description": "...", + "authorName": "john", + "statusName": "Open", + "categoryName": "Bug", + "createdAt": "2024-01-15T10:30:00Z", + "updatedAt": "2024-01-20T14:22:00Z" + } + ] +} +``` + +## IssuesPage.razor + +The IssuesPage component provides a user-friendly interface for browsing and filtering issues. + +### Features + +- **Pagination:** Navigate through results using page controls +- **Search:** Full-text search across issue titles and descriptions +- **Filter by Author:** Select issues created by a specific author +- **Filter by Status:** Select issues with a specific status +- **Filter by Category:** Select issues with a specific category + +### Implementation Notes + +All filter selections are wired directly to the API call, ensuring real-time filtering without page reload. Filters can be combined for precise issue lookup. diff --git a/docs/features/statuses.md b/docs/features/statuses.md new file mode 100644 index 0000000..8d4c7e6 --- /dev/null +++ b/docs/features/statuses.md @@ -0,0 +1,63 @@ +# Statuses API & UI + +## Overview + +Statuses track the lifecycle of issues (e.g., "Open", "In Progress", "Closed", "On Hold"). Admins can manage statuses, including archiving (soft-deleting) them to retire statuses while preserving historical data. + +## DELETE /api/v1/statuses/{id} + +Archives (soft-deletes) a status. Only administrators can perform this action. + +### Authorization + +- **Required Role:** Administrator +- **Response:** `204 No Content` on success or `403 Forbidden` if user lacks permissions + +### Behavior + +When a status is archived: +- The status document is marked with `Archived = true` +- The `ArchivedBy` field is set to the current user's ID +- The `ArchivedAt` timestamp is recorded +- Archived statuses **do not appear** in issue status selectors or workflows +- Existing issues with archived statuses remain visible but cannot be transitioned to that status +- The status can be restored by a squad member with database access (manual intervention) + +### Example Request + +``` +DELETE /api/v1/statuses/507f1f77bcf86cd799439011 +Authorization: Bearer {token} +``` + +### Example Response + +``` +HTTP/1.1 204 No Content +``` + +## StatusesPage.razor + +The StatusesPage component displays a grid of all active statuses and provides admin controls. + +### Features + +- **Status Grid:** Displays all active (non-archived) statuses +- **Archive Button:** Admin-only action to archive a status +- **Confirmation Dialog:** Protects against accidental archiving +- **Read-only for Non-Admins:** Non-administrators can view but cannot take actions + +### Admin Workflow + +1. Navigate to the Statuses page +2. Locate the status to archive +3. Click the **Archive** button +4. Confirm the action in the dialog +5. The status is marked as archived and removed from all issue workflow selectors + +### Implementation Notes + +- Archive confirmation uses a modal dialog to prevent accidental data loss +- Archived statuses are excluded from the display grid to reduce clutter +- Only users with the Administrator role can see and use the Archive button +- Status archiving mirrors category archiving for consistency