Skip to content

Commit 94299d7

Browse files
committed
updated
1 parent edb6c66 commit 94299d7

11 files changed

Lines changed: 27 additions & 41 deletions

File tree

cmp-android/dependencies/demoDebugRuntimeClasspath.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ io.ktor:ktor-websocket-serialization-jvm:3.1.3
261261
io.ktor:ktor-websocket-serialization:3.1.3
262262
io.ktor:ktor-websockets-jvm:3.1.3
263263
io.ktor:ktor-websockets:3.1.3
264-
org.jacoco:org.jacoco.agent:0.8.11
265264
org.jetbrains.androidx.core:core-bundle-android-debug:1.0.1
266265
org.jetbrains.androidx.core:core-bundle:1.0.1
267266
org.jetbrains.androidx.lifecycle:lifecycle-common:2.8.4

cmp-android/dependencies/prodDebugRuntimeClasspath.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ io.ktor:ktor-websocket-serialization-jvm:3.1.3
261261
io.ktor:ktor-websocket-serialization:3.1.3
262262
io.ktor:ktor-websockets-jvm:3.1.3
263263
io.ktor:ktor-websockets:3.1.3
264-
org.jacoco:org.jacoco.agent:0.8.11
265264
org.jetbrains.androidx.core:core-bundle-android-debug:1.0.1
266265
org.jetbrains.androidx.core:core-bundle:1.0.1
267266
org.jetbrains.androidx.lifecycle:lifecycle-common:2.8.4

core/common/src/commonMain/kotlin/com/mifos/core/common/utils/Constants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ object Constants {
4141
const val SEARCH_ENTITY_CENTER = "CENTER"
4242
const val CLIENT_NAME = "clientName"
4343
const val CLIENT_ID = "clientId"
44-
const val CLIENT_SURVEY="clientSurvey"
44+
const val CLIENT_SURVEY = "clientSurvey"
4545
const val ID = "id"
4646
const val CLIENT = "Client"
4747
const val CLIENTS = "clients"

core/network/src/commonMain/kotlin/com/mifos/core/network/datamanager/DataManagerSurveys.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import com.mifos.room.helper.SurveyDaoHelper
1919
import kotlinx.coroutines.ExperimentalCoroutinesApi
2020
import kotlinx.coroutines.flow.Flow
2121
import kotlinx.coroutines.flow.flatMapLatest
22-
import kotlinx.coroutines.flow.flow
2322

2423
/**
2524
* This DataManager is for Managing Survey API, In which Request is going to Server

feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientSurveyList/SurveyListScreen.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import com.mifos.core.designsystem.component.MifosCircularProgress
4444
import com.mifos.core.designsystem.component.MifosScaffold
4545
import com.mifos.core.designsystem.component.MifosSweetError
4646
import com.mifos.core.ui.components.MifosEmptyUi
47-
import com.mifos.core.ui.util.DevicePreview
4847
import com.mifos.room.entities.survey.SurveyEntity
4948
import org.jetbrains.compose.resources.stringResource
5049
import org.jetbrains.compose.ui.tooling.preview.Preview
@@ -74,7 +73,7 @@ internal fun SurveyListScreen(
7473
navigateBack = navigateBack,
7574
onRetry = { viewModel.loadSurveyList() },
7675
onCardClicked = {
77-
onCardClicked(clientId,it)
76+
onCardClicked(clientId, it)
7877
},
7978
)
8079
}
@@ -126,7 +125,7 @@ internal fun SurveyListScreen(
126125
@Composable
127126
private fun SurveyListContent(
128127
surveyList: List<SurveyEntity>,
129-
onCardClicked: (survey:SurveyEntity) -> Unit,
128+
onCardClicked: (survey: SurveyEntity) -> Unit,
130129
) {
131130
Column(
132131
modifier = Modifier.fillMaxSize(),

feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientSurveyList/SurveyListViewModel.kt

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ import com.mifos.core.common.utils.DataState
2121
import com.mifos.core.data.repository.SurveyListRepository
2222
import com.mifos.core.datastore.UserPreferencesRepository
2323
import com.mifos.room.entities.survey.QuestionDatasEntity
24-
import com.mifos.room.entities.survey.ResponseDatasEntity
2524
import com.mifos.room.entities.survey.SurveyEntity
2625
import kotlinx.coroutines.flow.MutableStateFlow
2726
import kotlinx.coroutines.flow.StateFlow
28-
import kotlinx.coroutines.flow.catch
2927
import kotlinx.coroutines.flow.first
3028
import kotlinx.coroutines.launch
3129

@@ -49,8 +47,8 @@ class SurveyListViewModel(
4947

5048
fun loadSurveyList() {
5149
viewModelScope.launch {
52-
repository.allSurvey().collect { result->
53-
when(result){
50+
repository.allSurvey().collect { result ->
51+
when (result) {
5452
is DataState.Error -> {
5553
_surveyListUiState.value =
5654
SurveyListUiState.ShowFetchingError(Res.string.feature_client_failed_to_fetch_surveys_list)
@@ -69,9 +67,9 @@ class SurveyListViewModel(
6967

7068
private fun loadDatabaseSurveys() {
7169
viewModelScope.launch {
72-
repository.databaseSurveys().collect { result->
73-
when(result){
74-
is DataState.Error-> {
70+
repository.databaseSurveys().collect { result ->
71+
when (result) {
72+
is DataState.Error -> {
7573
_surveyListUiState.value =
7674
SurveyListUiState.ShowFetchingError(Res.string.feature_client_failed_to_fetch_datatable)
7775
}
@@ -96,8 +94,8 @@ class SurveyListViewModel(
9694

9795
private fun loadDatabaseQuestionData(surveyId: Int, survey: SurveyEntity?) {
9896
viewModelScope.launch {
99-
repository.getDatabaseQuestionData(surveyId).collect { result->
100-
when(result){
97+
repository.getDatabaseQuestionData(surveyId).collect { result ->
98+
when (result) {
10199
is DataState.Error -> {
102100
_surveyListUiState.value =
103101
SurveyListUiState.ShowFetchingError(Res.string.feature_client_failed_to_load_db_question_data)
@@ -122,8 +120,8 @@ class SurveyListViewModel(
122120

123121
private fun loadDatabaseResponseDatas(questionId: Int, questionDatas: QuestionDatasEntity) {
124122
viewModelScope.launch {
125-
repository.getDatabaseResponseDatas(questionId).collect { result->
126-
when(result){
123+
repository.getDatabaseResponseDatas(questionId).collect { result ->
124+
when (result) {
127125
is DataState.Error -> {
128126
_surveyListUiState.value =
129127
SurveyListUiState.ShowFetchingError(Res.string.feature_client_failed_to_load_db_question_data)
@@ -132,7 +130,7 @@ class SurveyListViewModel(
132130
_surveyListUiState.value = SurveyListUiState.ShowProgressbar
133131
}
134132
is DataState.Success -> {
135-
val updatedQuestionDatas = questionDatas.copy(responseDatas = result.data )
133+
val updatedQuestionDatas = questionDatas.copy(responseDatas = result.data)
136134

137135
mSyncSurveyList = mSyncSurveyList.map { survey ->
138136
if (survey.id == questionDatas.surveyId) {

feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientSurveyQuestion/SurveyQuestionScreen.kt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import androidclient.feature.client.generated.resources.feature_client_next
1414
import androidclient.feature.client.generated.resources.feature_client_scorecard_created_successfully
1515
import androidclient.feature.client.generated.resources.feature_client_survey
1616
import androidx.compose.foundation.ExperimentalFoundationApi
17-
import androidx.compose.foundation.background
1817
import androidx.compose.foundation.layout.Box
1918
import androidx.compose.foundation.layout.Column
2019
import androidx.compose.foundation.layout.Row
@@ -51,7 +50,6 @@ import androidx.compose.runtime.saveable.rememberSaveable
5150
import androidx.compose.runtime.setValue
5251
import androidx.compose.ui.Alignment
5352
import androidx.compose.ui.Modifier
54-
import androidx.compose.ui.graphics.Color
5553
import androidx.compose.ui.text.style.TextAlign
5654
import androidx.compose.ui.unit.dp
5755
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -86,7 +84,7 @@ internal fun SurveyQuestionScreen(
8684

8785
val snackbarHostState = remember { SnackbarHostState() }
8886
val scope = rememberCoroutineScope()
89-
val survey=viewModel.survey
87+
val survey = viewModel.survey
9088

9189
if (survey != null) {
9290
val (questionData, optionsData) = processSurveyData(survey)
@@ -242,13 +240,13 @@ private fun SurveyQuestionContent(
242240
)
243241
}
244242

245-
RadioGroup(
246-
options = optionsData,
247-
selectedOptionIndex = selectedOption,
248-
onOptionSelected = {
249-
selectedOption = it
250-
},
251-
)
243+
RadioGroup(
244+
options = optionsData,
245+
selectedOptionIndex = selectedOption,
246+
onOptionSelected = {
247+
selectedOption = it
248+
},
249+
)
252250

253251
Button(
254252
onClick = {

feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientSurveySubmit/SurveySubmitScreen.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ import androidx.compose.foundation.layout.height
2323
import androidx.compose.foundation.layout.padding
2424
import androidx.compose.foundation.shape.RoundedCornerShape
2525
import androidx.compose.material3.Button
26-
import androidx.compose.material3.ButtonDefaults
2726
import androidx.compose.material3.Card
28-
import androidx.compose.material3.CardDefaults
2927
import androidx.compose.material3.MaterialTheme
3028
import androidx.compose.material3.SnackbarDuration
3129
import androidx.compose.material3.SnackbarHostState

feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientSurveySubmit/SurveySubmitViewModel.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ package com.mifos.feature.client.clientSurveySubmit
1212
import androidx.lifecycle.SavedStateHandle
1313
import androidx.lifecycle.ViewModel
1414
import androidx.lifecycle.viewModelScope
15-
import co.touchlab.kermit.Logger
1615
import com.mifos.core.common.utils.Constants
1716
import com.mifos.core.common.utils.DataState
1817
import com.mifos.core.data.repository.SurveySubmitRepository
1918
import com.mifos.core.datastore.UserPreferencesRepository
20-
import com.mifos.core.model.objects.runreport.client.ClientReportTypeItem
2119
import com.mifos.core.model.objects.surveys.Scorecard
2220
import com.mifos.room.entities.survey.SurveyEntity
2321
import kotlinx.coroutines.flow.MutableStateFlow

feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ import com.mifos.feature.client.clientSurveyQuestion.SurveyQuestionScreen
2929
import com.mifos.feature.client.createNewClient.CreateNewClientScreen
3030
import com.mifos.room.entities.accounts.savings.SavingAccountDepositTypeEntity
3131
import com.mifos.room.entities.noncore.DataTableEntity
32-
import com.mifos.room.entities.survey.QuestionDatasEntity
33-
import com.mifos.room.entities.survey.ResponseDatasEntity
3432
import com.mifos.room.entities.survey.SurveyEntity
3533
import kotlinx.serialization.json.Json
3634
import kotlin.reflect.KFunction4
@@ -89,8 +87,8 @@ fun NavGraphBuilder.clientNavGraph(
8987
)
9088
clientSurveyListRoute(
9189
onBackPressed = navController::popBackStack,
92-
onCardClicked = {clientId,list->
93-
navController.navigateToClientSurveyQuestionScreen(clientId,list)
90+
onCardClicked = { clientId, list ->
91+
navController.navigateToClientSurveyQuestionScreen(clientId, list)
9492
},
9593
)
9694
clientSurveyQuestionRoute(
@@ -280,9 +278,9 @@ fun NavController.navigateClientSurveyListScreen(clientId: Int) {
280278
navigate(ClientScreens.ClientSurveyListScreen.argument(clientId))
281279
}
282280

283-
fun NavController.navigateToClientSurveyQuestionScreen(clientId: Int,survey:SurveyEntity){
281+
fun NavController.navigateToClientSurveyQuestionScreen(clientId: Int, survey: SurveyEntity) {
284282
val arg = Json.encodeToString(survey)
285-
navigate(ClientScreens.ClientSurveyQuestionScreen.argument(clientId,arg))
283+
navigate(ClientScreens.ClientSurveyQuestionScreen.argument(clientId, arg))
286284
}
287285

288286
fun NavController.navigateCreateClientScreen() {

0 commit comments

Comments
 (0)