@@ -16,7 +16,6 @@ import com.intellij.openapi.util.Key
16
16
import com.intellij.ui.EditorNotificationPanel
17
17
import com.intellij.util.containers.isNullOrEmpty
18
18
import com.redhat.devtools.intellij.kubernetes.editor.EditorResource
19
- import com.redhat.devtools.intellij.kubernetes.editor.FILTER_PUSHED
20
19
import com.redhat.devtools.intellij.kubernetes.editor.Pushed
21
20
import com.redhat.devtools.intellij.kubernetes.editor.hideNotification
22
21
import com.redhat.devtools.intellij.kubernetes.editor.showNotification
@@ -46,10 +45,20 @@ class PushedNotification(private val editor: FileEditor, private val project: Pr
46
45
private fun createPanel (editorResources : Collection <EditorResource >): EditorNotificationPanel {
47
46
val panel = EditorNotificationPanel ()
48
47
val createdOrUpdated = editorResources
49
- .filter(FILTER_PUSHED )
50
- .groupBy { editorResource ->
51
- (editorResource.getState() as Pushed ).updated
48
+ .map { editorResource ->
49
+ Pair (editorResource.getState(), editorResource)
52
50
}
51
+ .filter { resourceByState ->
52
+ resourceByState.first is Pushed
53
+ }
54
+ .groupBy(
55
+ { resourceByState ->
56
+ (resourceByState.first as Pushed ).updated
57
+ },
58
+ { resourceByState ->
59
+ resourceByState.second
60
+ }
61
+ )
53
62
val created = createdOrUpdated[false ]
54
63
val updated = createdOrUpdated[true ]
55
64
panel.text = createText(created, updated)
0 commit comments