<component name="libraryTable">
<library name="space-idea-sdk" type="repository">
- <properties maven-id="com.jetbrains:space-idea-sdk:1.1.62875">
+ <properties maven-id="com.jetbrains:space-idea-sdk:1.1.63274">
<exclude>
<dependency maven-id="org.jetbrains.kotlin:kotlin-stdlib" />
<dependency maven-id="org.jetbrains.kotlin:kotlin-reflect" />
<dependency maven-id="org.jetbrains.kotlin:kotlin-scripting-common" />
<dependency maven-id="org.jetbrains.kotlin:kotlin-scripting-dependencies" />
<dependency maven-id="org.jetbrains.kotlin:kotlin-scripting-jvm" />
+ <dependency maven-id="org.apache.commons:commons-compress" />
</exclude>
</properties>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/space-idea-sdk/1.1.62875/space-idea-sdk-1.1.62875.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/space-idea-sdk/1.1.63274/space-idea-sdk-1.1.63274.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/reactivex/rxkotlin/0.55.0/rxkotlin-0.55.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/reactivex/rxjava/1.1.1/rxjava-1.1.1.jar!/" />
</CLASSES>
</library>
</orderEntry>
<orderEntry type="library" name="gson" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="commons-compress" level="project" />
</component>
</module>
\ No newline at end of file
import net.miginfocom.layout.LC
import net.miginfocom.swing.MigLayout
import runtime.reactive.Property
-import runtime.reactive.map
+import runtime.reactive.property.map
import java.awt.event.ActionListener
import javax.swing.JComponent
import javax.swing.JPanel
-// 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.
+// Copyright 2000-2021 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 com.intellij.space.components
import circlet.client.api.englishFullName
import runtime.reactive.Property
import runtime.reactive.awaitFirst
import runtime.reactive.filter
-import runtime.reactive.mapInit
+import runtime.reactive.property.mapInit
@Service
class SpaceUserAvatarProvider : Disposable {
- private val log = logger<SpaceUserAvatarProvider>()
+ companion object {
+ private val LOG = logger<SpaceUserAvatarProvider>()
+
+ fun getInstance(): SpaceUserAvatarProvider = service()
+ }
private val lifetime: LifetimeSource = LifetimeSource()
ws.client.connectionStatus.filter { it is ConnectionStatus.Connected }.awaitFirst(ws.lifetime)
try {
- log.info { "loading user avatar: $avatarTID" }
+ LOG.info { "loading user avatar: $avatarTID" }
val loadedImage = imageLoader.loadImageAsync(avatarTID)?.await()
if (loadedImage == null) {
SpaceAvatarUtils.generateAvatars(id, name)
throw th
}
catch (e: Exception) {
- log.error { "user avatar not loaded: $e" }
+ LOG.error { "user avatar not loaded: $e" }
avatarPlaceholders
}
}
override fun dispose() {
lifetime.terminate()
}
-
- companion object {
- fun getInstance(): SpaceUserAvatarProvider = service()
- }
}
import runtime.persistence.InMemoryPersistence
import runtime.persistence.PersistenceConfiguration
import runtime.persistence.PersistenceKey
-import runtime.reactive.*
+import runtime.reactive.MutableProperty
+import runtime.reactive.Property
+import runtime.reactive.SequentialLifetimes
+import runtime.reactive.mutableProperty
+import runtime.reactive.property.map
import java.awt.Component
import java.net.URI
import java.net.URL
import org.slf4j.helpers.SubstituteLogger
import runtime.Ui
import runtime.reactive.*
+import runtime.reactive.property.flatMap
+import runtime.reactive.property.map
import java.nio.file.Files
import java.nio.file.Paths
import kotlin.io.path.name
-// 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.
+// Copyright 2000-2021 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 com.intellij.space.vcs
import circlet.client.api.*
import git4idea.repo.GitRepositoryChangeListener
import libraries.coroutines.extra.LifetimeSource
import runtime.async.backoff
-import runtime.reactive.*
+import runtime.reactive.MutableProperty
+import runtime.reactive.Property
+import runtime.reactive.awaitFirst
+import runtime.reactive.filter
+import runtime.reactive.property.mapInit
@Service
class SpaceProjectContext(project: Project) : Disposable {
-// 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.
+// Copyright 2000-2021 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 com.intellij.space.vcs.clone
import circlet.client.api.*
import circlet.platform.client.resolve
import circlet.platform.client.resolveRefsOrFetch
import circlet.platform.client.xTransformedPagedListOnFlux
-import com.intellij.space.settings.SpaceSettings
+import circlet.workspaces.Workspace
import com.intellij.space.settings.CloneType
import com.intellij.space.settings.CloneType.HTTP
+import com.intellij.space.settings.SpaceSettings
import com.intellij.space.vcs.SpaceHttpPasswordState
import com.intellij.space.vcs.SpaceKeysState
-import circlet.workspaces.Workspace
import com.intellij.util.ui.cloneDialog.SearchableListItem
import libraries.coroutines.extra.Lifetime
import libraries.coroutines.extra.Lifetimed
import runtime.dispatchInterval
import runtime.reactive.MutableProperty
import runtime.reactive.Property
-import runtime.reactive.mapInit
import runtime.reactive.mutableProperty
+import runtime.reactive.property.mapInit
import runtime.utils.mapToSet
internal class SpaceCloneComponentViewModel(
-// 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.
+// Copyright 2000-2021 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 com.intellij.space.vcs.review
import com.intellij.openapi.Disposable
import com.intellij.ui.components.panels.Wrapper
import com.intellij.util.ui.UIUtil
import libraries.coroutines.extra.Lifetime
+import runtime.reactive.property.map
-internal class ReviewLoginComponent(parentDisposable: Disposable,
- lifetime: Lifetime,
- project: Project,
- spaceProjectInfo: SpaceProjectInfo,
- spaceRepos: Set<SpaceRepoInfo>) {
+internal class ReviewLoginComponent(
+ parentDisposable: Disposable,
+ lifetime: Lifetime,
+ project: Project,
+ spaceProjectInfo: SpaceProjectInfo,
+ spaceRepos: Set<SpaceRepoInfo>
+) {
- private val vm = ReviewVm(lifetime, project, spaceProjectInfo.key)
+ private val isLoggedIn = lifetime.map(SpaceWorkspaceComponent.getInstance().workspace) {
+ it != null
+ }
val view = Wrapper().apply {
background = UIUtil.getListBackground()
}
init {
- vm.isLoggedIn.forEach(lifetime) { isLoggedIn ->
+ isLoggedIn.forEach(lifetime) { isLoggedIn ->
if (!isLoggedIn) {
val loginLabel = LinkLabel.create(SpaceBundle.message("action.com.intellij.space.actions.SpaceLoginAction.text")) {
SpaceSettingsPanel.openSettings(null)
+++ /dev/null
-// 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 com.intellij.space.vcs.review
-
-import circlet.client.api.ProjectKey
-import com.intellij.openapi.project.Project
-import com.intellij.space.components.SpaceWorkspaceComponent
-import libraries.coroutines.extra.Lifetime
-import libraries.coroutines.extra.Lifetimed
-import runtime.reactive.Property
-import runtime.reactive.map
-
-internal class ReviewVm(override val lifetime: Lifetime,
- project: Project,
- projectKey: ProjectKey) : Lifetimed {
-
- val isLoggedIn: Property<Boolean> = map(SpaceWorkspaceComponent.getInstance().workspace) {
- it != null
- }
-}
-// 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.
+// Copyright 2000-2021 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 com.intellij.space.vcs.review
import circlet.workspaces.Workspace
import icons.SpaceIcons
import libraries.coroutines.extra.LifetimeSource
import runtime.reactive.Property
-import runtime.reactive.mapInit
+import runtime.reactive.property.mapInit
@Service
internal class SpaceCodeReviewTabManager(private val project: Project) {
-// 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.
+// Copyright 2000-2021 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 com.intellij.space.vcs.review
import com.intellij.openapi.components.service
import com.intellij.space.components.SpaceWorkspaceComponent
import com.intellij.space.vcs.SpaceProjectContext
import libraries.coroutines.extra.LifetimeSource
-import runtime.reactive.mapInit
+import runtime.reactive.property.mapInit
internal class SpaceReviewToolWindowFactory : ToolWindowFactory, DumbAware {
private val lifetime: LifetimeSource = LifetimeSource()
val workspace = SpaceWorkspaceComponent.getInstance().workspace
val spaceProjectContext = SpaceProjectContext.getInstance(project).context
- val isToolwindowAvailable = lifetime.mapInit(workspace, spaceProjectContext, false) { ws, context->
+ val isToolwindowAvailable = lifetime.mapInit(workspace, spaceProjectContext, false) { ws, context ->
ws ?: return@mapInit false
return@mapInit context.isAssociatedWithSpaceRepository
}
import com.intellij.util.ui.codereview.BaseHtmlEditorPane
import com.intellij.util.ui.codereview.InlineIconButton
import icons.SpaceIcons
-import runtime.reactive.map
+import runtime.reactive.property.map
internal open class HtmlEditorPane : BaseHtmlEditorPane(SpaceIcons::class.java)
import libraries.coroutines.extra.nested
import runtime.Ui
import runtime.reactive.*
+import runtime.reactive.property.mapInit
private const val MAX_CHANGES_TO_LOAD = 1024
-// 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.
+// Copyright 2000-2021 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 com.intellij.space.vcs.review.details
import circlet.client.api.ProjectKey
import libraries.coroutines.extra.Lifetime
import libraries.coroutines.extra.Lifetimed
import runtime.reactive.*
-import runtime.reactive.property.seqCombineLatest
+import runtime.reactive.property.map
+import runtime.reactive.property.mapInit
internal sealed class SpaceReviewDetailsVm<R : CodeReviewRecord>(
final override val lifetime: Lifetime,
private val participantsRef: Property<Ref<CodeReviewParticipants>?> = lastLoadedValueOrNull(participantsProperty)
private val pendingCounterRef: Property<Ref<CodeReviewPendingMessageCounter>?> = lastLoadedValueOrNull(pendingCounterAsync(client))
- val participantsVm: Property<SpaceReviewParticipantsVm?> = seqCombineLatest(participantsRef,
- pendingCounterRef) { participantsRef, pendingCounterRef ->
+ val participantsVm: Property<SpaceReviewParticipantsVm?> = map(participantsRef, pendingCounterRef) { participantsRef, pendingCounterRef ->
if (participantsRef != null && pendingCounterRef != null) {
SpaceReviewParticipantsVmImpl(lifetime, projectKey, reviewRef, participantsRef, pendingCounterRef, review.value.identifier, workspace)
}
-// 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.
+// Copyright 2000-2021 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 com.intellij.space.vcs.review.details
import circlet.client.api.ProjectKey
import runtime.reactive.Property
import runtime.reactive.cellProperty
import runtime.reactive.live
-import runtime.reactive.property.combineLatest
+import runtime.reactive.property.map
internal class SpaceReviewParticipantsVmImpl(
override val lifetime: Lifetime,
override val me: TD_MemberProfile
get() = workspace.me.value
- override val controlVm: Property<ParticipantStateControlVM> = combineLatest(
+ override val controlVm: Property<ParticipantStateControlVM> = map(
review.property(),
reviewers,
- authors)
+ authors
+ )
{ reviewRecord, reviewers, authors ->
- if (reviewRecord.state != CodeReviewState.Opened) return@combineLatest ParticipantStateControlVM.WithoutControls
-
- createControlVm(reviewers, authors, reviewRecord)
+ if (reviewRecord.state != CodeReviewState.Opened) {
+ ParticipantStateControlVM.WithoutControls
+ }
+ else {
+ createControlVm(reviewers, authors, reviewRecord)
+ }
}
- private fun createControlVm(reviewers: List<CodeReviewParticipant>,
- authors: List<CodeReviewParticipant>,
- reviewRecord: CodeReviewRecord): ParticipantStateControlVM {
+ private fun createControlVm(
+ reviewers: List<CodeReviewParticipant>,
+ authors: List<CodeReviewParticipant>,
+ reviewRecord: CodeReviewRecord
+ ): ParticipantStateControlVM {
val meReviewer = reviewers.me()
val meAuthor = authors.me()
val isTurnBased = reviewRecord.turnBased == true
import com.intellij.space.vcs.review.details.SpaceReviewParticipantsVm
import libraries.coroutines.extra.Lifetime
import libraries.coroutines.extra.Lifetimed
-import runtime.reactive.*
+import runtime.reactive.MutableProperty
+import runtime.reactive.Property
+import runtime.reactive.flatten
+import runtime.reactive.property.map
+import runtime.reactive.property.mapInit
-internal class SpaceReviewersSelectorVm(override val lifetime: Lifetime,
- val review: CodeReviewRecord,
- val projectKey: ProjectKey,
- val client: KCircletClient,
- private val detailsVm: SpaceReviewDetailsVm<out CodeReviewRecord>,
- private val participantsVm: SpaceReviewParticipantsVm
+internal class SpaceReviewersSelectorVm(
+ override val lifetime: Lifetime,
+ val review: CodeReviewRecord,
+ val projectKey: ProjectKey,
+ val client: KCircletClient,
+ private val detailsVm: SpaceReviewDetailsVm<out CodeReviewRecord>,
+ participantsVm: SpaceReviewParticipantsVm
) : Lifetimed {
private val codeReviewService: CodeReviewService = client.codeReview
import com.intellij.space.vcs.SpaceProjectInfo
import libraries.coroutines.extra.Lifetime
import runtime.reactive.*
+import runtime.reactive.property.map
+import runtime.reactive.property.mapInit
internal class SpaceReviewsListVmImpl(override val lifetime: Lifetime,
-// 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.
+// Copyright 2000-2021 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 com.intellij.space.vcs.share
import circlet.client.api.PR_Project
import runtime.reactive.MutableProperty
import runtime.reactive.awaitFirst
import runtime.reactive.filter
-import runtime.reactive.mapInit
+import runtime.reactive.property.mapInit
class SpaceShareProjectVM(val lifetime: LifetimeSource) {
@Suppress("RemoveExplicitTypeArguments")