From 1cfd574712a71b15a9fa13e374cfe616580a2881 Mon Sep 17 00:00:00 2001 From: "Gleb O. Ivaniczkij" Date: Sat, 24 Aug 2024 20:39:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=20?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82=20=D0=BF=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B8=D0=BE=D0=B4=D0=B8=D1=87=D0=BD=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt | 11 +++++++++-- .../ru/csasq/cit_is_bot/ui/screens/ScenariosScreen.kt | 8 ++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt b/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt index c79e4d3..01638f9 100644 --- a/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt +++ b/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt @@ -79,6 +79,13 @@ fun ScenarioDialog( usePlatformDefaultWidth = false, ), ) { + val nameState = remember { + mutableStateOf(scenarioDialogState.value?.name) + } + val timeState = remember { + mutableStateOf(scenarioDialogState.value?.time) + } + Dialog( onDismissRequest = { scenarioDialogState.value = null @@ -222,7 +229,7 @@ fun ScenarioDialog( ), ) { OutlinedTextField( - value = "", + value = nameState.value ?: "", onValueChange = {}, modifier = Modifier .fillMaxWidth(), @@ -250,7 +257,7 @@ fun ScenarioDialog( .height(8.dp), ) OutlinedTextField( - value = "", + value = timeState.value ?: "", onValueChange = {}, modifier = Modifier .fillMaxWidth(), diff --git a/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/screens/ScenariosScreen.kt b/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/screens/ScenariosScreen.kt index 2b651cf..c27e079 100644 --- a/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/screens/ScenariosScreen.kt +++ b/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/screens/ScenariosScreen.kt @@ -27,15 +27,14 @@ import ru.csasq.cit_is_bot.ui.dialogs.ScenarioDialog data class Scenario( val id: Int? = null, val name: String, - val daysOfWeek: String, val time: String, val messageNumber: String, val isEnabled: Boolean, ) val scenarioList = listOf( - Scenario(1, "Текущее состояние сотрудников", "ПН-ПТ", "11:00", "1 сообщение", true), - Scenario(2, "Планы на обед", "ПН-ПТ", "11:45-12:00", "2 сообщения", false), + Scenario(1, "Текущее состояние сотрудников", "0 11 * * 1-5", "1 сообщение", true), + Scenario(2, "Планы на обед", "45 11 * * 1-5", "2 сообщения", false), ) @Composable @@ -86,7 +85,6 @@ fun ScenariosScreen( onClick = { scenarioDialogState.value = Scenario( name = "", - daysOfWeek = "", time = "", messageNumber = "", isEnabled = true, @@ -100,8 +98,6 @@ fun ScenariosScreen( mutableStateOf(it.isEnabled) } val captionAnnotatedString = buildAnnotatedString { - append(it.daysOfWeek) - append(" \u2022 ") append(it.time) append(" \u2022 ") append(it.messageNumber)