[gig] Search cloneable repositories for selected account

GitOrigin-RevId: d76149db62fe9d9e6f31ff44cd01a804c250d8b3
This commit is contained in:
Anna Rakhmukova
2025-04-14 18:51:25 +02:00
committed by intellij-monorepo-bot
parent 1a80f44269
commit 12cd226d47
4 changed files with 9 additions and 2 deletions

View File

@@ -397,7 +397,8 @@ private suspend fun <D> Wrapper.bindContentImpl(
}
}
private fun JPanel.runPreservingFocus(runnable: () -> Unit) {
@ApiStatus.Internal
fun JPanel.runPreservingFocus(runnable: () -> Unit) {
val focused = CollaborationToolsUIUtil.isFocusParent(this)
runnable()
if (focused) {

View File

@@ -2,4 +2,6 @@ fragment projectForClone on Project {
nameWithNamespace
fullPath
httpUrlToRepo
sshUrlToRepo
description
}

View File

@@ -18,6 +18,8 @@ data class GitLabProjectForCloneDTO(
val nameWithNamespace: @Nls String,
val fullPath: @NlsSafe String,
val httpUrlToRepo: @NlsSafe String?,
val sshUrlToRepo: @NlsSafe String?,
val description: @NlsSafe String?
)
class GitLabProjectsForCloneDTO(

View File

@@ -11,6 +11,7 @@ import com.intellij.collaboration.api.page.ApiPageUtil
import com.intellij.collaboration.util.resolveRelative
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.plugins.gitlab.api.*
import org.jetbrains.plugins.gitlab.api.dto.*
import org.jetbrains.plugins.gitlab.mergerequest.api.dto.GitLabMergeRequestDTO
@@ -64,8 +65,9 @@ suspend fun GitLabApi.Rest.getProjectUsers(uri: URI): HttpResponse<out List<GitL
}
}
@ApiStatus.Internal
@SinceGitLab("13.0")
internal fun GitLabApi.GraphQL.getCloneableProjects(): Flow<List<GitLabProjectForCloneDTO>> =
fun GitLabApi.GraphQL.getCloneableProjects(): Flow<List<GitLabProjectForCloneDTO>> =
ApiPageUtil.createGQLPagesFlow { page ->
val parameters = page.asParameters()
val request = gitLabQuery(GitLabGQLQuery.GET_MEMBER_PROJECTS_FOR_CLONE, parameters)