Skip to content

Commit

Permalink
Merge pull request #66 from Team-B1ND/hotfix/64_category
Browse files Browse the repository at this point in the history
심사 승인 버그 수정 및 자잘하게 수정
  • Loading branch information
wnsgur1 authored Apr 16, 2024
2 parents e4e623f + e3c4339 commit d6af5ff
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 62 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/ProjectProperties.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.gradle.api.JavaVersion

object ProjectProperties {
const val VERSION_CODE = 31
const val VERSION_NAME = "2.2.0"
const val VERSION_CODE = 32
const val VERSION_NAME = "2.2.1"

const val APPLICATION_ID = "kr.hs.dgsw.smartschool.dodamdodam_teacher"
const val NAME_SPACE_DOMAIN = "kr.hs.dgsw.smartschool.domain"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,25 @@ fun OutScreen(
}
}

val goingGradeList = state.outGoings.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()

val goingRoomList = state.outGoings.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()

val sleepingGradeList = state.outSleepings.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()

val sleepingRoomList = state.outSleepings.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()
val goingGradeList = listOf("전체", "1학년", "2학년", "3학년")
// state.outGoings.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val goingRoomList = listOf("전체", "1반", "2반", "3반", "4반")
// state.outGoings.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}반" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val sleepingGradeList = listOf("전체", "1학년", "2학년", "3학년")
// state.outSleepings.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val sleepingRoomList = listOf("전체", "1반", "2반", "3반", "4반")
// state.outSleepings.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}반" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val categoryRoomList = if (state.currentOutType == 0) {
goingRoomList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ fun CurrentNightStudyScreen(
}
}

val gradeList =
state.nightStudies.asSequence().map { it.student.grade }.distinct().sortedDescending()
.map { "${it}학년" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()

val roomList =
state.nightStudies.asSequence().map { it.student.room }.distinct().sortedDescending()
.map { "${it}" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()
val gradeList = listOf("전체", "1학년", "2학년", "3학년")
// state.nightStudies.asSequence().map { it.student.grade }.distinct().sortedDescending()
// .map { "${it}학년" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val roomList = listOf("전체", "1반", "2반", "3반", "4반")
// state.nightStudies.asSequence().map { it.student.room }.distinct().sortedDescending()
// .map { "${it}반" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val convertedRoom = roomList.map { grade ->
when (grade) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ fun NightStudyScreen(
}
}

val gradeList = state.nightStudies.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()

val roomList = state.nightStudies.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()
val gradeList = listOf("전체", "1학년", "2학년", "3학년")
// state.nightStudies.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val roomList = listOf("전체", "1반", "2반", "3반", "4반")
// state.nightStudies.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}반" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val convertedRoom = roomList.map { grade ->
when (grade) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,25 @@ fun CurrentOutScreen(
}
}

val goingGradeList = state.outGoings.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()

val goingRoomList = state.outGoings.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()

val sleepingGradeList = state.outSleepings.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()

val sleepingRoomList = state.outSleepings.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}" }.plus(
stringResource(id = R.string.label_all)
).toList().reversed()
val goingGradeList = listOf("전체", "1학년", "2학년", "3학년")
// state.outGoings.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val goingRoomList = listOf("전체", "1반", "2반", "3반", "4반")
// state.outGoings.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}반" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val sleepingGradeList = listOf("전체", "1학년", "2학년", "3학년")
// state.outSleepings.asSequence().map { it.student.grade }.distinct().sortedDescending().map { "${it}학년" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val sleepingRoomList = listOf("전체", "1반", "2반", "3반", "4반")
// state.outSleepings.asSequence().map { it.student.room }.distinct().sortedDescending().map { "${it}반" }.plus(
// stringResource(id = R.string.label_all)
// ).toList().reversed()

val categoryRoomList = if (state.currentOutType == 0) {
goingRoomList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import kr.hs.dgsw.smartschool.dodamdodam_teacher.features.point.mvi.PointSideEff
import kr.hs.dgsw.smartschool.dodamdodam_teacher.features.point.mvi.PointState
import kr.hs.dgsw.smartschool.domain.model.classroom.Classroom
import kr.hs.dgsw.smartschool.domain.model.member.MemberRole
import kr.hs.dgsw.smartschool.domain.model.member.student.Student
import kr.hs.dgsw.smartschool.domain.model.place.Place
import kr.hs.dgsw.smartschool.domain.model.point.PointPlace
import kr.hs.dgsw.smartschool.domain.model.point.PointReason
Expand Down Expand Up @@ -89,15 +90,18 @@ class PointViewModel @Inject constructor(
Log.d("TAG", "getMembers: $it")
reduce {
state.copy(
members = it.filter {
Log.d("TAG", "getMembers: ${it.role == MemberRole.STUDENT}")
members = it,
students = it.filter {
it.role == MemberRole.STUDENT
}.map {
it.student ?: Student(0, "", 0, 0, 0)
}
)
}
delay(1000)
if (state.students.isNotEmpty())
makePointStudents()
Log.d("TAG", "getMembers: ${state.members}")
}.onFailure {
postSideEffect(PointSideEffect.ShowException(it))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ internal fun NightStudyResponse.toModel(): NightStudy =
place = place,
startAt = startAt.yearDateToLocalDate(),
endAt = endAt.yearDateToLocalDate(),
createdAt = createdAt,
modifiedAt = modifiedAt,
createdAt = createdAt ?: "",
modifiedAt = modifiedAt ?: "",
isPhone = doNeedPhone,

)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ internal fun List<OutResponse>.toModel(): List<Out> =
this.map {
it.toOut()
}
internal fun OutResponse.toOut(): Out =
Out(
internal fun OutResponse.toOut(): Out {
return Out(
id = id,
reason = reason,
status = status.toOutStatus(),
student = student.toModel(),
rejectReason = rejectReason ?: "",
startOutDate = startOutDate.yearDateTimeToLocalDate().toString(),
endOutDate = endOutDate.yearDateTimeToLocalDate().toString(),
startOutDate = startOutDate,
endOutDate = endOutDate,
createdAt = createdAt.yearDateTimeToLocalDate().toString(),

modifiedAt = modifiedAt.yearDateTimeToLocalDate().toString()
)
}

internal fun OutDetailResponse.toOutItem(type: OutType): OutItem =
OutItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ data class NightStudyResponse(
@field:SerializedName("place") val place: String,
@field:SerializedName("startAt") val startAt: String,
@field:SerializedName("endAt") val endAt: String,
@field:SerializedName("createdAt") val createdAt: String,
@field:SerializedName("modifiedAt") val modifiedAt: String,
@field:SerializedName("createdAt") val createdAt: String?,
@field:SerializedName("modifiedAt") val modifiedAt: String?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ data class OutResponse(
@field:SerializedName("status") val status: OutResponseStatus,
@field:SerializedName("student") val student: StudentResponse,
@field:SerializedName("rejectReason")val rejectReason: String?,
@field:SerializedName("startOutDate") val startOutDate: String,
@field:SerializedName("endOutDate") val endOutDate: String,
@field:SerializedName("startAt") val startOutDate: String,
@field:SerializedName("endAt") val endOutDate: String,
@field:SerializedName("createdAt") val createdAt: String,
@field:SerializedName("modifiedAt") val modifiedAt: String,
)

0 comments on commit d6af5ff

Please sign in to comment.