From f2019aa5e53d6d1740ae02a3dd87abed847aebcf Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 6 Feb 2024 21:18:19 +0900 Subject: [PATCH 01/18] =?UTF-8?q?[CHORE]=20#95=20:=20=EB=8B=A4=EC=9D=8C/?= =?UTF-8?q?=EC=A0=9C=EC=B6=9C=20=EB=B2=84=ED=8A=BC=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EC=83=9D=EC=84=B1=20->=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EB=82=B4=EC=97=90=EC=84=9C=20=EB=B6=84=EA=B8=B0?= =?UTF-8?q?=EC=97=90=20=EB=94=B0=EB=9D=BC=20=ED=85=8D=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EB=A7=8C=20=EB=B3=80=EA=B2=BD=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/survey/answer/SurveyAnswerForm.kt | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt index dc420784..3ae13463 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt @@ -66,9 +66,9 @@ internal fun SurveyAnswerForm( modifier = Modifier.weight(1f), ) - SurveyAnswerButton( - isLastQuestion = isLastQuestion, - onButtonClicked = onNextQuestionButtonClicked, + WappButton( + textRes = if (isLastQuestion) R.string.submit else R.string.next, + onClick = { onNextQuestionButtonClicked() }, isEnabled = isButtonEnabled(surveyQuestion.questionType, subjectiveAnswer), modifier = Modifier.weight(1f), ) @@ -76,30 +76,6 @@ internal fun SurveyAnswerForm( } } -@Composable -private fun SurveyAnswerButton( - isLastQuestion: Boolean, - onButtonClicked: () -> Unit, - isEnabled: Boolean, - modifier: Modifier, -) { - if (isLastQuestion) { - WappButton( - textRes = R.string.submit, - onClick = { onButtonClicked() }, - isEnabled = isEnabled, - modifier = modifier, - ) - } else { - WappButton( - textRes = R.string.next, - onClick = { onButtonClicked() }, - isEnabled = isEnabled, - modifier = modifier, - ) - } -} - private fun isButtonEnabled( questionType: QuestionType, subjectiveAnswer: String, From 246961387222dc126af4360d16a22c72f80ca02b Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 6 Feb 2024 21:22:57 +0900 Subject: [PATCH 02/18] =?UTF-8?q?[CHORE]=20#95=20:=20LaunchedEffect=20?= =?UTF-8?q?=EC=95=88=20viewModel.apply=EB=A1=9C=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/management/ManagementScreen.kt | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt index 84b817ff..9dd99602 100644 --- a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt +++ b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt @@ -40,25 +40,27 @@ internal fun ManagementRoute( val eventsState by viewModel.eventList.collectAsStateWithLifecycle() LaunchedEffect(true) { - viewModel.getUserRole() // 유저 권한 검색 + viewModel.apply { + getUserRole() - viewModel.userRole.collectLatest { userRoleUiState -> - when (userRoleUiState) { - is ManagementViewModel.UserRoleUiState.Init -> { } - is ManagementViewModel.UserRoleUiState.Success -> { - when (userRoleUiState.userRole) { - UserRole.GUEST -> { showGuestScreen = true } - UserRole.MEMBER -> { showValidationScreen = true } - UserRole.MANAGER -> viewModel.getEventSurveyList() + userRole.collectLatest { userRoleUiState -> + when (userRoleUiState) { + is ManagementViewModel.UserRoleUiState.Init -> { } + is ManagementViewModel.UserRoleUiState.Success -> { + when (userRoleUiState.userRole) { + UserRole.GUEST -> { showGuestScreen = true } + UserRole.MEMBER -> { showValidationScreen = true } + UserRole.MANAGER -> viewModel.getEventSurveyList() + } } } } - } - viewModel.errorFlow.collectLatest { throwable -> - snackBarHostState.showSnackbar( - message = throwable.toSupportingText(), - ) + errorFlow.collectLatest { throwable -> + snackBarHostState.showSnackbar( + message = throwable.toSupportingText(), + ) + } } } From 1bfc1f4c9f8e44b162804af972f942021dbc9f67 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 6 Feb 2024 21:25:08 +0900 Subject: [PATCH 03/18] =?UTF-8?q?[CHORE]=20#95=20:=20=EB=B3=91=ED=95=A9=20?= =?UTF-8?q?=EC=B6=A9=EB=8F=8C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/wap/wapp/MainActivity.kt | 1 + .../feature/survey/answer/SurveyAnswerForm.kt | 30 ++----------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/com/wap/wapp/MainActivity.kt b/app/src/main/java/com/wap/wapp/MainActivity.kt index 9e3c8755..29a43d65 100644 --- a/app/src/main/java/com/wap/wapp/MainActivity.kt +++ b/app/src/main/java/com/wap/wapp/MainActivity.kt @@ -118,6 +118,7 @@ private fun handleBottomBarState( ManagementSurveyRoute.surveyFormRegistrationRoute -> setBottomBarState(false) eventRegistrationNavigationRoute -> setBottomBarState(false) SurveyRoute.answerRoute("{id}") ->setBottomBarState(false) + ManagementSurveyRoute.surveyFormEditRoute("{id}") -> setBottomBarState(false) else -> setBottomBarState(true) } diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt index 61582b85..db843423 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt @@ -66,9 +66,9 @@ internal fun SurveyAnswerForm( modifier = Modifier.weight(1f), ) - SurveyAnswerButton( - isLastQuestion = isLastQuestion, - onButtonClicked = onNextQuestionButtonClicked, + WappButton( + textRes = if (isLastQuestion) R.string.submit else R.string.next, + onClick = { onNextQuestionButtonClicked() }, isEnabled = checkQuestionTypeAndSubjectiveAnswer( questionType = surveyQuestion.questionType, subjectiveAnswer = subjectiveAnswer, @@ -79,30 +79,6 @@ internal fun SurveyAnswerForm( } } -@Composable -private fun SurveyAnswerButton( - isLastQuestion: Boolean, - isEnabled: Boolean, - onButtonClicked: () -> Unit, - modifier: Modifier, -) { - if (isLastQuestion) { - WappButton( - textRes = R.string.submit, - onClick = { onButtonClicked() }, - isEnabled = isEnabled, - modifier = modifier, - ) - } else { - WappButton( - textRes = R.string.next, - onClick = { onButtonClicked() }, - isEnabled = isEnabled, - modifier = modifier, - ) - } -} - private fun checkQuestionTypeAndSubjectiveAnswer( questionType: QuestionType, subjectiveAnswer: String, From bffbc80a6359a340efa22ede31846bf2fd69ef2c Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Fri, 23 Feb 2024 00:07:10 +0900 Subject: [PATCH 04/18] =?UTF-8?q?[UI]=20#126=20:=20=EC=9D=BC=EC=A0=95=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EB=82=A0=EC=A7=9C=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=EC=99=80=20=EB=B2=84=ED=8A=BC=EA=B0=84=EC=9D=98=20?= =?UTF-8?q?=EA=B0=84=EA=B2=A9=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/registration/EventRegistrationContent.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt index 759a93fa..1efaa205 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt @@ -72,7 +72,8 @@ internal fun EventRegistrationContent( modifier = modifier .fillMaxSize() .verticalScroll(scrollState) - .height(IntrinsicSize.Max), + .height(IntrinsicSize.Max) + .padding(top = 34.dp), // Indicator bottom padding 16 + Content top padding 34 = 50 ) { when (eventRegistrationState) { EventRegistrationState.EVENT_DETAILS -> EventDetailsContent( @@ -303,7 +304,7 @@ private fun EventScheduleContent( onCardClicked = { onEndTimePickerStateChanged(true) }, - modifier = Modifier.padding(top = 20.dp), + modifier = Modifier.padding(top = 20.dp, bottom = 40.dp), ) Spacer(modifier = Modifier.weight(1f)) From 0938fa772e8fca7bedcdf25bf4aaf867bed769a0 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Fri, 23 Feb 2024 00:07:35 +0900 Subject: [PATCH 05/18] =?UTF-8?q?[UI]=20#126=20:=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A1=A4=20=EC=BB=AC=EB=9F=BC=20=EC=99=B8=EB=B6=80=EC=97=90=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=EB=90=9C=20=ED=8C=A8=EB=94=A9=20->=20?= =?UTF-8?q?=EC=95=88=EC=AA=BD=EC=9D=98=20=ED=8C=A8=EB=94=A9=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../management/event/edit/EventEditScreen.kt | 6 ++++-- .../event/registration/EventRegistrationScreen.kt | 15 ++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt index 93475723..ba40b3a1 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt @@ -47,6 +47,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme import com.wap.designsystem.component.WappSubTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText +import com.wap.wapp.core.designresource.R.drawable import com.wap.wapp.feature.management.event.R import com.wap.wapp.feature.management.event.edit.EventEditViewModel.EventEditEvent import com.wap.wapp.feature.management.event.registration.EventRegistrationContent @@ -181,18 +182,19 @@ internal fun EventEditScreen( titleRes = R.string.event_edit, showLeftButton = true, showRightButton = true, + leftButtonDrawableRes = drawable.ic_close, onClickLeftButton = onBackButtonClicked, onClickRightButton = { showDeleteEventDialog = true }, ) EventEditStateIndicator( eventRegistrationState = currentEditState, - modifier = Modifier.padding(top = 16.dp, start = 20.dp, end = 20.dp), + modifier = Modifier.padding(vertical = 16.dp, horizontal = 20.dp), ) EventRegistrationContent( eventRegistrationState = currentEditState, - modifier = Modifier.padding(top = 50.dp, start = 20.dp, end = 20.dp), + modifier = Modifier.padding(horizontal = 20.dp), eventTitle = title, eventContent = content, location = location, diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt index 16a53c44..399b1613 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt @@ -31,6 +31,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme import com.wap.designsystem.component.WappSubTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText +import com.wap.wapp.core.designresource.R.drawable import com.wap.wapp.feature.management.event.R import kotlinx.coroutines.flow.collectLatest import java.time.LocalDate @@ -142,29 +143,25 @@ internal fun EventRegistrationScreen( Column( modifier = Modifier .fillMaxSize() - .padding(paddingValues) // paddingValue padding - .padding(top = 20.dp), // dp value padding + .padding(paddingValues) + .padding(top = 20.dp), ) { WappSubTopBar( titleRes = R.string.event_registration, showLeftButton = true, + leftButtonDrawableRes = drawable.ic_close, onClickLeftButton = onBackButtonClicked, ) EventRegistrationStateIndicator( eventRegistrationState = currentRegistrationState, - modifier = Modifier.padding(top = 16.dp, start = 20.dp, end = 20.dp), + modifier = Modifier.padding(horizontal = 20.dp, vertical = 16.dp), ) EventRegistrationContent( eventRegistrationState = currentRegistrationState, modifier = Modifier - .padding( - top = 50.dp, - start = 20.dp, - end = 20.dp, - bottom = 20.dp, - ), + .padding(start = 20.dp, end = 20.dp, bottom = 20.dp), eventTitle = title, eventContent = content, location = location, From 00ef3eef1cce328077a2b2bdf480e4339d07f588 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Fri, 23 Feb 2024 00:24:04 +0900 Subject: [PATCH 06/18] =?UTF-8?q?[UI]=20#126=20:=20=EC=9D=BC=EC=A0=95=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=8B=9C=20BottomBar=20Hide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/wap/wapp/MainActivity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/wap/wapp/MainActivity.kt b/app/src/main/java/com/wap/wapp/MainActivity.kt index 8f737474..8b6e9df7 100644 --- a/app/src/main/java/com/wap/wapp/MainActivity.kt +++ b/app/src/main/java/com/wap/wapp/MainActivity.kt @@ -28,6 +28,7 @@ import com.wap.wapp.core.domain.usecase.auth.SignInUseCase import com.wap.wapp.feature.attendance.management.navigation.attendanceManagementNavigationRoute import com.wap.wapp.feature.auth.signin.navigation.signInNavigationRoute import com.wap.wapp.feature.auth.signup.navigation.signUpNavigationRoute +import com.wap.wapp.feature.management.event.navigation.eventEditNavigationRoute import com.wap.wapp.feature.management.event.navigation.eventRegistrationNavigationRoute import com.wap.wapp.feature.management.survey.navigation.ManagementSurveyRoute import com.wap.wapp.feature.profile.profilesetting.navigation.profileSettingNavigationRoute @@ -114,6 +115,7 @@ private fun handleBottomBarState( ManagementSurveyRoute.surveyFormRegistrationRoute -> setBottomBarState(false) ManagementSurveyRoute.surveyFormEditRoute("{id}") -> setBottomBarState(false) eventRegistrationNavigationRoute -> setBottomBarState(false) + eventEditNavigationRoute -> setBottomBarState(false) SurveyRoute.answerRoute("{id}") -> setBottomBarState(false) surveyCheckRoute -> setBottomBarState(false) SurveyCheckRoute.surveyDetailRoute("{id}") -> setBottomBarState(false) From 98532a817e2841d96743704fe16c69150abbd969 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Mon, 26 Feb 2024 23:28:23 +0900 Subject: [PATCH 07/18] =?UTF-8?q?[FEATURE]=20#126=20:=20EventRegistrationS?= =?UTF-8?q?tate=20=EC=84=A4=EC=A0=95=20ViewModel=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95=20/=20=EB=8B=A4?= =?UTF-8?q?=EC=9D=8C=20=EC=83=81=ED=83=9C=EB=A5=BC=20=EB=B6=88=EB=9F=AC?= =?UTF-8?q?=EC=98=A4=EB=8A=94=20=EA=B2=8C=20=EC=95=84=EB=8B=8C=20=EC=9D=B8?= =?UTF-8?q?=EC=9E=90=EB=A1=9C=20=EB=84=98=EA=B8=B4=20=EC=83=81=ED=83=9C?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/edit/EventEditViewModel.kt | 65 ++++++++++--------- .../EventRegistrationViewModel.kt | 64 ++++++++++-------- 2 files changed, 72 insertions(+), 57 deletions(-) diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt index 46bf4550..fa1b789a 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt @@ -84,41 +84,48 @@ class EventEditViewModel @Inject constructor( _eventEndTime.value = eventTime } - fun setEventRegistrationState() { - if (_currentEditState.value == EventRegistrationState.EVENT_DETAILS) { - if (!isValidTitle()) { - emitValidationErrorMessage("행사 이름을 입력하세요.") - return + fun validateEvent(eventRegistrationState: EventRegistrationState): Boolean { + when (eventRegistrationState) { + EventRegistrationState.EVENT_DETAILS -> { + if (!isValidTitle()) { + emitValidationErrorMessage("행사 이름을 입력하세요.") + return false + } + + if (!isValidContent()) { + emitValidationErrorMessage("행사 내용을 입력하세요.") + return false + } } - if (!isValidContent()) { - emitValidationErrorMessage("행사 내용을 입력하세요.") - return + + EventRegistrationState.EVENT_SCHEDULE -> { + if (!isValidLocation()) { + emitValidationErrorMessage("장소를 입력하세요.") + return false + } } - _currentEditState.value = EventRegistrationState.EVENT_SCHEDULE } + return true } - fun updateEvent() { - if (!isValidLocation()) { - emitValidationErrorMessage("장소를 입력하세요.") - return - } + fun setEventRegistrationState(eventRegistrationState: EventRegistrationState) { + _currentEditState.value = eventRegistrationState + } - viewModelScope.launch { - updateEventUseCase( - eventTitle = _eventTitle.value, - eventContent = _eventContent.value, - eventLocation = _eventLocation.value, - eventStartDate = _eventStartDate.value, - eventStartTime = _eventStartTime.value, - eventEndDate = _eventEndDate.value, - eventEndTime = _eventEndTime.value, - eventId = _eventId.value, - ).onSuccess { - _eventEditEvent.emit(EventEditEvent.EditSuccess) - }.onFailure { throwable -> - _eventEditEvent.emit(EventEditEvent.Failure(throwable)) - } + fun updateEvent() = viewModelScope.launch { + updateEventUseCase( + eventTitle = _eventTitle.value, + eventContent = _eventContent.value, + eventLocation = _eventLocation.value, + eventStartDate = _eventStartDate.value, + eventStartTime = _eventStartTime.value, + eventEndDate = _eventEndDate.value, + eventEndTime = _eventEndTime.value, + eventId = _eventId.value, + ).onSuccess { + _eventEditEvent.emit(EventEditEvent.EditSuccess) + }.onFailure { throwable -> + _eventEditEvent.emit(EventEditEvent.Failure(throwable)) } } diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt index 2f0217db..fb531e98 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt @@ -86,39 +86,47 @@ class EventRegistrationViewModel @Inject constructor( _eventEndTime.value = eventTime } - fun setEventRegistrationState() { - if (_currentRegistrationState.value == EVENT_DETAILS) { - if (!isValidTitle()) { - emitValidationErrorMessage("행사 이름을 입력하세요.") - return + fun validateEvent(eventRegistrationState: EventRegistrationState): Boolean { + when (eventRegistrationState) { + EVENT_DETAILS -> { + if (!isValidTitle()) { + emitValidationErrorMessage("행사 이름을 입력하세요.") + return false + } + + if (!isValidContent()) { + emitValidationErrorMessage("행사 내용을 입력하세요.") + return false + } } - if (!isValidContent()) { - emitValidationErrorMessage("행사 내용을 입력하세요.") - return + + EVENT_SCHEDULE -> { + if (!isValidLocation()) { + emitValidationErrorMessage("장소를 입력하세요.") + return false + } } - _currentRegistrationState.value = EVENT_SCHEDULE } + return true } - fun registerEvent() { - if (!isValidLocation()) { - emitValidationErrorMessage("장소를 입력하세요.") - return - } - viewModelScope.launch { - postEventUseCase( - eventTitle = _eventTitle.value, - eventContent = _eventContent.value, - eventLocation = _eventLocation.value, - eventStartDate = _eventStartDate.value, - eventStartTime = _eventStartTime.value, - eventEndDate = _eventEndDate.value, - eventEndTime = _eventEndTime.value, - ).onSuccess { - _eventRegistrationEvent.emit(EventRegistrationEvent.Success) - }.onFailure { throwable -> - _eventRegistrationEvent.emit(EventRegistrationEvent.Failure(throwable)) - } + fun setEventRegistrationState(eventRegistrationState: EventRegistrationState) { + _currentRegistrationState.value = eventRegistrationState + } + + fun registerEvent() = viewModelScope.launch { + postEventUseCase( + eventTitle = _eventTitle.value, + eventContent = _eventContent.value, + eventLocation = _eventLocation.value, + eventStartDate = _eventStartDate.value, + eventStartTime = _eventStartTime.value, + eventEndDate = _eventEndDate.value, + eventEndTime = _eventEndTime.value, + ).onSuccess { + _eventRegistrationEvent.emit(EventRegistrationEvent.Success) + }.onFailure { throwable -> + _eventRegistrationEvent.emit(EventRegistrationEvent.Failure(throwable)) } } From 8840a59d192246ef10ecb217e2377773aa1c6584 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Mon, 26 Feb 2024 23:28:58 +0900 Subject: [PATCH 08/18] =?UTF-8?q?[FEATURE]=20#126=20:=20onRegisterButton,?= =?UTF-8?q?=20onPreviousButton,=20onNextButton=20=ED=81=B4=EB=A6=AD?= =?UTF-8?q?=EC=8B=9C=20=ED=98=84=EC=9E=AC=20=EB=B0=8F=20=EB=8B=A4=EC=9D=8C?= =?UTF-8?q?=20=EC=83=81=ED=83=9C=20=EC=9D=B8=EC=9E=90=EB=A1=9C=20=EB=84=98?= =?UTF-8?q?=EA=B2=A8=EC=A3=BC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../registration/EventRegistrationContent.kt | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt index 1efaa205..92fdd9b9 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt @@ -62,8 +62,9 @@ internal fun EventRegistrationContent( onStartTimePickerStateChanged: (Boolean) -> Unit, onEndDatePickerStateChanged: (Boolean) -> Unit, onEndTimePickerStateChanged: (Boolean) -> Unit, - onNextButtonClicked: () -> Unit, - onRegisterButtonClicked: () -> Unit, + onNextButtonClicked: (EventRegistrationState, EventRegistrationState) -> Unit, + onPreviousButtonClicked: (EventRegistrationState) -> Unit, + onRegisterButtonClicked: (EventRegistrationState) -> Unit, ) { val scrollState = rememberScrollState() val coroutineScope = rememberCoroutineScope() @@ -85,7 +86,10 @@ internal fun EventRegistrationContent( coroutineScope.launch { scrollState.scrollTo(0) } - onNextButtonClicked() + onNextButtonClicked( + EventRegistrationState.EVENT_DETAILS, // current State + EventRegistrationState.EVENT_SCHEDULE, // next Stae + ) }, ) @@ -109,7 +113,12 @@ internal fun EventRegistrationContent( onStartTimePickerStateChanged = onStartTimePickerStateChanged, onEndDatePickerStateChanged = onEndDatePickerStateChanged, onEndTimePickerStateChanged = onEndTimePickerStateChanged, - onRegisterButtonClicked = onRegisterButtonClicked, + onRegisterButtonClicked = { + onRegisterButtonClicked(EventRegistrationState.EVENT_SCHEDULE) + }, + onPreviousButtonClicked = { + onPreviousButtonClicked(EventRegistrationState.EVENT_DETAILS) // previous State + }, ) } } @@ -194,6 +203,7 @@ private fun EventScheduleContent( onEndDateChanged: (LocalDate) -> Unit, onEndTimeChanged: (LocalTime) -> Unit, onRegisterButtonClicked: () -> Unit, + onPreviousButtonClicked: () -> Unit, ) { if (showEndDatePicker) { WappDatePickerDialog( @@ -309,9 +319,20 @@ private fun EventScheduleContent( Spacer(modifier = Modifier.weight(1f)) - WappButton( - onClick = onRegisterButtonClicked, - textRes = R.string.register_event, - ) + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + ) { + WappButton( + textRes = R.string.previous, + onClick = onPreviousButtonClicked, + modifier = Modifier.weight(1f), + ) + + WappButton( + textRes = R.string.register_event, + onClick = onRegisterButtonClicked, + modifier = Modifier.weight(1f), + ) + } } } From 8ad2658fef113051b14a9788a73d868b862fa3fe Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Mon, 26 Feb 2024 23:29:23 +0900 Subject: [PATCH 09/18] =?UTF-8?q?[FEATURE]=20#126=20:=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=EC=8B=9C=20=EA=B2=80=EC=A6=9D=20=ED=9B=84=20?= =?UTF-8?q?=EB=8B=A4=EC=9D=8C=20=EC=83=81=ED=83=9C=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=ED=99=98=EB=90=98=EB=8F=84=EB=A1=9D=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../management/event/edit/EventEditScreen.kt | 28 ++++++++++++------- .../registration/EventRegistrationScreen.kt | 28 ++++++++++++------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt index ba40b3a1..bb8a0df5 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt @@ -79,9 +79,6 @@ internal fun EventEditRoute( val onStartTimeChanged = viewModel::setEventStartTime val onEndDateChanged = viewModel::setEventEndDate val onEndTimeChanged = viewModel::setEventEndTime - val onNextButtonClicked = - viewModel::setEventRegistrationState - val onRegisterButtonClicked = viewModel::updateEvent LaunchedEffect(true) { viewModel.getEvent(eventId = eventId) @@ -120,10 +117,19 @@ internal fun EventEditRoute( onStartTimeChanged = onStartTimeChanged, onEndDateChanged = onEndDateChanged, onEndTimeChanged = onEndTimeChanged, - onNextButtonClicked = onNextButtonClicked, - onEditButtonClicked = onRegisterButtonClicked, - onBackButtonClicked = navigateToManagement, + onNextButtonClicked = { currentState, nextState -> + if (viewModel.validateEvent(currentState)) { + viewModel.setEventRegistrationState(nextState) + } + }, + onCloseButtonClicked = navigateToManagement, + onPreviousButtonClicked = viewModel::setEventRegistrationState, deleteEvent = viewModel::deleteEvent, + onEditButtonClicked = { lastState -> + if (viewModel.validateEvent(lastState)) { + viewModel.updateEvent() + } + }, ) } @@ -146,9 +152,10 @@ internal fun EventEditScreen( onStartTimeChanged: (LocalTime) -> Unit, onEndDateChanged: (LocalDate) -> Unit, onEndTimeChanged: (LocalTime) -> Unit, - onNextButtonClicked: () -> Unit, - onEditButtonClicked: () -> Unit, - onBackButtonClicked: () -> Unit, + onNextButtonClicked: (EventRegistrationState, EventRegistrationState) -> Unit, + onEditButtonClicked: (EventRegistrationState) -> Unit, + onCloseButtonClicked: () -> Unit, + onPreviousButtonClicked: (EventRegistrationState) -> Unit, deleteEvent: () -> Unit, ) { var showStartDatePicker by remember { mutableStateOf(false) } @@ -183,7 +190,7 @@ internal fun EventEditScreen( showLeftButton = true, showRightButton = true, leftButtonDrawableRes = drawable.ic_close, - onClickLeftButton = onBackButtonClicked, + onClickLeftButton = onCloseButtonClicked, onClickRightButton = { showDeleteEventDialog = true }, ) @@ -220,6 +227,7 @@ internal fun EventEditScreen( onEndTimePickerStateChanged = { state -> showEndTimePicker = state }, onNextButtonClicked = onNextButtonClicked, onRegisterButtonClicked = onEditButtonClicked, + onPreviousButtonClicked = onPreviousButtonClicked, ) } } diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt index 399b1613..040e2e28 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt @@ -59,9 +59,6 @@ internal fun EventRegistrationRoute( val onStartTimeChanged = viewModel::setEventStartTime val onEndDateChanged = viewModel::setEventEndDate val onEndTimeChanged = viewModel::setEventEndTime - val onNextButtonClicked = - viewModel::setEventRegistrationState - val onRegisterButtonClicked = viewModel::registerEvent LaunchedEffect(true) { viewModel.eventRegistrationEvent.collectLatest { @@ -98,9 +95,18 @@ internal fun EventRegistrationRoute( onStartTimeChanged = onStartTimeChanged, onEndDateChanged = onEndDateChanged, onEndTimeChanged = onEndTimeChanged, - onNextButtonClicked = onNextButtonClicked, - onRegisterButtonClicked = onRegisterButtonClicked, - onBackButtonClicked = navigateToManagement, + onNextButtonClicked = { currentState, nextState -> + if (viewModel.validateEvent(currentState)) { + viewModel.setEventRegistrationState(nextState) + } + }, + onCloseButtonClicked = navigateToManagement, + onPreviousButtonClicked = viewModel::setEventRegistrationState, + onRegisterButtonClicked = { lastState -> + if (viewModel.validateEvent(lastState)) { // 마지막 상태 대입 + viewModel.registerEvent() + } + }, ) } @@ -123,9 +129,10 @@ internal fun EventRegistrationScreen( onStartTimeChanged: (LocalTime) -> Unit, onEndDateChanged: (LocalDate) -> Unit, onEndTimeChanged: (LocalTime) -> Unit, - onNextButtonClicked: () -> Unit, - onRegisterButtonClicked: () -> Unit, - onBackButtonClicked: () -> Unit, + onNextButtonClicked: (EventRegistrationState, EventRegistrationState) -> Unit, + onPreviousButtonClicked: (EventRegistrationState) -> Unit, + onRegisterButtonClicked: (EventRegistrationState) -> Unit, + onCloseButtonClicked: () -> Unit, ) { var showStartDatePicker by remember { mutableStateOf(false) } var showStartTimePicker by remember { mutableStateOf(false) } @@ -150,7 +157,7 @@ internal fun EventRegistrationScreen( titleRes = R.string.event_registration, showLeftButton = true, leftButtonDrawableRes = drawable.ic_close, - onClickLeftButton = onBackButtonClicked, + onClickLeftButton = onCloseButtonClicked, ) EventRegistrationStateIndicator( @@ -186,6 +193,7 @@ internal fun EventRegistrationScreen( onEndDatePickerStateChanged = { state -> showEndDatePicker = state }, onEndTimePickerStateChanged = { state -> showEndTimePicker = state }, onNextButtonClicked = onNextButtonClicked, + onPreviousButtonClicked = onPreviousButtonClicked, onRegisterButtonClicked = onRegisterButtonClicked, ) } From 3918d995d8bcb898fbdf71dbd4a115ea6faae682 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Mon, 26 Feb 2024 23:29:40 +0900 Subject: [PATCH 10/18] =?UTF-8?q?[CHORE]=20#126=20:=20String=20Resource=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/management-event/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/management-event/src/main/res/values/strings.xml b/feature/management-event/src/main/res/values/strings.xml index 86e3d685..020b1d38 100644 --- a/feature/management-event/src/main/res/values/strings.xml +++ b/feature/management-event/src/main/res/values/strings.xml @@ -29,4 +29,5 @@ 선택 "이전 달을 보여주는 화살표 입니다." "다음 달을 보여주는 화살표 입니다." + 이전 From d24de47924226437c97504a25f0c043736ff166f Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 27 Feb 2024 20:09:07 +0900 Subject: [PATCH 11/18] =?UTF-8?q?[UI]=20#126=20:=20Event,=20SurveyForm=20I?= =?UTF-8?q?ndicator=EC=99=80=20Content=20=EC=82=AC=EC=9D=B4=2040dp?= =?UTF-8?q?=EB=A1=9C=20=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wap/wapp/feature/management/event/edit/EventEditScreen.kt | 2 +- .../management/event/registration/EventRegistrationContent.kt | 3 ++- .../management/event/registration/EventRegistrationScreen.kt | 3 +-- .../wapp/feature/management/survey/SurveyDeadlineContent.kt | 2 +- .../wap/wapp/feature/management/survey/SurveyEventContent.kt | 4 ++-- .../wap/wapp/feature/management/survey/SurveyFormContent.kt | 2 ++ .../feature/management/survey/SurveyInformationContent.kt | 2 +- .../wapp/feature/management/survey/SurveyQuestionContent.kt | 2 +- .../feature/management/survey/edit/SurveyFormEditScreen.kt | 2 +- 9 files changed, 12 insertions(+), 10 deletions(-) diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt index e49f006b..e28c11b0 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditScreen.kt @@ -205,7 +205,7 @@ internal fun EventEditScreen( EventEditStateIndicator( eventRegistrationState = currentEditState, - modifier = Modifier.padding(vertical = 16.dp, horizontal = 20.dp), + modifier = Modifier.padding(top = 16.dp, start = 20.dp, end = 20.dp), ) EventRegistrationContent( diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt index 8cd9fbd6..c304cbd9 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationContent.kt @@ -79,7 +79,8 @@ internal fun EventRegistrationContent( Column( modifier = modifier .fillMaxSize() - .addFocusCleaner(focusManager), + .addFocusCleaner(focusManager) + .padding(top = 40.dp), ) { AnimatedContent( targetState = eventRegistrationState, diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt index e0b3c4e4..ebeb1bed 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationScreen.kt @@ -173,8 +173,7 @@ internal fun EventRegistrationScreen( EventRegistrationContent( eventRegistrationState = currentRegistrationState, - modifier = Modifier - .padding(top = 50.dp, start = 20.dp, end = 20.dp, bottom = 20.dp), + modifier = Modifier.padding(horizontal = 20.dp), eventTitle = title, eventContent = content, location = location, diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt index 3ab0a169..bd066b8a 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt @@ -79,7 +79,7 @@ internal fun SurveyDeadlineContent( WappTitle( title = stringResource(R.string.survey_deadline_title), content = stringResource(R.string.survey_deadline_content), - modifier = Modifier.padding(top = 10.dp, bottom = 20.dp), + modifier = Modifier.padding(bottom = 20.dp), ) DeadlineCard( diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt index 070bbf85..3a0bf294 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt @@ -33,14 +33,14 @@ internal fun SurveyEventContent( WappTitle( title = stringResource(R.string.event_selection_title), content = stringResource(R.string.event_selection_content), - modifier = Modifier.padding(top = 10.dp, bottom = 40.dp), + modifier = Modifier.padding(bottom = 40.dp), ) LazyColumn( verticalArrangement = Arrangement.spacedBy(16.dp), modifier = Modifier .fillMaxWidth() - .weight(1f), + .weight(1f) ) { when (eventsState) { is EventsState.Loading -> item { diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyFormContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyFormContent.kt index f9498a28..b56bf362 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyFormContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyFormContent.kt @@ -9,6 +9,7 @@ import androidx.compose.animation.togetherWith import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.TimePickerState import androidx.compose.runtime.Composable +import androidx.compose.ui.res.stringResource import com.wap.wapp.core.model.event.Event import com.wap.wapp.core.model.survey.QuestionType import java.time.LocalDate @@ -59,6 +60,7 @@ internal fun SurveyFormContent( slideOutHorizontally(targetOffsetX = { it }) + fadeOut() } }, + label = stringResource(R.string.survey_form_registration_content_animated_content), ) { registrationState -> when (registrationState) { SurveyFormState.EVENT_SELECTION -> { diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyInformationContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyInformationContent.kt index e51cb3b3..83be22aa 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyInformationContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyInformationContent.kt @@ -38,7 +38,7 @@ internal fun SurveyInformationContent( WappTitle( title = stringResource(R.string.survey_information_title), content = stringResource(R.string.survey_information_content), - modifier = Modifier.padding(top = 10.dp, bottom = 24.dp), + modifier = Modifier.padding(bottom = 24.dp), ) Text( diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyQuestionContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyQuestionContent.kt index 076036df..252778aa 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyQuestionContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyQuestionContent.kt @@ -62,7 +62,7 @@ internal fun SurveyQuestionContent( WappTitle( title = stringResource(R.string.survey_question_title), content = stringResource(R.string.survey_question_content), - modifier = Modifier.padding(top = 10.dp, bottom = 30.dp), + modifier = Modifier.padding(bottom = 30.dp), ) Row( diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/edit/SurveyFormEditScreen.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/edit/SurveyFormEditScreen.kt index fcbb07e0..0d339caf 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/edit/SurveyFormEditScreen.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/edit/SurveyFormEditScreen.kt @@ -103,7 +103,7 @@ internal fun SurveyFormEditScreen( .addFocusCleaner(focusManager) .padding(paddingValues) // paddingValue padding .padding(vertical = 16.dp, horizontal = 20.dp), // dp value padding - verticalArrangement = Arrangement.spacedBy(20.dp), + verticalArrangement = Arrangement.spacedBy(40.dp), ) { if (showDeleteSurveyDialog) { DeleteSurveyDialog( From 91ba85db7c4ce0f4d273fc7e82eabd6a9e1bb1c6 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 27 Feb 2024 20:09:34 +0900 Subject: [PATCH 12/18] =?UTF-8?q?[UI]=20#126=20:=20ProgressBar=20Horizonta?= =?UTF-8?q?l=20Margin=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../survey/registration/SurveyFormRegistrationScreen.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyFormRegistrationScreen.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyFormRegistrationScreen.kt index 28755901..662ee62d 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyFormRegistrationScreen.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyFormRegistrationScreen.kt @@ -93,12 +93,9 @@ internal fun SurveyRegistrationScreen( .fillMaxSize() .padding(paddingValues) .padding(vertical = 16.dp, horizontal = 20.dp), - verticalArrangement = Arrangement.spacedBy(20.dp), + verticalArrangement = Arrangement.spacedBy(40.dp), ) { - SurveyFormStateIndicator( - surveyRegistrationState = currentRegistrationState, - modifier = Modifier.padding(horizontal = 20.dp), - ) + SurveyFormStateIndicator(surveyRegistrationState = currentRegistrationState) SurveyFormContent( surveyRegistrationState = currentRegistrationState, From 37f21daf89ab7513dfd9efb8080705caa455068f Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 27 Feb 2024 20:10:02 +0900 Subject: [PATCH 13/18] [CHORE] #126 : add String Resource SurveyFrom Registration Animated Content --- feature/management-survey/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/management-survey/src/main/res/values/strings.xml b/feature/management-survey/src/main/res/values/strings.xml index 4bd9bc11..a4d65389 100644 --- a/feature/management-survey/src/main/res/values/strings.xml +++ b/feature/management-survey/src/main/res/values/strings.xml @@ -50,4 +50,5 @@ 이전 다음 질문 이전 질문 + Survey Form Registration Content Animated Content From a238496293397c3bed5760f607f6477e93fef4a2 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 27 Feb 2024 20:20:20 +0900 Subject: [PATCH 14/18] =?UTF-8?q?[CHORE]=20#128=20:=20=EC=84=A4=EB=AC=B8?= =?UTF-8?q?=20=EB=93=B1=EB=A1=9D=20=EB=A7=88=EC=A7=80=EB=A7=89=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=ED=85=8D=EC=8A=A4=ED=8A=B8,=20=EB=8B=A4=EC=9D=8C?= =?UTF-8?q?=20->=20=EC=84=A4=EB=AC=B8=EB=93=B1=EB=A1=9D=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wap/wapp/feature/management/survey/SurveyDeadlineContent.kt | 2 +- feature/management-survey/src/main/res/values/strings.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt index bd066b8a..08c99bd4 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyDeadlineContent.kt @@ -110,7 +110,7 @@ internal fun SurveyDeadlineContent( ) WappButton( - textRes = R.string.next, + textRes = R.string.submit_survey, onClick = onRegisterButtonClicked, modifier = Modifier.weight(1f), ) diff --git a/feature/management-survey/src/main/res/values/strings.xml b/feature/management-survey/src/main/res/values/strings.xml index a4d65389..ad431075 100644 --- a/feature/management-survey/src/main/res/values/strings.xml +++ b/feature/management-survey/src/main/res/values/strings.xml @@ -51,4 +51,5 @@ 다음 질문 이전 질문 Survey Form Registration Content Animated Content + 설문 등록 From 5201149e6ae5813321cd0c1af8c47509ccd866fb Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 27 Feb 2024 20:25:02 +0900 Subject: [PATCH 15/18] =?UTF-8?q?[CHORE]=20#128=20:=20=EC=84=A4=EB=AC=B8?= =?UTF-8?q?=20=EC=9D=91=EB=8B=B5=20Limit=208=EA=B8=80=EC=9E=90=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt | 4 ++-- feature/survey/src/main/res/values/strings.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt index 6191326c..d9f14ef8 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt @@ -115,7 +115,7 @@ private fun checkQuestionTypeAndSubjectiveAnswer( if (questionType == QuestionType.OBJECTIVE) { return true } - return subjectiveAnswer.length >= MINIMUN_ANSWER_LENGTH + return subjectiveAnswer.length >= MINIMUM_ANSWER_LENGTH } -private val MINIMUN_ANSWER_LENGTH = 10 +private const val MINIMUM_ANSWER_LENGTH = 8 diff --git a/feature/survey/src/main/res/values/strings.xml b/feature/survey/src/main/res/values/strings.xml index 91b38642..8617a5d6 100644 --- a/feature/survey/src/main/res/values/strings.xml +++ b/feature/survey/src/main/res/values/strings.xml @@ -8,7 +8,7 @@ 설문 작성 참가한 행사에 대해 설문에 응답하세요! 설문 응답 - /10자 이상 + /8자 이상 이미 작성한 설문입니다. 로그인 하러가기 앗 회원이 아니시네요 ! From fde88b81fa05269d9ae55b501f62b2a71f055bfd Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 27 Feb 2024 20:47:53 +0900 Subject: [PATCH 16/18] =?UTF-8?q?[CHORE]=20#128=20:=20=EC=9D=B4=EC=A0=84?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD=EC=8B=9C=20=EB=8B=B5?= =?UTF-8?q?=EB=B3=80=20=EC=88=98=EC=A0=95=EB=90=98=EB=8F=84=EB=A1=9D=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 --- .../com/wap/wapp/feature/survey/answer/SurveyAnswerScreen.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerScreen.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerScreen.kt index 1caba3a8..004184fa 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerScreen.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerScreen.kt @@ -21,6 +21,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme import com.wap.designsystem.component.WappSubTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText +import com.wap.wapp.core.designresource.R.drawable import com.wap.wapp.core.model.survey.Rating import com.wap.wapp.core.model.survey.SurveyForm import com.wap.wapp.feature.survey.R @@ -65,6 +66,7 @@ internal fun SurveyAnswerScreen( titleRes = R.string.survey_answer, showLeftButton = true, modifier = Modifier.padding(top = 16.dp), // 하단은 Content Padding에 의존 + leftButtonDrawableRes = drawable.ic_close, onClickLeftButton = { when (surveyAnswerState) { SurveyAnswerState.SURVEY_OVERVIEW -> navigateToSurvey() @@ -112,6 +114,8 @@ internal fun SurveyAnswerScreen( // 응답의 갯수가 질문의 갯수보다 작은 경우 if (questionNumber >= surveyAnswerList.size) { viewModel.addSurveyAnswer() + } else { + viewModel.editSurveyAnswer() } viewModel.setPreviousQuestionAndAnswer() }, From 6941989cae3badb596ca31a91d9cb8cf34c1f27f Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 27 Feb 2024 20:50:37 +0900 Subject: [PATCH 17/18] [CHORE] #128 : Formmating --- .../wap/wapp/feature/management/survey/SurveyEventContent.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt index 3a0bf294..0b8b4323 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/SurveyEventContent.kt @@ -40,7 +40,7 @@ internal fun SurveyEventContent( verticalArrangement = Arrangement.spacedBy(16.dp), modifier = Modifier .fillMaxWidth() - .weight(1f) + .weight(1f), ) { when (eventsState) { is EventsState.Loading -> item { From 83a72f24c3fca1ae9b90d8ac33fc41bf2397fc65 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Tue, 27 Feb 2024 22:33:27 +0900 Subject: [PATCH 18/18] =?UTF-8?q?[CHORE]=20#128=20:=20isValidEndTime,=20?= =?UTF-8?q?=5FeventStartTime=20=EB=B3=80=EC=88=98=EB=A1=9C=20=EB=B9=BC?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wapp/feature/management/event/edit/EventEditViewModel.kt | 3 ++- .../event/registration/EventRegistrationViewModel.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt index b9455d2b..9426ec16 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/edit/EventEditViewModel.kt @@ -147,7 +147,8 @@ class EventEditViewModel @Inject constructor( val endDate = _eventEndDate.value if (startDate == endDate) { - return eventTime > _eventStartTime.value + val startTime = _eventStartTime.value + return eventTime > startTime } return startDate < endDate } diff --git a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt index 60a65baf..978a7043 100644 --- a/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt +++ b/feature/management-event/src/main/java/com/wap/wapp/feature/management/event/registration/EventRegistrationViewModel.kt @@ -139,7 +139,8 @@ class EventRegistrationViewModel @Inject constructor( val endDate = _eventEndDate.value if (startDate == endDate) { - return eventTime > _eventStartTime.value + val startTime = _eventStartTime.value + return eventTime > startTime } return startDate < endDate }