Skip to content

Commit 11be558

Browse files
committed
impl: support for Toolbox 2.6.0.38881 (6)
- fix compiler errors for the intro page - associated strings converted to LocalizedString instances - observable properties are now moved to Kotlin's StateFlow
1 parent 4e5ef77 commit 11be558

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ class CoderRemoteProvider(
220220
* Just displays the deployment URL at the moment, but we could use this as
221221
* a form for creating new environments.
222222
*/
223-
override fun getNewEnvironmentUiPage(): UiPage = NewEnvironmentPage(getDeploymentURL()?.first)
223+
override fun getNewEnvironmentUiPage(): UiPage =
224+
NewEnvironmentPage(serviceLocator, i18n.pnotr(getDeploymentURL()?.first ?: ""))
224225

225226
/**
226227
* We always show a list of environments.
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package com.coder.toolbox.views
22

3+
import com.jetbrains.toolbox.api.core.ServiceLocator
4+
import com.jetbrains.toolbox.api.localization.LocalizableString
35
import com.jetbrains.toolbox.api.ui.components.UiField
6+
import kotlinx.coroutines.flow.MutableStateFlow
7+
import kotlinx.coroutines.flow.StateFlow
48

59

610
/**
@@ -10,6 +14,7 @@ import com.jetbrains.toolbox.api.ui.components.UiField
1014
* For now we just use this to display the deployment URL since we do not
1115
* support creating environments from the plugin.
1216
*/
13-
class NewEnvironmentPage(private val deploymentURL: String?) : CoderPage(deploymentURL ?: "") {
14-
override val fields: MutableList<UiField> = mutableListOf()
17+
class NewEnvironmentPage(serviceLocator: ServiceLocator, deploymentURL: LocalizableString) :
18+
CoderPage(serviceLocator, deploymentURL) {
19+
override val fields: StateFlow<List<UiField>> = MutableStateFlow(emptyList())
1520
}

0 commit comments

Comments
 (0)