mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gig] Add an account menu to the welcome screen
GitOrigin-RevId: 0bc1bb8f74ab10f650c6dae1f3fafe8f379fb466
This commit is contained in:
committed by
intellij-monorepo-bot
parent
74cb188ae0
commit
5a3bc6504a
+15
-1
@@ -105,6 +105,13 @@ object GHAccountsUtil {
|
||||
fun createBrowserLoginAction(
|
||||
model: GHLoginModel, project: Project, parentComponent: JComponent
|
||||
): AnAction = DumbAwareAction.create(GithubBundle.message("action.Github.Accounts.AddGHAccount.text")) {
|
||||
loginViaBrowser(model, project, parentComponent)
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
fun loginViaBrowser(
|
||||
model: GHLoginModel, project: Project, parentComponent: JComponent?
|
||||
) {
|
||||
scopedDialog(project) {
|
||||
GHLoginDialog.OAuth(model, project, this, parentComponent).apply {
|
||||
setServer(GithubServerPath.DEFAULT_HOST, false)
|
||||
@@ -114,8 +121,15 @@ object GHAccountsUtil {
|
||||
|
||||
@ApiStatus.Internal
|
||||
fun createTokenLoginAction(
|
||||
model: GHLoginModel, project: Project, parentComponent: JComponent
|
||||
model: GHLoginModel, project: Project, parentComponent: JComponent,
|
||||
): AnAction = DumbAwareAction.create(GithubBundle.message("action.Github.Accounts.AddGHAccountWithToken.text")) {
|
||||
loginViaToken(model, project, parentComponent)
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
fun loginViaToken(
|
||||
model: GHLoginModel, project: Project, parentComponent: JComponent?,
|
||||
) {
|
||||
scopedDialog(project) {
|
||||
GHLoginDialog.Token(model, project, this, parentComponent).apply {
|
||||
title = GithubBundle.message("dialog.title.add.github.account")
|
||||
|
||||
+3
-1
@@ -8,6 +8,7 @@ import com.intellij.collaboration.ui.ExceptionUtil
|
||||
import com.intellij.openapi.components.service
|
||||
import icons.CollaborationToolsIcons
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.plugins.github.api.GithubApiRequestExecutor
|
||||
import org.jetbrains.plugins.github.api.GithubApiRequests
|
||||
import org.jetbrains.plugins.github.api.data.GithubUserDetailed
|
||||
@@ -18,7 +19,8 @@ import org.jetbrains.plugins.github.exceptions.GithubAuthenticationException
|
||||
import org.jetbrains.plugins.github.util.CachingGHUserAvatarLoader
|
||||
import java.awt.Image
|
||||
|
||||
internal class GHAccountsDetailsProvider(
|
||||
@ApiStatus.Internal
|
||||
class GHAccountsDetailsProvider(
|
||||
scope: CoroutineScope,
|
||||
private val executorSupplier: suspend (GithubAccount) -> GithubApiRequestExecutor?
|
||||
) : LazyLoadingAccountsDetailsProvider<GithubAccount, GithubUserDetailed>(scope, CollaborationToolsIcons.Review.DefaultAvatar) {
|
||||
|
||||
+4
-2
@@ -9,6 +9,7 @@ import com.intellij.openapi.components.service
|
||||
import icons.CollaborationToolsIcons
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.plugins.gitlab.GitLabServersManager
|
||||
import org.jetbrains.plugins.gitlab.api.GitLabApi
|
||||
import org.jetbrains.plugins.gitlab.api.dto.GitLabUserDTO
|
||||
@@ -20,12 +21,13 @@ import org.jetbrains.plugins.gitlab.mergerequest.ui.toolwindow.GitLabSelectorErr
|
||||
import org.jetbrains.plugins.gitlab.util.GitLabBundle
|
||||
import java.awt.Image
|
||||
|
||||
internal class GitLabAccountsDetailsProvider private constructor(
|
||||
@ApiStatus.Internal
|
||||
class GitLabAccountsDetailsProvider private constructor(
|
||||
scope: CoroutineScope,
|
||||
private val apiClientSupplier: suspend (GitLabAccount) -> GitLabApi?
|
||||
) : LazyLoadingAccountsDetailsProvider<GitLabAccount, GitLabUserDTO>(scope, CollaborationToolsIcons.Review.DefaultAvatar) {
|
||||
|
||||
constructor(
|
||||
internal constructor(
|
||||
scope: CoroutineScope,
|
||||
accountsModel: GitLabAccountsListModel,
|
||||
apiClientSupplier: suspend (GitLabAccount) -> GitLabApi?
|
||||
|
||||
Reference in New Issue
Block a user