From 06ff210bfa863cfddca522beb0e176527cce742a Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:44:37 +0900 Subject: [PATCH 01/14] =?UTF-8?q?[FEATURE]=20#85=20:=20=EB=A7=A4=EB=8B=88?= =?UTF-8?q?=EC=A0=80=EC=9D=B8=20=EA=B2=BD=EC=9A=B0,=20survey-check?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=84=ED=99=98=ED=95=98=EB=8A=94=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wap/wapp/feature/survey/SurveyScreen.kt | 98 +++---------------- 1 file changed, 14 insertions(+), 84 deletions(-) diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt index 5f65ab93f..e8220bafc 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt @@ -1,22 +1,10 @@ package com.wap.wapp.feature.survey -import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.items -import androidx.compose.material3.Card -import androidx.compose.material3.CardDefaults import androidx.compose.material3.Scaffold import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState -import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -26,13 +14,11 @@ import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme import com.wap.designsystem.component.WappMainTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText -import com.wap.wapp.core.model.survey.SurveyForm import com.wap.wapp.core.model.user.UserRole import kotlinx.coroutines.flow.collectLatest @@ -41,11 +27,13 @@ internal fun SurveyScreen( viewModel: SurveyViewModel, navigateToSignIn: () -> Unit, navigateToSurveyAnswer: (String) -> Unit, + navigateToSurveyCheck: () -> Unit, ) { val context = LocalContext.current val surveyFormListUiState = viewModel.surveyFormListUiState.collectAsStateWithLifecycle().value val snackBarHostState = remember { SnackbarHostState() } - var isShowGuestDialog by rememberSaveable { mutableStateOf(false) } + var isGuest by rememberSaveable { mutableStateOf(false) } + var isManager by rememberSaveable { mutableStateOf(false) } LaunchedEffect(true) { viewModel.surveyEvent.collectLatest { @@ -74,13 +62,18 @@ internal fun SurveyScreen( is SurveyViewModel.UserRoleUiState.Success -> { when (userRoleUiState.userRole) { UserRole.GUEST -> { - isShowGuestDialog = true + isGuest = true } // 비회원이 아닌 경우, 목록 호출 - UserRole.MEMBER, UserRole.MANAGER -> { + UserRole.MEMBER -> { viewModel.getSurveyFormList() } + + UserRole.MANAGER -> { + viewModel.getSurveyFormList() + isManager = true + } } } } @@ -104,82 +97,19 @@ internal fun SurveyScreen( is SurveyViewModel.SurveyFormListUiState.Success -> { SurveyContent( surveyFormList = surveyFormListUiState.surveyFormList, + isManager = isManager, paddingValues = paddingValues, selectedSurveyForm = viewModel::isSubmittedSurvey, + onSurveyCheckButtonClicked = navigateToSurveyCheck, ) } } } - if (isShowGuestDialog) { + if (isGuest) { SurveyGuestDialog( - onDismissRequest = { isShowGuestDialog = false }, + onDismissRequest = { isGuest = false }, onButtonClicked = navigateToSignIn, ) } } - -@Composable -private fun SurveyContent( - surveyFormList: List, - paddingValues: PaddingValues, - selectedSurveyForm: (String) -> Unit, -) { - LazyColumn( - verticalArrangement = Arrangement.spacedBy(8.dp), - modifier = Modifier - .padding(paddingValues) - .padding(horizontal = 16.dp), - ) { - items(surveyFormList) { surveyForm -> - if (surveyForm.isAfterDeadline()) { - SurveyFormItemCard( - surveyForm = surveyForm, - selectedSurveyForm = selectedSurveyForm, - ) - } - } - } -} - -@Composable -private fun SurveyFormItemCard( - surveyForm: SurveyForm, - selectedSurveyForm: (String) -> Unit, -) { - Card( - colors = CardDefaults.cardColors( - containerColor = WappTheme.colors.black25, - ), - modifier = Modifier - .fillMaxWidth() - .clickable { selectedSurveyForm(surveyForm.surveyFormId) }, - ) { - Column( - verticalArrangement = Arrangement.spacedBy(16.dp), - modifier = Modifier.padding(16.dp), - ) { - Row( - modifier = Modifier.fillMaxWidth(), - ) { - Text( - text = surveyForm.title, - color = WappTheme.colors.white, - style = WappTheme.typography.titleBold, - ) - Text( - text = surveyForm.calculateDeadline(), - color = WappTheme.colors.yellow34, - style = WappTheme.typography.captionMedium, - modifier = Modifier.fillMaxWidth(), - textAlign = TextAlign.End, - ) - } - Text( - text = surveyForm.content, - color = WappTheme.colors.grayBD, - style = WappTheme.typography.contentMedium, - ) - } - } -} From 272b902b12511daec4e70cc2c94afd4256e6645e Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:44:45 +0900 Subject: [PATCH 02/14] =?UTF-8?q?[FEATURE]=20#85=20:=20=EB=A7=A4=EB=8B=88?= =?UTF-8?q?=EC=A0=80=EC=9D=B8=20=EA=B2=BD=EC=9A=B0,=20survey-check?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=84=ED=99=98=ED=95=98=EB=8A=94=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wapp/feature/survey/navigation/SurveyNavigation.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/navigation/SurveyNavigation.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/navigation/SurveyNavigation.kt index 0a6642742..5b515da6a 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/navigation/SurveyNavigation.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/navigation/SurveyNavigation.kt @@ -15,14 +15,18 @@ fun NavController.navigateToSurvey(navOptions: NavOptions? = navOptions {}) { this.navigate(SurveyRoute.route, navOptions) } -fun NavController.navigateToSurveyAnswer(eventId: String, navOptions: NavOptions? = navOptions {}) { - navigate(SurveyRoute.answerRoute(eventId), navOptions) +fun NavController.navigateToSurveyAnswer( + surveyFormId: String, + navOptions: NavOptions? = navOptions {}, +) { + navigate(SurveyRoute.answerRoute(surveyFormId), navOptions) } fun NavGraphBuilder.surveyNavGraph( navigateToSurveyAnswer: (String) -> Unit, navigateToSurvey: () -> Unit, navigateToSignIn: () -> Unit, + navigateToSurveyCheck: () -> Unit, ) { composable(route = SurveyRoute.route) { SurveyScreen( @@ -31,6 +35,7 @@ fun NavGraphBuilder.surveyNavGraph( navigateToSurveyAnswer = { surveyFormId -> navigateToSurveyAnswer(surveyFormId) }, + navigateToSurveyCheck = navigateToSurveyCheck, ) } From 5860a97793a7cd44bd0f4130f9b1667f8e283cb4 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:45:33 +0900 Subject: [PATCH 03/14] =?UTF-8?q?[CHORE]=20#85=20:=20surveyScreen=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wap/wapp/feature/survey/SurveyContent.kt | 93 +++++++++++++++++++ .../wapp/feature/survey/SurveyFormItemCard.kt | 60 ++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyContent.kt create mode 100644 feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyFormItemCard.kt diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyContent.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyContent.kt new file mode 100644 index 000000000..ad20c8f20 --- /dev/null +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyContent.kt @@ -0,0 +1,93 @@ +package com.wap.wapp.feature.survey + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.ButtonDefaults +import androidx.compose.material3.ElevatedButton +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.dp +import com.wap.designsystem.WappTheme +import com.wap.wapp.core.designresource.R +import com.wap.wapp.core.model.survey.SurveyForm + +@Composable +internal fun SurveyContent( + surveyFormList: List, + isManager: Boolean, + paddingValues: PaddingValues, + selectedSurveyForm: (String) -> Unit, + onSurveyCheckButtonClicked: () -> Unit, +) { + Column( + verticalArrangement = Arrangement.spacedBy(16.dp), + horizontalAlignment = Alignment.End, + modifier = Modifier + .fillMaxSize() + .padding(start = 16.dp, end = 16.dp, bottom = 16.dp) + .padding(paddingValues), + ) { + LazyColumn( + verticalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier + .weight(1f) + .fillMaxWidth(), + ) { + items(surveyFormList) { surveyForm -> + if (surveyForm.isAfterDeadline()) { + SurveyFormItemCard( + surveyForm = surveyForm, + selectedSurveyForm = selectedSurveyForm, + ) + } + } + } + + if (isManager) { + SurveyCheckButton(onSurveyCheckButtonClicked = onSurveyCheckButtonClicked) + } + } +} + +@Composable +private fun SurveyCheckButton( + onSurveyCheckButtonClicked: () -> Unit, +) { + ElevatedButton( + modifier = Modifier.height(48.dp), + onClick = { onSurveyCheckButtonClicked() }, + colors = ButtonDefaults.buttonColors( + contentColor = WappTheme.colors.black, + containerColor = WappTheme.colors.yellow34, + disabledContentColor = WappTheme.colors.white, + disabledContainerColor = WappTheme.colors.grayA2, + ), + shape = RoundedCornerShape(10.dp), + content = { + Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { + Text( + text = "작성된 설문 보러가기", + style = WappTheme.typography.contentRegular, + ) + + Icon( + painter = painterResource(id = R.drawable.ic_magnifier), + contentDescription = "작성된 설문 보러가기 아이콘", + ) + } + }, + ) +} diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyFormItemCard.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyFormItemCard.kt new file mode 100644 index 000000000..09cd85e07 --- /dev/null +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyFormItemCard.kt @@ -0,0 +1,60 @@ + +package com.wap.wapp.feature.survey + +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.wap.designsystem.WappTheme +import com.wap.wapp.core.model.survey.SurveyForm + +@Composable +internal fun SurveyFormItemCard( + surveyForm: SurveyForm, + selectedSurveyForm: (String) -> Unit, +) { + Card( + colors = CardDefaults.cardColors( + containerColor = WappTheme.colors.black25, + ), + modifier = Modifier + .fillMaxWidth() + .clickable { selectedSurveyForm(surveyForm.surveyFormId) }, + ) { + Column( + verticalArrangement = Arrangement.spacedBy(16.dp), + modifier = Modifier.padding(16.dp), + ) { + Row( + horizontalArrangement = Arrangement.End, + modifier = Modifier.fillMaxWidth(), + ) { + Text( + text = surveyForm.title, + color = WappTheme.colors.white, + modifier = Modifier.weight(1f), + maxLines = 1, + style = WappTheme.typography.titleBold, + ) + Text( + text = surveyForm.calculateDeadline(), + color = WappTheme.colors.yellow34, + style = WappTheme.typography.captionMedium, + ) + } + Text( + text = surveyForm.content, + color = WappTheme.colors.grayBD, + style = WappTheme.typography.contentMedium, + ) + } + } +} From 6d6b391ba102a989bdc4c0e87c0d12b3fe3bc760 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:46:22 +0900 Subject: [PATCH 04/14] =?UTF-8?q?[FEATURE]=20#85=20:=20=EC=9E=91=EC=84=B1?= =?UTF-8?q?=EB=90=9C=20=EC=84=A4=EB=AC=B8=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EB=B6=88=EB=9F=AC=EC=98=A4=EB=8A=94=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../survey/check/SurveyCheckViewModel.kt | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckViewModel.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckViewModel.kt index fcb375ff6..54a4a2f20 100644 --- a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckViewModel.kt +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckViewModel.kt @@ -2,13 +2,11 @@ package com.wap.wapp.feature.survey.check import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.wap.wapp.core.domain.usecase.survey.GetSurveyUseCase +import com.wap.wapp.core.domain.usecase.survey.GetSurveyListUseCase import com.wap.wapp.core.model.survey.Survey import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.launch @@ -16,34 +14,33 @@ import javax.inject.Inject @HiltViewModel class SurveyCheckViewModel @Inject constructor( - private val getSurveyUseCase: GetSurveyUseCase, + private val getSurveyListUseCase: GetSurveyListUseCase, ) : ViewModel() { - private val _surveyCheckUiEvent: MutableSharedFlow = MutableSharedFlow() - val surveyCheckUiEvent: SharedFlow = _surveyCheckUiEvent.asSharedFlow() + private val _surveyListUiState: MutableStateFlow = + MutableStateFlow(SurveyListUiState.Init) + val surveyListUiState = _surveyListUiState.asStateFlow() - private val _surveyUiState: MutableStateFlow = - MutableStateFlow(SurveyUiState.Init) - val surveyUiState: StateFlow = _surveyUiState.asStateFlow() + private val _errorFlow: MutableSharedFlow = MutableSharedFlow() + val errorFlow = _errorFlow.asSharedFlow() - fun getSurvey(surveyId: String) { + init { + getSurveyList() + } + + private fun getSurveyList() { viewModelScope.launch { - getSurveyUseCase(surveyId) - .onSuccess { survey -> - _surveyUiState.value = SurveyUiState.Success(survey) + getSurveyListUseCase() + .onSuccess { surveyList -> + _surveyListUiState.value = SurveyListUiState.Success(surveyList) } .onFailure { throwable -> - _surveyCheckUiEvent.emit(SurveyUiEvent.Failure(throwable)) + _errorFlow.emit(throwable) } } } - sealed class SurveyUiState { - data object Init : SurveyUiState() - - data class Success(val survey: Survey) : SurveyUiState() - } - - sealed class SurveyUiEvent { - data class Failure(val throwable: Throwable) : SurveyUiEvent() + sealed class SurveyListUiState { + data object Init : SurveyListUiState() + data class Success(val surveyList: List) : SurveyListUiState() } } From aab285cda0bb4260c29c9cd6a957216e29e5dc4c Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:46:31 +0900 Subject: [PATCH 05/14] =?UTF-8?q?[FEATURE]=20#85=20:=20=EC=84=A4=EB=AC=B8?= =?UTF-8?q?=20=ED=99=95=EC=9D=B8=20=ED=99=94=EB=A9=B4=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/survey/check/SurveyCheckScreen.kt | 113 ++++++------------ 1 file changed, 35 insertions(+), 78 deletions(-) diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckScreen.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckScreen.kt index 18da64b02..c38c022f0 100644 --- a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckScreen.kt +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckScreen.kt @@ -1,116 +1,73 @@ package com.wap.wapp.feature.survey.check import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.verticalScroll +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items import androidx.compose.material3.Scaffold import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme -import com.wap.designsystem.component.WappButton +import com.wap.designsystem.component.CircleLoader +import com.wap.designsystem.component.WappMainTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText -import com.wap.wapp.core.model.survey.QuestionType import kotlinx.coroutines.flow.collectLatest @Composable -internal fun SurveyCheckRoute( +internal fun SurveyCheckScreen( viewModel: SurveyCheckViewModel = hiltViewModel(), - surveyId: String, - navigateToManagement: () -> Unit, + navigateToSurveyDetail: (String) -> Unit, ) { - val surveyUiState by viewModel.surveyUiState.collectAsStateWithLifecycle() + val surveyListUiState = viewModel.surveyListUiState.collectAsStateWithLifecycle().value val snackBarHostState = remember { SnackbarHostState() } LaunchedEffect(true) { - viewModel.getSurvey(surveyId) - } - - LaunchedEffect(true) { - viewModel.surveyCheckUiEvent.collectLatest { - when (it) { - is SurveyCheckViewModel.SurveyUiEvent.Failure -> { - snackBarHostState.showSnackbar(it.throwable.toSupportingText()) - } - } + viewModel.errorFlow.collectLatest { + snackBarHostState.showSnackbar(it.toSupportingText()) } } - SurveyCheckScreen( - snackBarHostState = snackBarHostState, - surveyUiState = surveyUiState, - onDoneButtonClicked = { navigateToManagement() }, - onBackButtonClicked = { navigateToManagement() }, - ) -} - -@Composable -internal fun SurveyCheckScreen( - snackBarHostState: SnackbarHostState, - surveyUiState: SurveyCheckViewModel.SurveyUiState, - onDoneButtonClicked: () -> Unit, - onBackButtonClicked: () -> Unit, -) { - val scrollState = rememberScrollState() - Scaffold( + modifier = Modifier.fillMaxSize(), + containerColor = WappTheme.colors.backgroundBlack, + snackbarHost = { SnackbarHost(snackBarHostState) }, topBar = { - SurveyCheckTopBar( - onBackButtonClicked = onBackButtonClicked, + WappMainTopBar( + titleRes = R.string.survey_check, + contentRes = R.string.survey_check_content, ) }, - snackbarHost = { SnackbarHost(snackBarHostState) }, - containerColor = WappTheme.colors.backgroundBlack, + contentWindowInsets = WindowInsets(0.dp), ) { paddingValues -> - Column( - modifier = Modifier - .padding(paddingValues) - .padding(vertical = 16.dp, horizontal = 8.dp) - .fillMaxSize() - .verticalScroll(scrollState), - verticalArrangement = Arrangement.spacedBy(32.dp), - ) { - when (surveyUiState) { - is SurveyCheckViewModel.SurveyUiState.Init -> {} - - is SurveyCheckViewModel.SurveyUiState.Success -> { - SurveyInformationCard( - title = surveyUiState.survey.title, - content = surveyUiState.survey.content, - userName = surveyUiState.survey.userName, - eventName = surveyUiState.survey.eventName, - ) - - Column( - verticalArrangement = Arrangement.spacedBy(32.dp), - ) { - surveyUiState.survey.surveyAnswerList.forEach { surveyAnswer -> - when (surveyAnswer.questionType) { - QuestionType.OBJECTIVE -> { - ObjectiveQuestionCard(surveyAnswer) - } + when (surveyListUiState) { + is SurveyCheckViewModel.SurveyListUiState.Init -> { + CircleLoader(modifier = Modifier.fillMaxSize()) + } - QuestionType.SUBJECTIVE -> { - SubjectiveQuestionCard(surveyAnswer) - } - } - } + is SurveyCheckViewModel.SurveyListUiState.Success -> { + LazyColumn( + verticalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier + .fillMaxSize() + .padding(start = 16.dp, end = 16.dp, bottom = 16.dp) + .padding(paddingValues), + ) { + val surveyList = surveyListUiState.surveyList + items(surveyList) { survey -> + SurveyItemCard( + onCardClicked = navigateToSurveyDetail, + survey = survey, + ) } - - WappButton( - onClick = onDoneButtonClicked, - textRes = com.wap.wapp.core.designsystem.R.string.done, - ) } } } From b4fd6073ed5ebb3c7f3da4bc26bcb839811484ac Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:46:57 +0900 Subject: [PATCH 06/14] =?UTF-8?q?[UI]=20#85=20:=20=EC=9E=91=EC=84=B1?= =?UTF-8?q?=EB=90=9C=20=EC=84=A4=EB=AC=B8=20=EB=AA=A9=EB=A1=9D=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=ED=85=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/survey/check/SurveyItemCard.kt | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyItemCard.kt diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyItemCard.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyItemCard.kt new file mode 100644 index 000000000..e958b9a05 --- /dev/null +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyItemCard.kt @@ -0,0 +1,61 @@ +package com.wap.wapp.feature.survey.check + +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.wap.designsystem.WappTheme +import com.wap.wapp.core.model.survey.Survey + +@Composable +internal fun SurveyItemCard( + onCardClicked: (String) -> Unit, + survey: Survey, +) { + Card( + colors = CardDefaults.cardColors( + containerColor = WappTheme.colors.black25, + ), + modifier = Modifier + .fillMaxWidth() + .clickable { onCardClicked(survey.surveyId) }, + ) { + Column( + verticalArrangement = Arrangement.spacedBy(16.dp), + modifier = Modifier.padding(16.dp), + ) { + Row( + horizontalArrangement = Arrangement.End, + modifier = Modifier.fillMaxWidth(), + ) { + Text( + text = survey.title, + modifier = Modifier.weight(1f), + maxLines = 1, + color = WappTheme.colors.white, + style = WappTheme.typography.titleBold, + ) + + Text( + text = survey.eventName, + color = WappTheme.colors.grayA2, + style = WappTheme.typography.captionMedium, + ) + } + + Text( + text = survey.userName, + color = WappTheme.colors.grayBD, + style = WappTheme.typography.contentMedium, + ) + } + } +} From 4ad4f4a388c2a34919656db24755b56e24ba1bc9 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:47:28 +0900 Subject: [PATCH 07/14] =?UTF-8?q?[CHORE]=20#85=20:=20Survey-check=20->=20s?= =?UTF-8?q?urvey-check/detail=20=EB=A1=9C=20path=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => detail}/ObjectiveQuestionCard.kt | 2 +- .../{ => detail}/SubjectiveQuestionCard.kt | 2 +- .../survey/check/detail/SurveyDetailScreen.kt | 114 ++++++++++++++++++ .../SurveyDetailTopBar.kt} | 5 +- .../check/detail/SurveyDetailViewModel.kt | 45 +++++++ .../{ => detail}/SurveyInformationCard.kt | 3 +- 6 files changed, 166 insertions(+), 5 deletions(-) rename feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/{ => detail}/ObjectiveQuestionCard.kt (98%) rename feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/{ => detail}/SubjectiveQuestionCard.kt (96%) create mode 100644 feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailScreen.kt rename feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/{SurveyCheckTopBar.kt => detail/SurveyDetailTopBar.kt} (93%) create mode 100644 feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailViewModel.kt rename feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/{ => detail}/SurveyInformationCard.kt (97%) diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/ObjectiveQuestionCard.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/ObjectiveQuestionCard.kt similarity index 98% rename from feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/ObjectiveQuestionCard.kt rename to feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/ObjectiveQuestionCard.kt index 89c9a4fbc..70d019c67 100644 --- a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/ObjectiveQuestionCard.kt +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/ObjectiveQuestionCard.kt @@ -1,4 +1,4 @@ -package com.wap.wapp.feature.survey.check +package com.wap.wapp.feature.survey.check.detail import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SubjectiveQuestionCard.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SubjectiveQuestionCard.kt similarity index 96% rename from feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SubjectiveQuestionCard.kt rename to feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SubjectiveQuestionCard.kt index 3943e3b60..586c7e715 100644 --- a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SubjectiveQuestionCard.kt +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SubjectiveQuestionCard.kt @@ -1,4 +1,4 @@ -package com.wap.wapp.feature.survey.check +package com.wap.wapp.feature.survey.check.detail import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailScreen.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailScreen.kt new file mode 100644 index 000000000..63331fec9 --- /dev/null +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailScreen.kt @@ -0,0 +1,114 @@ +package com.wap.wapp.feature.survey.check.detail + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Scaffold +import androidx.compose.material3.SnackbarHost +import androidx.compose.material3.SnackbarHostState +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import androidx.hilt.navigation.compose.hiltViewModel +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.wap.designsystem.WappTheme +import com.wap.designsystem.component.WappButton +import com.wap.wapp.core.commmon.extensions.toSupportingText +import com.wap.wapp.core.model.survey.QuestionType +import kotlinx.coroutines.flow.collectLatest + +@Composable +internal fun SurveyDetailRoute( + viewModel: SurveyDetailViewModel = hiltViewModel(), + surveyId: String, + navigateToSurveyCheck: () -> Unit, +) { + val surveyUiState by viewModel.surveyUiState.collectAsStateWithLifecycle() + val snackBarHostState = remember { SnackbarHostState() } + + LaunchedEffect(true) { + viewModel.getSurvey(surveyId) + } + + LaunchedEffect(true) { + viewModel.errorFlow.collectLatest { + snackBarHostState.showSnackbar(it.toSupportingText()) + } + } + + SurveyDetailScreen( + snackBarHostState = snackBarHostState, + surveyUiState = surveyUiState, + onDoneButtonClicked = { navigateToSurveyCheck() }, + onBackButtonClicked = { navigateToSurveyCheck() }, + ) +} + +@Composable +internal fun SurveyDetailScreen( + snackBarHostState: SnackbarHostState, + surveyUiState: SurveyDetailViewModel.SurveyUiState, + onDoneButtonClicked: () -> Unit, + onBackButtonClicked: () -> Unit, +) { + val scrollState = rememberScrollState() + + Scaffold( + topBar = { + SurveyDetailTopBar( + onBackButtonClicked = onBackButtonClicked, + ) + }, + snackbarHost = { SnackbarHost(snackBarHostState) }, + containerColor = WappTheme.colors.backgroundBlack, + ) { paddingValues -> + Column( + modifier = Modifier + .padding(paddingValues) + .padding(vertical = 16.dp, horizontal = 8.dp) + .fillMaxSize() + .verticalScroll(scrollState), + verticalArrangement = Arrangement.spacedBy(32.dp), + ) { + when (surveyUiState) { + is SurveyDetailViewModel.SurveyUiState.Init -> {} + + is SurveyDetailViewModel.SurveyUiState.Success -> { + SurveyInformationCard( + title = surveyUiState.survey.title, + content = surveyUiState.survey.content, + userName = surveyUiState.survey.userName, + eventName = surveyUiState.survey.eventName, + ) + + Column( + verticalArrangement = Arrangement.spacedBy(32.dp), + ) { + surveyUiState.survey.surveyAnswerList.forEach { surveyAnswer -> + when (surveyAnswer.questionType) { + QuestionType.OBJECTIVE -> { + ObjectiveQuestionCard(surveyAnswer) + } + + QuestionType.SUBJECTIVE -> { + SubjectiveQuestionCard(surveyAnswer) + } + } + } + } + + WappButton( + onClick = onDoneButtonClicked, + textRes = com.wap.wapp.core.designsystem.R.string.done, + ) + } + } + } + } +} diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckTopBar.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailTopBar.kt similarity index 93% rename from feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckTopBar.kt rename to feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailTopBar.kt index 6e8578020..ec08152d3 100644 --- a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyCheckTopBar.kt +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailTopBar.kt @@ -1,4 +1,4 @@ -package com.wap.wapp.feature.survey.check +package com.wap.wapp.feature.survey.check.detail import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.WindowInsets @@ -17,10 +17,11 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.wap.designsystem.WappTheme import com.wap.wapp.core.designresource.R.drawable +import com.wap.wapp.feature.survey.check.R @OptIn(ExperimentalMaterial3Api::class) @Composable -internal fun SurveyCheckTopBar( +internal fun SurveyDetailTopBar( onBackButtonClicked: () -> Unit, ) { CenterAlignedTopAppBar( diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailViewModel.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailViewModel.kt new file mode 100644 index 000000000..065e8370b --- /dev/null +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyDetailViewModel.kt @@ -0,0 +1,45 @@ +package com.wap.wapp.feature.survey.check.detail + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.wap.wapp.core.domain.usecase.survey.GetSurveyUseCase +import com.wap.wapp.core.model.survey.Survey +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.MutableSharedFlow +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.SharedFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asSharedFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.launch +import javax.inject.Inject + +@HiltViewModel +class SurveyDetailViewModel @Inject constructor( + private val getSurveyUseCase: GetSurveyUseCase, +) : ViewModel() { + private val _errorFlow: MutableSharedFlow = MutableSharedFlow() + val errorFlow: SharedFlow = _errorFlow.asSharedFlow() + + private val _surveyUiState: MutableStateFlow = + MutableStateFlow(SurveyUiState.Init) + val surveyUiState: StateFlow = _surveyUiState.asStateFlow() + + fun getSurvey(surveyId: String) { + viewModelScope.launch { + getSurveyUseCase(surveyId) + .onSuccess { survey -> + _surveyUiState.value = SurveyUiState.Success(survey) + } + .onFailure { throwable -> + _errorFlow.emit(throwable) + } + } + } + + sealed class SurveyUiState { + data object Init : SurveyUiState() + + data class Success(val survey: Survey) : SurveyUiState() + } +} diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyInformationCard.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyInformationCard.kt similarity index 97% rename from feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyInformationCard.kt rename to feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyInformationCard.kt index e49c282b1..bb29d5ce1 100644 --- a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/SurveyInformationCard.kt +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/detail/SurveyInformationCard.kt @@ -1,4 +1,4 @@ -package com.wap.wapp.feature.survey.check +package com.wap.wapp.feature.survey.check.detail import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -17,6 +17,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.wap.designsystem.WappTheme +import com.wap.wapp.feature.survey.check.R @Composable internal fun SurveyInformationCard( From c9834e931bb67c90c86686bfa4468216cd9e156d Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:48:09 +0900 Subject: [PATCH 08/14] =?UTF-8?q?[FEATURE]=20#85=20:=20Survey=20->=20surve?= =?UTF-8?q?y-check=20/=20survey-check=20->=20survey-detail=20/=20survey-de?= =?UTF-8?q?tail=20->=20survey-check=20=ED=99=94=EB=A9=B4=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/wap/wapp/navigation/WappNavHost.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt b/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt index ce9e1de05..80ba7518b 100644 --- a/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt +++ b/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt @@ -30,7 +30,9 @@ import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingNavi import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingScreen import com.wap.wapp.feature.splash.navigation.splashNavigationRoute import com.wap.wapp.feature.splash.navigation.splashScreen -import com.wap.wapp.feature.survey.check.navigation.surveyCheckScreen +import com.wap.wapp.feature.survey.check.navigation.navigateToSurveyCheck +import com.wap.wapp.feature.survey.check.navigation.navigateToSurveyDetail +import com.wap.wapp.feature.survey.check.navigation.surveyCheckNavGraph import com.wap.wapp.feature.survey.navigation.navigateToSurvey import com.wap.wapp.feature.survey.navigation.navigateToSurveyAnswer import com.wap.wapp.feature.survey.navigation.surveyNavGraph @@ -77,9 +79,11 @@ fun WappNavHost( navigateToSurvey = navController::navigateToSurvey, navigateToSurveyAnswer = navController::navigateToSurveyAnswer, navigateToSignIn = navController::navigateToSignIn, + navigateToSurveyCheck = navController::navigateToSurveyCheck, ) - surveyCheckScreen( - navigateToManagement = navController::navigateToManagement, + surveyCheckNavGraph( + navigateToSurveyCheck = navController::navigateToSurveyCheck, + navigateToSurveyDetail = navController::navigateToSurveyDetail, ) managementSurveyNavGraph( navigateToManagement = navController::navigateToManagement, From aeb5698ef957ee190e6748a2af5b9b0c0e4c7cd6 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:48:22 +0900 Subject: [PATCH 09/14] =?UTF-8?q?[FEATURE]=20#85=20:=20=EC=84=A4=EB=AC=B8?= =?UTF-8?q?=20=ED=99=95=EC=9D=B8=20=EB=AA=A8=EB=93=88=20=EB=84=A4=EB=B9=84?= =?UTF-8?q?=EA=B2=8C=EC=9D=B4=EC=85=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../check/navigation/SurveyCheckNavigation.kt | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/navigation/SurveyCheckNavigation.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/navigation/SurveyCheckNavigation.kt index a9b4d4d26..b713b69cc 100644 --- a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/navigation/SurveyCheckNavigation.kt +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/navigation/SurveyCheckNavigation.kt @@ -7,32 +7,47 @@ import androidx.navigation.NavType import androidx.navigation.compose.composable import androidx.navigation.navArgument import androidx.navigation.navOptions -import com.wap.wapp.feature.survey.check.SurveyCheckRoute +import com.wap.wapp.feature.survey.check.SurveyCheckScreen +import com.wap.wapp.feature.survey.check.detail.SurveyDetailRoute -const val SURVEY_CHECK_ROUTE = "survey/check/{surveyId}" - -fun NavController.navigateToSurveyCheck( +fun NavController.navigateToSurveyDetail( surveyId: String, navOptions: NavOptions? = navOptions {}, ) { - this.navigate("survey/check/$surveyId", navOptions) + this.navigate(SurveyCheckRoute.surveyDetailRoute(surveyId), navOptions) +} + +fun NavController.navigateToSurveyCheck(navOptions: NavOptions? = navOptions {}) { + this.navigate(SurveyCheckRoute.surveyCheckRoute, navOptions) } -fun NavGraphBuilder.surveyCheckScreen( - navigateToManagement: () -> Unit, +fun NavGraphBuilder.surveyCheckNavGraph( + navigateToSurveyDetail: (String) -> Unit, + navigateToSurveyCheck: () -> Unit, ) { + composable(route = SurveyCheckRoute.surveyCheckRoute) { + SurveyCheckScreen( + navigateToSurveyDetail = navigateToSurveyDetail, + ) + } + composable( - route = SURVEY_CHECK_ROUTE, + route = SurveyCheckRoute.surveyDetailRoute("{id}"), arguments = listOf( - navArgument("surveyId") { + navArgument("id") { type = NavType.StringType }, ), ) { navBackStackEntry -> - val surveyId = navBackStackEntry.arguments?.getString("surveyId") ?: "" - SurveyCheckRoute( - navigateToManagement = navigateToManagement, + val surveyId = navBackStackEntry.arguments?.getString("id") ?: "" + SurveyDetailRoute( + navigateToSurveyCheck = navigateToSurveyCheck, surveyId = surveyId, ) } } + +object SurveyCheckRoute { + const val surveyCheckRoute = "survey/check" + fun surveyDetailRoute(surveyId: String) = "survey/detail/$surveyId" +} From c4dd5cef644c1234309148d69cbd11b28f622494 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:49:09 +0900 Subject: [PATCH 10/14] =?UTF-8?q?[FEATURE]=20#85=20:=20=EC=84=A4=EB=AC=B8?= =?UTF-8?q?=20=ED=99=95=EC=9D=B8=20=EB=AA=A8=EB=93=88=20=EB=84=A4=EB=B9=84?= =?UTF-8?q?=EA=B2=8C=EC=9D=B4=EC=85=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../survey/check/navigation/SurveyCheckNavigation.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/navigation/SurveyCheckNavigation.kt b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/navigation/SurveyCheckNavigation.kt index b713b69cc..d853fc4ee 100644 --- a/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/navigation/SurveyCheckNavigation.kt +++ b/feature/survey-check/src/main/java/com/wap/wapp/feature/survey/check/navigation/SurveyCheckNavigation.kt @@ -13,13 +13,10 @@ import com.wap.wapp.feature.survey.check.detail.SurveyDetailRoute fun NavController.navigateToSurveyDetail( surveyId: String, navOptions: NavOptions? = navOptions {}, -) { - this.navigate(SurveyCheckRoute.surveyDetailRoute(surveyId), navOptions) -} +) = this.navigate(SurveyCheckRoute.surveyDetailRoute(surveyId), navOptions) -fun NavController.navigateToSurveyCheck(navOptions: NavOptions? = navOptions {}) { +fun NavController.navigateToSurveyCheck(navOptions: NavOptions? = navOptions {}) = this.navigate(SurveyCheckRoute.surveyCheckRoute, navOptions) -} fun NavGraphBuilder.surveyCheckNavGraph( navigateToSurveyDetail: (String) -> Unit, From 41e811ab5d1d47c19491c1b893e0ff314271435f Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 14:49:31 +0900 Subject: [PATCH 11/14] =?UTF-8?q?[CHORE]=20#85=20:=20Image/String=20Resour?= =?UTF-8?q?ce=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/drawable/ic_magnifier.xml | 9 +++++++++ feature/survey-check/src/main/res/values/strings.xml | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 core/designresource/src/main/res/drawable/ic_magnifier.xml diff --git a/core/designresource/src/main/res/drawable/ic_magnifier.xml b/core/designresource/src/main/res/drawable/ic_magnifier.xml new file mode 100644 index 000000000..70296bddf --- /dev/null +++ b/core/designresource/src/main/res/drawable/ic_magnifier.xml @@ -0,0 +1,9 @@ + + + diff --git a/feature/survey-check/src/main/res/values/strings.xml b/feature/survey-check/src/main/res/values/strings.xml index e154b6647..1d7a88ea7 100644 --- a/feature/survey-check/src/main/res/values/strings.xml +++ b/feature/survey-check/src/main/res/values/strings.xml @@ -4,4 +4,6 @@ 이름 다음 일정 + 설문 확인 + 구성원이 작성한 설문을 확인하세요 ! From 53639d2da01cf80cb3b185d1df6e42792a794554 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 16:15:13 +0900 Subject: [PATCH 12/14] =?UTF-8?q?[CHORE]=20#85=20:=20Raw=20->=20String=20R?= =?UTF-8?q?esource=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/wap/wapp/feature/survey/SurveyContent.kt | 6 ++++-- feature/survey/src/main/res/values/strings.xml | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyContent.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyContent.kt index ad20c8f20..6f3c0c1af 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyContent.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyContent.kt @@ -19,9 +19,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.wap.designsystem.WappTheme import com.wap.wapp.core.designresource.R +import com.wap.wapp.feature.survey.R.string import com.wap.wapp.core.model.survey.SurveyForm @Composable @@ -79,13 +81,13 @@ private fun SurveyCheckButton( content = { Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { Text( - text = "작성된 설문 보러가기", + text = stringResource(string.go_to_survey_check), style = WappTheme.typography.contentRegular, ) Icon( painter = painterResource(id = R.drawable.ic_magnifier), - contentDescription = "작성된 설문 보러가기 아이콘", + contentDescription = stringResource(string.survey_check_description), ) } }, diff --git a/feature/survey/src/main/res/values/strings.xml b/feature/survey/src/main/res/values/strings.xml index 2855ada2f..3eb026338 100644 --- a/feature/survey/src/main/res/values/strings.xml +++ b/feature/survey/src/main/res/values/strings.xml @@ -14,4 +14,6 @@ 앗 회원이 아니시네요 ! 회원만 설문을 작성할 수 있어요. 비회원으로 둘러보기 + 작성된 설문 보러가기 + 작성된 설문 보러가기 아이콘 From ea18423d0f4005201bc7dd68dbca6ca9fa8a677c Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 16:15:36 +0900 Subject: [PATCH 13/14] =?UTF-8?q?[STYLE]=20#85=20:=20=EB=B9=88=20=EA=B0=9C?= =?UTF-8?q?=ED=96=89=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/wap/wapp/feature/survey/SurveyFormItemCard.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyFormItemCard.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyFormItemCard.kt index 09cd85e07..0d2c71ee7 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyFormItemCard.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyFormItemCard.kt @@ -1,4 +1,3 @@ - package com.wap.wapp.feature.survey import androidx.compose.foundation.clickable From da4b8ee41b9e02a0f73c72fdcf0f5be29eebd43a Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sat, 13 Jan 2024 16:16:18 +0900 Subject: [PATCH 14/14] =?UTF-8?q?[STYLE]=20#85=20:=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=20=EC=8A=A4=EC=BD=94=ED=94=84=20=EC=86=8C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt index e8220bafc..bb5a64b7d 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt @@ -66,9 +66,7 @@ internal fun SurveyScreen( } // 비회원이 아닌 경우, 목록 호출 - UserRole.MEMBER -> { - viewModel.getSurveyFormList() - } + UserRole.MEMBER -> viewModel.getSurveyFormList() UserRole.MANAGER -> { viewModel.getSurveyFormList()