mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[github] Include timeline item type
GitOrigin-RevId: c91d68265af403fb91e94b460fd870661ee5e6b6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
338c082e83
commit
a890701fc5
+3
-3
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.github.api.data.pullrequest.timeline
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes
|
||||
@@ -47,7 +47,7 @@ SubscribedEvent | UnsubscribedEvent
|
||||
MilestonedEvent | DemilestonedEvent
|
||||
MentionedEvent | ReferencedEvent | CrossReferencedEvent
|
||||
*/
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "__typename", visible = false,
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "__typename", visible = true,
|
||||
defaultImpl = Unknown::class)
|
||||
@JsonSubTypes(
|
||||
JsonSubTypes.Type(name = "IssueComment", value = GHIssueComment::class),
|
||||
@@ -79,5 +79,5 @@ MentionedEvent | ReferencedEvent | CrossReferencedEvent
|
||||
JsonSubTypes.Type(name = "HeadRefRestoredEvent", value = GHPRHeadRefRestoredEvent::class)
|
||||
)
|
||||
interface GHPRTimelineItem {
|
||||
class Unknown : GHPRTimelineItem
|
||||
class Unknown(val __typename: String) : GHPRTimelineItem
|
||||
}
|
||||
+2
-1
@@ -49,7 +49,8 @@ class GHPRTimelineItemComponentFactory(private val reviewDataProvider: GHPRRevie
|
||||
is GHPullRequestReview -> createComponent(item)
|
||||
|
||||
is GHPRTimelineEvent -> eventComponentFactory.createComponent(item)
|
||||
else -> throw IllegalStateException("Unknown item type")
|
||||
is GHPRTimelineItem.Unknown -> throw IllegalStateException("Unknown item type: " + item.__typename)
|
||||
else -> error("Undefined item type")
|
||||
}
|
||||
}
|
||||
catch (e: Exception) {
|
||||
|
||||
Reference in New Issue
Block a user