Documentation
Class: NewConnection
Description:
The NewConnection
component renders a modal that allows users to connect their repositories to the application. It provides a selection of providers (GitHub, GitLab, Bitbucket) and handles the connection process. The component utilizes state management to control the displayed content within the modal and handles actions for each provider.
Methods
Method: gitlabAction
Description: This method handles the action for connecting a GitLab repository. It first checks if the user is already logged in with GitLab. If not, it prompts the user to provide a GitLab token. If the user is logged in and has a valid token, it attempts to synchronize the repository and displays an appropriate status message.
Parameters: None.
Returns:
void
: This method does not return any value.
Throws: None.
Example:
// Triggered when the GitLab option is clicked
gitlabAction();
Method: githubAction
Description: This method handles the action for connecting a GitHub repository. It checks if the user is already logged in with GitHub. If so, it redirects the user to the GitHub installation URL. If not, it redirects the user to the GitHub authentication URL with the necessary parameters.
Parameters: None.
Returns:
void
: This method does not return any value.
Throws: None.
Example:
// Triggered when the GitHub option is clicked
githubAction();
Method: close
Description: This method closes the connection modal and removes the hashtag from the URL.
Parameters: None.
Returns:
void
: This method does not return any value.
Throws: None.
Example:
// Triggered when the close button is clicked
close();
==========