Skip to content

Commit

Permalink
Merge pull request #127 from pknu-wap/refactor/tgyuu/#125
Browse files Browse the repository at this point in the history
Refactor/tgyuu/#125
  • Loading branch information
tgyuuAn authored Feb 18, 2024
2 parents 28a2281 + 50f9aed commit a1bf5fe
Show file tree
Hide file tree
Showing 61 changed files with 975 additions and 766 deletions.
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

117 changes: 0 additions & 117 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

15 changes: 1 addition & 14 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .idea/dictionaries/jaino.xml

This file was deleted.

3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 0 additions & 25 deletions .idea/jarRepositories.xml

This file was deleted.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/src/main/java/com/wap/wapp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
13 changes: 12 additions & 1 deletion app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ fun WappNavHost(
)
},
navigateToSurveyDetail = navController::navigateToSurveyDetail,
navigateToSurvey = {
navController.navigateToSurvey(
navOptions { popUpTo(surveyCheckRoute) { inclusive = true } },
)
},
)
managementSurveyNavGraph(
navigateToManagement = navController::navigateToManagement,
Expand All @@ -109,7 +114,13 @@ fun WappNavHost(
)
attendanceScreen(
navigateToSignIn = {
navController.navigateToSignIn(navOptions { popUpTo(attendanceNavigationRoute) })
navController.navigateToSignIn(
navOptions {
popUpTo(
attendanceNavigationRoute,
)
},
)
},
navigateToAttendanceManagement = navController::navigateToAttendanceManagement,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,32 @@ import java.net.UnknownHostException

fun Throwable.toSupportingText(): String {
return when (this) {
is UnknownHostException -> {
"네트워크 연결이 원활하지 않습니다."
}
is FirebaseAuthException -> {
this.toSupportingText()
}
is FirebaseFirestoreException -> {
this.toSupportingText()
}
else -> {
"알 수 없는 오류가 발생하였습니다."
}
is UnknownHostException -> "네트워크 연결이 원활하지 않습니다."

is FirebaseAuthException -> this.toSupportingText()

is FirebaseFirestoreException -> this.toSupportingText()

is IllegalStateException -> this.message.toString()

else -> "알 수 없는 오류가 발생하였습니다."
}
}

fun FirebaseAuthException.toSupportingText(): String {
return when (this.errorCode) {
"ERROR_WEB_CONTEXT_CANCELED", "ERROR_USER_CANCELLED" -> {
"다시 시도해 주세요."
}
else -> {
"알 수 없는 오류가 발생하였습니다."
}
"ERROR_WEB_CONTEXT_CANCELED", "ERROR_USER_CANCELLED" -> "다시 시도해 주세요."

else -> "알 수 없는 오류가 발생하였습니다."
}
}

fun FirebaseFirestoreException.toSupportingText(): String {
return when (this.code.value()) {
7 -> {
"접근 권한이 없습니다."
}
16 -> {
"회원이 만료되었습니다. 다시 로그인 해주세요."
}
else -> {
"알 수 없는 오류가 발생하였습니다."
}
7 -> "접근 권한이 없습니다."

16 -> "회원이 만료되었습니다. 다시 로그인 해주세요."

else -> "알 수 없는 오류가 발생하였습니다."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun WappLeftMainTopBar(
verticalArrangement = Arrangement.spacedBy(16.dp),
horizontalAlignment = Alignment.Start,
modifier = modifier
.padding(top = 40.dp, start = 24.dp, end = 24.dp, bottom = 20.dp)
.padding(top = 40.dp, start = 24.dp, end = 24.dp, bottom = 40.dp)
.fillMaxWidth()
.wrapContentHeight(),
) {
Expand Down Expand Up @@ -79,7 +79,7 @@ fun WappRightMainTopBar(
verticalArrangement = Arrangement.spacedBy(16.dp),
horizontalAlignment = Alignment.End,
modifier = modifier
.padding(top = 40.dp, start = 24.dp, end = 24.dp, bottom = 20.dp)
.padding(top = 40.dp, start = 24.dp, end = 24.dp, bottom = 40.dp)
.fillMaxWidth()
.wrapContentHeight(),
) {
Expand Down
Loading

0 comments on commit a1bf5fe

Please sign in to comment.