Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/jaino/#95 #121

Merged
merged 18 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a0c731a
[CHORE] #95 : ์‚ฌ์šฉํ•˜๋Š” ์•„์ด์ฝ˜ ์ถ”๊ฐ€
jeongjaino Jan 30, 2024
252d418
[CHORE] #95 : ์‚ฌ์šฉ String Resource ์ถ”๊ฐ€
jeongjaino Jan 30, 2024
8195c1c
[FEATURE] #95 : ๊ด€๋ฆฌํƒญ์—์„œ ์„ค๋ฌธ ์ˆ˜์ • ๋ฐ”ํ…€ ๋ฐ” ์†Œ๊ฑฐ
jeongjaino Jan 30, 2024
1425940
[CHORE] #95 : ๋ถˆํ•„์š”ํ•œ Column ์†Œ๊ฑฐ
jeongjaino Jan 30, 2024
18c65b1
[FEATURE] #95 : ๋’ค๋กœ ๊ฐ€๊ธฐ ๋ฒ„ํŠผ ์ถ”๊ฐ€
jeongjaino Jan 30, 2024
6af4ce1
[FEATURE] #95 : ๋’ค๋กœ ๊ฐ€๊ธฐ ๋ฒ„ํŠผ๊ณผ ์งˆ๋ฌธ ์•ž ๋’ค ์ „ํ™˜ ๋ฒ„ํŠผ ๊ตฌํ˜„
jeongjaino Jan 30, 2024
2e13274
[FEATURE] #95 : ์งˆ๋ฌธ ์ˆœ์„œ ๋ณ€๊ฒฝ (๋น ๋ฅธ #94 ํ•ซํ”ฝ์Šค๋ฅผ ์œ„ํ•œ ์ค‘๊ฐ„ ์ปค๋ฐ‹)
jeongjaino Jan 30, 2024
80dbd6a
[STYLE] #95 : ์ธ์ž ๋„ค์ด๋ฐ ์ˆ˜์ • questionNumber -> currentQuestionNumber
jeongjaino Jan 31, 2024
aefdaac
[STYLE] #95 : ์ธ์ž ๋„ค์ด๋ฐ ์ˆ˜์ • time, date => timeDeadline, dateDeadline
jeongjaino Jan 31, 2024
13cc8bc
[REFACTOR] #95 : ์ด์ „ ์งˆ๋ฌธ, ์ดํ›„ ์งˆ๋ฌธ, ์งˆ๋ฌธ ์ถ”๊ฐ€ํ•˜๊ธฐ, ๋‹ค์Œ ๋ฒ„ํŠผ ๋กœ์ง ์ˆ˜์ •
jeongjaino Jan 31, 2024
6741b89
[REFACTOR] #95 : ์ด์ „ ์งˆ๋ฌธ, ์ดํ›„ ์งˆ๋ฌธ, ์งˆ๋ฌธ ์ถ”๊ฐ€ํ•˜๊ธฐ, ๋‹ค์Œ ๋ฒ„ํŠผ ๋กœ์ง ์ˆ˜์ •
jeongjaino Jan 31, 2024
2f1af34
[CHORE] #95 : ๊ณต์šฉ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” EventState ์™ธ๋ถ€๋กœ ๋‚ด๋ณด๋‚ด๊ธฐ
jeongjaino Feb 6, 2024
a958ff6
[RENAME] #95 : DeleteSurvey -> SurveyDelete
jeongjaino Feb 6, 2024
aa6404a
[STYLE] #95 : ๋ณ€์ˆ˜ ๋„ค์ด๋ฐ ์ˆ˜์ • question -> questionTitle
jeongjaino Feb 6, 2024
0ab4acf
[FEATURE] #95 : ์„ค๋ฌธ ์ˆ˜์ • ์‹œ, ์ด์ „ ์ดํ›„ ์งˆ๋ฌธ ์ด๋™ ๊ธฐ๋Šฅ ๊ตฌํ˜„
jeongjaino Feb 6, 2024
dccd38c
[CHORE] #95 : ViewModel EventState -> EventState๋กœ ๋ณ€๊ฒฝ
jeongjaino Feb 6, 2024
b7b9a2e
Merge branch 'develop' into feature/jaino/#95
jeongjaino Feb 6, 2024
282df0e
Merge branch 'develop' into feature/jaino/#95
jeongjaino Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/main/java/com/wap/wapp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ private fun handleBottomBarState(
profileSettingNavigationRoute -> setBottomBarState(false)
attendanceManagementNavigationRoute -> setBottomBarState(false)
ManagementSurveyRoute.surveyFormRegistrationRoute -> setBottomBarState(false)
ManagementSurveyRoute.surveyFormEditRoute("{id}") -> setBottomBarState(false)
eventRegistrationNavigationRoute -> setBottomBarState(false)
SurveyRoute.answerRoute("{id}") ->setBottomBarState(false)
else -> setBottomBarState(true)
Expand Down
9 changes: 9 additions & 0 deletions core/designresource/src/main/res/drawable/ic_add_question.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:pathData="M29.32,0C36.12,0 40,3.84 40,10.66V29.34C40,36.12 36.14,40 29.34,40H10.66C3.84,40 0,36.12 0,29.34V10.66C0,3.84 3.84,0 10.66,0H29.32ZM19.98,11.02C19.06,11.02 18.32,11.76 18.32,12.68V18.32H12.66C12.22,18.32 11.8,18.5 11.48,18.8C11.18,19.12 11,19.538 11,19.98C11,20.9 11.74,21.64 12.66,21.66H18.32V27.32C18.32,28.24 19.06,28.98 19.98,28.98C20.9,28.98 21.64,28.24 21.64,27.32V21.66H27.32C28.24,21.64 28.98,20.9 28.98,19.98C28.98,19.06 28.24,18.32 27.32,18.32H21.64V12.68C21.64,11.76 20.9,11.02 19.98,11.02Z"
android:fillColor="#FBCF34"/>
</vector>
4 changes: 2 additions & 2 deletions core/designresource/src/main/res/drawable/ic_back.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="7dp"
android:height="14dp"
android:width="10dp"
android:height="20dp"
android:viewportWidth="10"
android:viewportHeight="20">
<path
Expand Down
9 changes: 9 additions & 0 deletions core/designresource/src/main/res/drawable/ic_close.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="15dp"
android:height="15dp"
android:viewportWidth="15"
android:viewportHeight="15">
<path
android:pathData="M15,1.511L13.489,0L7.5,5.989L1.511,0L0,1.511L5.989,7.5L0,13.489L1.511,15L7.5,9.011L13.489,15L15,13.489L9.011,7.5L15,1.511Z"
android:fillColor="#ffffff"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.wap.wapp.feature.management.survey

import com.wap.wapp.core.model.event.Event

sealed class EventsState {
data object Loading : EventsState()
data class Success(val events: List<Event>) : EventsState()
data class Failure(val throwable: Throwable) : EventsState()
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,21 @@ import java.time.LocalTime
@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun SurveyDeadlineContent(
date: LocalDate,
time: LocalTime,
dateDeadline: LocalDate,
timeDeadline: LocalTime,
timePickerState: TimePickerState,
showDatePicker: Boolean,
showTimePicker: Boolean,
onDatePickerStateChanged: (Boolean) -> Unit,
onTimePickerStateChanged: (Boolean) -> Unit,
onDateChanged: (LocalDate) -> Unit,
onTimeChanged: (LocalTime) -> Unit,
onPreviousButtonClicked: () -> Unit,
onRegisterButtonClicked: () -> Unit,
) {
if (showDatePicker) {
WappDatePickerDialog(
date = date,
date = dateDeadline,
onDismissRequest = { onDatePickerStateChanged(false) },
onDateChanged = onDateChanged,
)
Expand Down Expand Up @@ -77,27 +78,37 @@ internal fun SurveyDeadlineContent(

DeadlineCard(
title = stringResource(R.string.date),
hint = date.format(DateUtil.yyyyMMddFormatter),
hint = dateDeadline.format(DateUtil.yyyyMMddFormatter),
onCardClicked = {
onDatePickerStateChanged(true)
},
)

DeadlineCard(
title = stringResource(R.string.time),
hint = time.format(DateUtil.HHmmFormatter),
hint = timeDeadline.format(DateUtil.HHmmFormatter),
onCardClicked = {
onTimePickerStateChanged(true)
},
)

Spacer(modifier = Modifier.weight(1f))

WappButton(
textRes = R.string.register_survey,
onClick = onRegisterButtonClicked,
modifier = Modifier.padding(bottom = 20.dp),
)
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
WappButton(
textRes = R.string.previous,
onClick = onPreviousButtonClicked,
modifier = Modifier.weight(1f),
)

WappButton(
textRes = R.string.next,
onClick = onRegisterButtonClicked,
modifier = Modifier.weight(1f),
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,51 +21,52 @@ import com.wap.designsystem.component.CircleLoader
import com.wap.designsystem.component.WappButton
import com.wap.designsystem.component.WappTitle
import com.wap.wapp.core.model.event.Event
import com.wap.wapp.feature.management.survey.registration.SurveyFormRegistrationViewModel.EventsState

@Composable
internal fun SurveyEventContent(
eventsState: EventsState,
selectedEvent: Event,
onEventSelected: (Event) -> Unit,
onNextButtonClicked: () -> Unit,
modifier: Modifier = Modifier,
) {
WappTitle(
title = stringResource(R.string.event_selection_title),
content = stringResource(R.string.event_selection_content),
modifier = Modifier.padding(top = 10.dp, bottom = 40.dp),
)
Column(modifier = Modifier.fillMaxSize()) {
WappTitle(
title = stringResource(R.string.event_selection_title),
content = stringResource(R.string.event_selection_content),
modifier = Modifier.padding(top = 10.dp, bottom = 40.dp),
)

LazyColumn(
verticalArrangement = Arrangement.spacedBy(16.dp),
modifier = modifier,
) {
when (eventsState) {
is EventsState.Loading -> item {
CircleLoader(
modifier = Modifier.fillMaxSize(),
)
}

is EventsState.Success ->
items(eventsState.events) { event ->
EventCard(
event = event,
selectedEvent = selectedEvent,
onEventSelected = onEventSelected,
LazyColumn(
verticalArrangement = Arrangement.spacedBy(16.dp),
modifier = Modifier.weight(1f),
) {
when (eventsState) {
is EventsState.Loading -> item {
CircleLoader(
modifier = Modifier.fillMaxSize(),
)
}

is EventsState.Failure -> {}
is EventsState.Success -> {
items(eventsState.events) { event ->
EventCard(
event = event,
selectedEvent = selectedEvent,
onEventSelected = onEventSelected,
)
}
}

is EventsState.Failure -> {}
}
}
}

WappButton(
textRes = R.string.next,
onClick = onNextButtonClicked,
modifier = Modifier.padding(top = 20.dp, bottom = 20.dp),
)
WappButton(
textRes = R.string.next,
onClick = onNextButtonClicked,
modifier = Modifier.padding(top = 16.dp),
)
}
}

@Composable
Expand Down
Loading
Loading