Commit 138aed3
authored
feat: added management for network-policies, storage-objects with layout and screen size improvements (#54)
## Description
This PR adds comprehensive network policy management functionality to
the CLI, including:
- New commands for network policy CRUD operations (list, create, get,
delete)
- Interactive UI components for creating and managing network policies
- Generic ResourceDetailPage component to reduce code duplication
- Reusable form components (FormField, FormSelect, FormTextInput,
FormListManager, FormActionButton)
- Integration with devbox creation to support network policy assignment
- Updated @runloop/api-client to version 1.3.0 for network policy
support
## Type of Change
- [x] New feature (non-breaking change which adds functionality)
- [x] Code refactoring
## Changes Made
### Commands
- Added `rli network-policy list` - List all network policies with
pagination
- Added `rli network-policy get <id>` - Get network policy details
- Added `rli network-policy create` - Interactive network policy
creation
- Added `rli network-policy delete <id>` - Delete a network policy
- Updated `rli devbox create` to support `--network-policy` flag
### Components & Refactoring
- Created `ResourceDetailPage` - Generic detail page component (reduces
duplication)
- Created `NetworkPolicyCreatePage` - Interactive form for creating
policies
- Created `ConfirmationPrompt` - Reusable confirmation dialog
- Created form components package for consistent form UX
- Refactored detail screens for blueprints, objects, and snapshots to
use new generic components
### Services & Stores
- Added `networkPolicyService` for API interactions
- Added `networkPolicyStore` for state management
- Updated services to use new API client features
### Dependencies
- Updated `@runloop/api-client` from ^1.0.0 to 1.3.0
## Testing
- [x] I have tested locally
- [x] All existing tests pass (192/192)
- [x] Build passes without errors
- [x] Linter passes (43 warnings related to TypeScript `any` in existing
code)
## Review Feedback Addressed
- Fixed code duplication: removed duplicate `formatTimeAgo` functions
- Fixed unused variable warnings: prefixed unused parameters with
underscore
- Removed unused import: `updateNetworkPolicy` from
NetworkPolicyDetailScreen
- Reduced lint warnings from 52 to 43
## Checklist
- [x] My code follows the code style of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have updated the documentation accordingly (README.md)
- [x] My changes generate no new warnings
- [x] New and existing unit tests pass locally with my changes1 parent b4c9ccb commit 138aed3
60 files changed
Lines changed: 7218 additions & 1240 deletions
File tree
- src
- commands
- blueprint
- devbox
- network-policy
- object
- snapshot
- components
- form
- hooks
- router
- screens
- services
- store
- utils
- tests/__tests__/components
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
133 | 142 | | |
134 | 143 | | |
135 | 144 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
0 commit comments