mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[collab] Fix selection in reviewer selector popups (IJPL-165077)
#IJPL-165077 Fixed Selection used the filtered list models to provide the list of selected users. Instead, it should use the original list model. GitOrigin-RevId: d02105a115e4237f10b12887dea20000fc6f5bda
This commit is contained in:
committed by
intellij-monorepo-bot
parent
38a51afba2
commit
d19c6fe865
@@ -1585,7 +1585,7 @@ f:com.intellij.collaboration.ui.codereview.diff.viewer.DiffViewerUtilKt
|
||||
- sf:showAndAwait(com.intellij.openapi.ui.popup.JBPopup,com.intellij.ui.awt.RelativePoint,com.intellij.collaboration.ui.codereview.list.search.ShowDirection,kotlin.coroutines.Continuation):java.lang.Object
|
||||
- sf:showAndAwaitListSubmission(com.intellij.openapi.ui.popup.JBPopup,com.intellij.ui.awt.RelativePoint,com.intellij.collaboration.ui.codereview.list.search.ShowDirection,kotlin.coroutines.Continuation):java.lang.Object
|
||||
- sf:showAndAwaitSubmission(com.intellij.openapi.ui.popup.JBPopup,javax.swing.JList,com.intellij.ui.awt.RelativePoint,com.intellij.collaboration.ui.codereview.list.search.ShowDirection,kotlin.coroutines.Continuation):java.lang.Object
|
||||
- sf:showAndAwaitSubmissions(com.intellij.openapi.ui.popup.JBPopup,javax.swing.JList,com.intellij.ui.awt.RelativePoint,com.intellij.collaboration.ui.codereview.list.search.ShowDirection,kotlin.coroutines.Continuation):java.lang.Object
|
||||
- sf:showAndAwaitSubmissions(com.intellij.openapi.ui.popup.JBPopup,javax.swing.ListModel,com.intellij.ui.awt.RelativePoint,com.intellij.collaboration.ui.codereview.list.search.ShowDirection,kotlin.coroutines.Continuation):java.lang.Object
|
||||
*:com.intellij.collaboration.ui.util.popup.PopupItemPresentation
|
||||
- a:getFullText():java.lang.String
|
||||
- a:getIcon():javax.swing.Icon
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ object ChooserPopupUtil {
|
||||
|
||||
CollaborationToolsPopupUtil.configureSearchField(popup, popupConfig)
|
||||
PopupUtil.setPopupToggleComponent(popup, point.component)
|
||||
popup.showAndAwaitSubmissions(list, point, popupConfig.showDirection)
|
||||
popup.showAndAwaitSubmissions(listModel, point, popupConfig.showDirection)
|
||||
}
|
||||
|
||||
private fun <T> createList(listModel: CollectionListModel<T>, renderer: ListCellRenderer<T>): JBList<T> =
|
||||
|
||||
+5
-4
@@ -18,6 +18,7 @@ import com.intellij.util.ui.UIUtil
|
||||
import kotlinx.coroutines.*
|
||||
import java.awt.Point
|
||||
import javax.swing.JList
|
||||
import javax.swing.ListModel
|
||||
import kotlin.coroutines.resume
|
||||
|
||||
internal object CollaborationToolsPopupUtil {
|
||||
@@ -70,9 +71,9 @@ suspend fun <T> JBPopup.showAndAwaitSubmission(list: JList<T>, point: RelativePo
|
||||
return waitForChoiceAsync(list)
|
||||
}
|
||||
|
||||
suspend fun <T> JBPopup.showAndAwaitSubmissions(list: JList<SelectableWrapper<T>>, point: RelativePoint, showDirection: ShowDirection): List<T> {
|
||||
suspend fun <T> JBPopup.showAndAwaitSubmissions(originalListModel: ListModel<SelectableWrapper<T>>, point: RelativePoint, showDirection: ShowDirection): List<T> {
|
||||
showPopup(point, showDirection)
|
||||
return waitForMultipleChoiceAsync(list)
|
||||
return waitForMultipleChoiceAsync(originalListModel)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,12 +95,12 @@ private suspend fun <T> JBPopup.waitForChoiceAsync(list: JList<T>): T {
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun <T> JBPopup.waitForMultipleChoiceAsync(list: JList<SelectableWrapper<T>>): List<T> {
|
||||
private suspend fun <T> JBPopup.waitForMultipleChoiceAsync(originalListModel: ListModel<SelectableWrapper<T>>): List<T> {
|
||||
checkDisposed()
|
||||
return try {
|
||||
suspendCancellableCoroutine<List<T>> { continuation ->
|
||||
addChoicesPopupListener(continuation) {
|
||||
list.model.items
|
||||
originalListModel.items
|
||||
.filter { item -> item.isSelected }
|
||||
.map { item -> item.value }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user