-
Notifications
You must be signed in to change notification settings - Fork 61
[Refactor]: add api clients and refactor components #509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor]: add api clients and refactor components #509
Conversation
…SwaggerPicker, WorkspaceSelector
…61023-exploring-refactoring-opportunities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This refactor adds centralized API client services and standardizes error handling across the workspace editor components. The changes replace direct axios calls with dedicated service layers for improved maintainability and consistency.
Key changes:
- Introduced structured API clients (
workspaceApi,specsApi,commandApi,cliApi,errorHandlerApi) to centralize HTTP communication - Standardized error handling with a unified
errorHandlerApi.getErrorMessage()method - Converted multiple components from direct axios usage to service-based API calls
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/web/src/views/workspace/WorkspaceSelector.tsx | Replaced axios calls with workspaceApi and specsApi, standardized error handling |
| src/web/src/views/workspace/WSEditorSwaggerPicker.tsx | Migrated to workspaceApi/specsApi, converted Promise chains to async/await |
| src/web/src/views/workspace/WSEditorCommandGroupContent.tsx | Updated to use commandApi and errorHandlerApi |
| src/web/src/views/workspace/WSEditorCommandContent.tsx | Replaced axios with commandApi, standardized error handling |
| src/web/src/views/workspace/WSEditorCommandArgumentsContent.tsx | Migrated to commandApi and errorHandlerApi |
| src/web/src/views/workspace/WSEditorClientConfig.tsx | Updated to use workspaceApi, specsApi, and errorHandlerApi |
| src/web/src/views/workspace/WSEditor.tsx | Replaced axios calls with service APIs, simplified client config handling |
| src/web/src/views/cli/CLIModuleSelector.tsx | Migrated to cliApi and errorHandlerApi |
| src/web/src/views/cli/CLIModuleGenerator.tsx | Updated to use cliApi and standardized error handling |
| src/web/src/services/workspaceApi.ts | New service module for workspace-related API operations |
| src/web/src/services/specsApi.ts | New service module for specs and planes API operations |
| src/web/src/services/index.ts | Central export point for all service modules |
| src/web/src/services/errorHandlerApi.ts | New centralized error handling utility |
| src/web/src/services/commandApi.ts | New service module for command-related API operations |
| src/web/src/services/cliApi.ts | New service module for CLI-related API operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Current issues: