mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
refactor [github]: use the full user names where possible
Won't work most of the time, because REST API doesn't return the full name GitOrigin-RevId: 14e2cf25d94d9dfe714656e1b06ecb71b77c81ca
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e6a4dc8817
commit
cb1d1da194
+4
-13
@@ -11,6 +11,7 @@ import kotlinx.coroutines.flow.flow
|
||||
import org.jetbrains.annotations.Nls
|
||||
import org.jetbrains.plugins.github.i18n.GithubBundle
|
||||
import org.jetbrains.plugins.github.ui.icons.GHAvatarIconsProvider
|
||||
import org.jetbrains.plugins.github.ui.util.GHUIUtil
|
||||
import javax.swing.JComponent
|
||||
|
||||
internal class GHPRSearchPanelFactory(vm: GHPRSearchPanelViewModel, private val avatarIconsProvider: GHAvatarIconsProvider) :
|
||||
@@ -41,12 +42,7 @@ internal class GHPRSearchPanelFactory(vm: GHPRSearchPanelViewModel, private val
|
||||
ChooserPopupUtil.showAsyncChooserPopup(
|
||||
point,
|
||||
itemsLoader = flow { emit(runCatching { vm.getAuthors() }) },
|
||||
presenter = {
|
||||
PopupItemPresentation.Simple(
|
||||
it.shortName,
|
||||
avatarIconsProvider.getIcon(it.avatarUrl, Avatar.Sizes.BASE),
|
||||
it.name?.let { fullName -> "(${fullName})" })
|
||||
}
|
||||
presenter = GHUIUtil.SelectionPresenters.Users(avatarIconsProvider)
|
||||
)?.login
|
||||
},
|
||||
DropDownComponentFactory(vm.labelFilterState)
|
||||
@@ -54,7 +50,7 @@ internal class GHPRSearchPanelFactory(vm: GHPRSearchPanelViewModel, private val
|
||||
ChooserPopupUtil.showAsyncChooserPopup(
|
||||
point,
|
||||
itemsLoader = flow { emit(runCatching { vm.getLabels() }) },
|
||||
presenter = { PopupItemPresentation.Simple(it.name) }
|
||||
presenter = GHUIUtil.SelectionPresenters.Labels()
|
||||
)?.name
|
||||
},
|
||||
DropDownComponentFactory(vm.assigneeFilterState)
|
||||
@@ -62,12 +58,7 @@ internal class GHPRSearchPanelFactory(vm: GHPRSearchPanelViewModel, private val
|
||||
ChooserPopupUtil.showAsyncChooserPopup(
|
||||
point,
|
||||
itemsLoader = flow { emit(runCatching { vm.getAssignees() }) },
|
||||
presenter = {
|
||||
PopupItemPresentation.Simple(
|
||||
it.shortName,
|
||||
avatarIconsProvider.getIcon(it.avatarUrl, Avatar.Sizes.BASE),
|
||||
it.name?.let { fullName -> "($fullName)" })
|
||||
}
|
||||
presenter = GHUIUtil.SelectionPresenters.Users(avatarIconsProvider)
|
||||
)?.login
|
||||
},
|
||||
DropDownComponentFactory(vm.reviewFilterState)
|
||||
|
||||
@@ -47,7 +47,7 @@ internal object GHUIUtil {
|
||||
PopupItemPresentation.Simple(
|
||||
it.shortName,
|
||||
avatarIconsProvider.getIcon(it.avatarUrl, Avatar.Sizes.BASE),
|
||||
null
|
||||
it.name
|
||||
)
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ internal object GHUIUtil {
|
||||
PopupItemPresentation.Simple(
|
||||
it.login,
|
||||
avatarIconsProvider.getIcon(it.avatarUrl, Avatar.Sizes.BASE),
|
||||
null
|
||||
it.name
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user