feat: maintenance flows frontend foundation - types, API clients, sidebar, library filter
- Add maintenance.ts types: TargetEntry, TargetList, MaintenanceSchedule, BatchLaunch - Add targetListsApi and maintenanceSchedulesApi/batchLaunchApi clients - Extend TreeType union with 'maintenance' in tree.ts - Update getTreeNavigatePath/getTreeEditorPath in routing.ts for maintenance - Sidebar: track maintenance count and add Maintenance sub-nav item - TreeLibraryPage: add maintenance to typeFilter state, URL sync, and tab buttons - TreeGridView, TreeListView, TreeTableView: add amber Wrench maintenance badge Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,3 +23,14 @@ export interface PaginatedResponse<T> {
|
||||
export interface ApiError {
|
||||
detail: string
|
||||
}
|
||||
|
||||
export type {
|
||||
TargetEntry,
|
||||
TargetList,
|
||||
TargetListCreate,
|
||||
MaintenanceSchedule,
|
||||
MaintenanceScheduleCreate,
|
||||
MaintenanceScheduleUpdate,
|
||||
BatchLaunchRequest,
|
||||
BatchLaunchResponse,
|
||||
} from './maintenance'
|
||||
|
||||
65
frontend/src/types/maintenance.ts
Normal file
65
frontend/src/types/maintenance.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
export interface TargetEntry {
|
||||
label: string
|
||||
notes?: string
|
||||
}
|
||||
|
||||
export interface TargetList {
|
||||
id: string
|
||||
team_id: string
|
||||
created_by?: string
|
||||
name: string
|
||||
description?: string
|
||||
targets: TargetEntry[]
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface TargetListCreate {
|
||||
name: string
|
||||
description?: string
|
||||
targets: TargetEntry[]
|
||||
}
|
||||
|
||||
export interface MaintenanceSchedule {
|
||||
id: string
|
||||
tree_id: string
|
||||
created_by?: string
|
||||
cron_expression: string
|
||||
timezone: string
|
||||
target_list_id?: string
|
||||
is_active: boolean
|
||||
next_run_at?: string
|
||||
last_run_at?: string
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface MaintenanceScheduleCreate {
|
||||
tree_id: string
|
||||
cron_expression: string
|
||||
timezone: string
|
||||
target_list_id?: string
|
||||
}
|
||||
|
||||
export interface MaintenanceScheduleUpdate {
|
||||
cron_expression?: string
|
||||
timezone?: string
|
||||
target_list_id?: string
|
||||
is_active?: boolean
|
||||
}
|
||||
|
||||
export interface BatchLaunchRequest {
|
||||
tree_id: string
|
||||
targets: TargetEntry[]
|
||||
}
|
||||
|
||||
export interface BatchLaunchResponse {
|
||||
batch_id: string
|
||||
count: number
|
||||
sessions: Array<{
|
||||
id: string
|
||||
batch_id: string
|
||||
target_label: string
|
||||
tree_id: string
|
||||
}>
|
||||
}
|
||||
@@ -58,7 +58,7 @@ export interface TreeStructure {
|
||||
|
||||
// --- Procedural Flow Types ---
|
||||
|
||||
export type TreeType = 'troubleshooting' | 'procedural'
|
||||
export type TreeType = 'troubleshooting' | 'procedural' | 'maintenance'
|
||||
|
||||
export type IntakeFieldType =
|
||||
| 'text' | 'textarea' | 'number' | 'ip_address' | 'email' | 'url'
|
||||
|
||||
Reference in New Issue
Block a user