Skip to content

Commit

Permalink
chore/#109: ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
jinukeu committed Jan 21, 2024
1 parent ce313f0 commit 59c51a6
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UpdateLectureEvaluationUseCase @Inject constructor(
private val lectureEditorRepository: LectureEditorRepository,
) {
suspend operator fun invoke(param: Param): Result<Unit> = runCatchingIgnoreCancelled {
with(param){
with(param) {
lectureEditorRepository.updateLectureEvaluation(
lectureId = lectureId,
selectedSemester = selectedSemester,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,15 @@ package com.suwiki.feature.lectureevaluation.editor.examevaluation

import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.suwiki.core.model.enums.ExamInfo
import com.suwiki.core.model.enums.ExamLevel
import com.suwiki.core.model.enums.ExamType
import com.suwiki.core.model.lectureevaluation.exam.MyExamEvaluation
import com.suwiki.core.model.user.User
import com.suwiki.core.ui.extension.decodeFromUri
import com.suwiki.domain.lectureevaluation.editor.usecase.exam.DeleteExamEvaluationUseCase
import com.suwiki.domain.lectureevaluation.editor.usecase.exam.UpdateExamEvaluationUseCase
import com.suwiki.domain.user.usecase.GetUserInfoUseCase
import com.suwiki.feature.lectureevaluation.editor.navigation.MyEvaluationEditRoute
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.collections.immutable.toPersistentList
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.serialization.json.Json
import org.orbitmvi.orbit.Container
import org.orbitmvi.orbit.ContainerHost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.suwiki.feature.lectureevaluation.editor.examevaluation
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowRow
Expand All @@ -18,7 +17,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -34,7 +32,6 @@ import com.suwiki.core.designsystem.component.bottomsheet.SuwikiSelectBottomShee
import com.suwiki.core.designsystem.component.button.SuwikiContainedMediumButton
import com.suwiki.core.designsystem.component.chips.SuwikiOutlinedChip
import com.suwiki.core.designsystem.component.container.SuwikiSelectionContainer
import com.suwiki.core.designsystem.component.dialog.SuwikiDialog
import com.suwiki.core.designsystem.component.loading.LoadingScreen
import com.suwiki.core.designsystem.component.textfield.SuwikiReviewInputBox
import com.suwiki.core.designsystem.theme.SuwikiTheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import com.suwiki.core.designsystem.component.button.SuwikiContainedMediumButton
import com.suwiki.core.designsystem.component.chips.ChipColor
import com.suwiki.core.designsystem.component.chips.SuwikiContainedChip
import com.suwiki.core.designsystem.component.container.SuwikiSelectionContainer
import com.suwiki.core.designsystem.component.dialog.SuwikiDialog
import com.suwiki.core.designsystem.component.loading.LoadingScreen
import com.suwiki.core.designsystem.component.ratingbar.SuwikiRatingBar
import com.suwiki.core.designsystem.component.slider.SuwikiSlider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.suwiki.core.model.enums.TeamLevel
import com.suwiki.core.model.lectureevaluation.lecture.MyLectureEvaluation
import com.suwiki.core.model.user.User
import com.suwiki.core.ui.extension.decodeFromUri
import com.suwiki.domain.lectureevaluation.editor.usecase.lecture.DeleteLectureEvaluationUseCase
import com.suwiki.domain.lectureevaluation.editor.usecase.lecture.UpdateLectureEvaluationUseCase
import com.suwiki.domain.user.usecase.GetUserInfoUseCase
import com.suwiki.feature.lectureevaluation.editor.navigation.MyEvaluationEditRoute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ fun MyEvaluationScreen(
)
}


if (uiState.isLoading) {
LoadingScreen()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class MyEvaluationViewModel @Inject constructor(
lectureEvaluationPage = 1
isLastLectureEvaluation = false
persistentListOf()
} else state.myLectureEvaluationList
} else {
state.myLectureEvaluationList
}

if (isLastLectureEvaluation) return@intent

Expand All @@ -68,7 +70,9 @@ class MyEvaluationViewModel @Inject constructor(
examEvaluationPage = 1
isLastExamEvaluation = false
persistentListOf()
} else state.myExamEvaluationList
} else {
state.myExamEvaluationList
}

if (isLastExamEvaluation) return@intent

Expand Down Expand Up @@ -97,7 +101,6 @@ class MyEvaluationViewModel @Inject constructor(
hideLoadingScreen()
}


fun deleteExamEvaluation() = intent {
deleteExamEvaluationUseCase(toDeleteExamId)
.onSuccess {
Expand Down Expand Up @@ -130,7 +133,6 @@ class MyEvaluationViewModel @Inject constructor(

private fun setPoint(user: User) = intent { reduce { state.copy(point = user.point) } }


fun syncPager(currentPage: Int) = intent { reduce { state.copy(currentTabPage = currentPage) } }

private fun showLoadingScreen() = intent { reduce { state.copy(isLoading = true) } }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.suwiki.feature.lectureevaluation.my.navigation

import androidx.compose.foundation.layout.PaddingValues
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import com.suwiki.core.designsystem.component.appbar.SuwikiAppBarWithTextButton
import com.suwiki.core.designsystem.component.container.SuwikiEditContainer
import com.suwiki.core.designsystem.component.dialog.SuwikiDialog
import com.suwiki.core.designsystem.theme.Gray95
import com.suwiki.core.designsystem.theme.SuwikiTheme
import com.suwiki.core.designsystem.theme.White
import com.suwiki.core.model.timetable.Timetable
import com.suwiki.feature.timetable.R
import com.suwiki.feature.timetable.navigation.argument.TimetableEditorArgument
import com.suwiki.core.designsystem.component.container.SuwikiEditContainer
import org.orbitmvi.orbit.compose.collectAsState
import org.orbitmvi.orbit.compose.collectSideEffect

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ internal fun MyExamEvaluationResponse.toModel() = MyExamEvaluation(
professor = professor,
majorType = majorType,
selectedSemester = selectedSemester,
semesterList = semesterList.replace(" ","").split(","),
examInfo = examInfo.replace(" ","").split(","),
semesterList = semesterList.replace(" ", "").split(","),
examInfo = examInfo.replace(" ", "").split(","),
examType = examType,
examDifficulty = examDifficulty,
content = content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ data class MyLectureEvaluationResponse(
internal fun MyLectureEvaluationResponse.toModel() = MyLectureEvaluation(
id = id,
lectureInfo = LectureInfo(
semesterList = semesterList.replace(" ","").split(","),
semesterList = semesterList.replace(" ", "").split(","),
professor = professor,
majorType = majorType,
lectureType = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data class LectureEvaluationAverageResponse(
internal fun LectureEvaluationAverageResponse.toModel() = LectureEvaluationAverage(
id = id,
lectureInfo = LectureInfo(
semesterList = semesterList.replace(" ","").split(","),
semesterList = semesterList.replace(" ", "").split(","),
professor = professor,
majorType = majorType,
lectureType = lectureType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data class LectureEvaluationExtraAverageResponse(
internal fun LectureEvaluationExtraAverageResponse.toModel() = LectureEvaluationExtraAverage(
id = id,
lectureInfo = LectureInfo(
semesterList = semesterList.replace(" ","").split(","),
semesterList = semesterList.replace(" ", "").split(","),
professor = professor,
majorType = majorType,
lectureType = lectureType,
Expand Down

0 comments on commit 59c51a6

Please sign in to comment.