Skip to content
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

feat: integrate openapi-fetch #67

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

35C4n0r
Copy link
Contributor

@35C4n0r 35C4n0r commented Mar 9, 2025

No description provided.

@35C4n0r 35C4n0r marked this pull request as draft March 9, 2025 18:43
@35C4n0r 35C4n0r marked this pull request as ready for review March 10, 2025 02:56
@gemanor gemanor requested a review from Copilot March 16, 2025 20:05

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request integrates the openapi‐fetch approach into the API calls and updates various components to use the new endpoints and hooks. Key changes include modifying ESLint configuration to ignore specific API directories, refactoring API calls in hooks (e.g. useApiKeyApi) and authentication flow components (e.g. LoginFlow, AuthProvider) to utilize openapi‐fetch, and updating multiple UI components (e.g. MemberComponent, RepositoryKey, SelectOrganization) to support these changes.

Reviewed Changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated no comments.

Show a summary per file
File Description
eslint.config.js Added an ignore rule for a specific API directory to prevent linting on generated code.
source/components/env/MemberComponent.tsx Updated API key type and role handling to align with new API contracts.
source/components/pdp/PDPCheckComponent.tsx Modified request building and response handling based on the new API hooks.
source/components/gitops/RepositoryKey.tsx Refactored API imports and enhanced validation logic with a useCallback hook.
source/hooks/useApiKeyApi.ts Switched API calls to use the authenticatedApiClient from openapi-fetch and adjusted type safety.
Other components (GitHubComponent, LoginFlow, AuthProvider, SelectOrganization, SelectEnvironment, SignupComponent, CopyComponent, login.tsx, SSHKey.tsx) Updated to reflect changes in API interactions, error handling, and usage of new hooks such as useUnauthenticatedApi.
Comments suppressed due to low confidence (3)

source/components/SelectProject.tsx:60

  • setLoading(false) is called immediately after initiating the async fetchProjects call outside its completion. Move the setLoading(false) call inside the async function after the data is successfully fetched to ensure accurate loading state.
setLoading(false);

source/components/AuthProvider.tsx:80

  • Using process.exit(1) in a React effect can lead to abrupt termination of the application. Consider handling the error by displaying an error message or utilizing React error boundaries instead.
if (error) { process.exit(1); }

source/components/LoginFlow.tsx:63

  • setLoading(false) is invoked immediately after the asynchronous authenticateUser call, potentially before the authentication finishes. It is recommended to await the completion of authenticateUser and then update the loading state appropriately.
setLoading(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants