Skip to content

Commit

Permalink
Merge pull request #223 from Hyeonz1/main
Browse files Browse the repository at this point in the history
[AOS/FEAT] 운영용 URL 적용 및 행사 종료 시 참석 상태 수정 불가 설정
  • Loading branch information
Hyeonz1 authored Jan 12, 2024
2 parents e7c599c + e0af511 commit d797fb2
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 30 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/eeos-android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ jobs:
distribution: 'temurin'
cache: gradle

- name: Change Current Directory
run: cd ./AOS
- name: Grant execute permission for gradlew
run: chmod +x gradlew
run: chmod +x ./AOS/gradlew
- name: Build with Gradle
run: ./gradlew build
run: ./AOS/gradlew build
10 changes: 10 additions & 0 deletions AOS/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ android {
namespace 'com.example.eeos'
compileSdk 33

signingConfigs {
releaseWithSignedKey {
keyAlias KEY_ALIAS
keyPassword KEY_PASSWORD
storeFile file(STORE_FILE)
storePassword STORE_PASSWORD
}
}

defaultConfig {
applicationId "com.example.eeos"
minSdk 31
Expand All @@ -40,6 +49,7 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releaseWithSignedKey
}
}
compileOptions {
Expand Down
5 changes: 5 additions & 0 deletions AOS/app/src/main/java/com/example/eeos/consts/Consts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ object SnackBarMessage {
const val onAttendStatusChanged = "참석 상태가 변경 되었습니다."
const val onLogout = "성공적으로 로그아웃 되었습니다."
}

object ProgramStatus {
const val active = "active"
const val end = "end"
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AddHeaderInterceptor : Interceptor {
if (refreshToken != null) {
val reIssueRequest = originalRequest.newBuilder()
.post("".toRequestBody())
.url("https://dev.eeos.store/api/auth/reissue")
.url("https://eeos.store/api/auth/reissue")
.addHeader("Cookie", refreshToken)
.build()
val reIssueResponse = chain.proceed(reIssueRequest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ data class ResponseGetProgramDetailDto(
deadLine = deadLine,
content = content,
category = category,
type = type
type = type,
programStatus = programStatus
)
}
3 changes: 2 additions & 1 deletion AOS/app/src/main/java/com/example/eeos/di/RetrofitModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import retrofit2.converter.gson.GsonConverterFactory
object RetrofitModule {
private const val MOCK_URL = "https://562ee14c-9738-4e79-ba16-f8d78480a890.mock.pstmn.io/api/"
private const val BE_DEV_URL = "https://dev.eeos.store/api/"
private const val BE_OPERATE_URL = "https://eeos.store/api/"

@Provides
@Singleton
Expand Down Expand Up @@ -59,7 +60,7 @@ object RetrofitModule {
client: OkHttpClient,
gsonFactory: Converter.Factory
): Retrofit = Retrofit.Builder()
.baseUrl(BE_DEV_URL)
.baseUrl(BE_OPERATE_URL)
.client(client)
.addCallAdapterFactory(ApiResponseCallAdapterFactory.create()) // Here!
.addConverterFactory(gsonFactory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ data class ProgramDetail(
val deadLine: String,
val content: String,
val category: String,
val type: String
val type: String,
val programStatus: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ data class ProgramDetailUiState(
val title: String = "",
val deadLine: String = "",
val content: String = "",
val programType: String = ""
val programType: String = "",
val programStatus: String = ""
)

@HiltViewModel
Expand All @@ -45,7 +46,8 @@ class ProgramDetailViewModel @Inject constructor(
title = programDetail.title,
deadLine = deadLine,
content = programDetail.content,
programType = programDetail.type
programType = programDetail.type,
programStatus = programDetail.programStatus
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import com.example.eeos.R
import com.example.eeos.consts.AttendStatus
import com.example.eeos.consts.ProgramStatus
import com.example.eeos.consts.attendStatusMap
import com.example.eeos.presentation.detail.ProgramDetailUiState
import com.example.eeos.presentation.detail.ProgramDetailViewModel
import com.example.eeos.presentation.detail.confirmdialog.ConfirmAttendStatusDialog

@Composable
fun AttendStatusButtons(
programDetailUiState: State<ProgramDetailUiState>,
attendanceUiState: State<UserAttendStatusUiState>,
putUserAttendStatus: (String) -> Unit
) {
Expand Down Expand Up @@ -52,23 +56,29 @@ fun AttendStatusButtons(
}

AttendButton(
selectedAttendStatus = selectedAttendStatus
selectedAttendStatus = if (programDetailUiState.value.programStatus == ProgramStatus.end) { "" } else { selectedAttendStatus }
) {
if (attendanceUiState.value.userAttendStatus != AttendStatus.nonRelated) {
if (attendanceUiState.value.userAttendStatus != AttendStatus.nonRelated &&
programDetailUiState.value.programStatus == ProgramStatus.active
) {
onChangeAttendStatus(AttendStatus.attend)
}
}
LateButton(
selectedAttendStatus = selectedAttendStatus
selectedAttendStatus = if (programDetailUiState.value.programStatus == ProgramStatus.end) { "" } else { selectedAttendStatus }
) {
if (attendanceUiState.value.userAttendStatus != AttendStatus.nonRelated) {
if (attendanceUiState.value.userAttendStatus != AttendStatus.nonRelated &&
programDetailUiState.value.programStatus == ProgramStatus.active
) {
onChangeAttendStatus(AttendStatus.late)
}
}
AbsentButton(
selectedAttendStatus = selectedAttendStatus
selectedAttendStatus = if (programDetailUiState.value.programStatus == ProgramStatus.end) { "" } else { selectedAttendStatus }
) {
if (attendanceUiState.value.userAttendStatus != AttendStatus.nonRelated) {
if (attendanceUiState.value.userAttendStatus != AttendStatus.nonRelated &&
programDetailUiState.value.programStatus == ProgramStatus.active
) {
onChangeAttendStatus(AttendStatus.absent)
}
}
Expand Down Expand Up @@ -119,6 +129,7 @@ private fun AbsentButton(selectedAttendStatus: String?, onClick: () -> Unit) {
private fun AttendStatusButtonsPreview() {
MaterialTheme {
AttendStatusButtons(
programDetailUiState = hiltViewModel<ProgramDetailViewModel>().detailUiState.collectAsState(),
attendanceUiState = hiltViewModel<UserAttendStatusViewModel>().userAttendStatusUiState.collectAsState(),
putUserAttendStatus = { p1 -> },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import com.example.eeos.R
import com.example.eeos.consts.AttendStatus
import com.example.eeos.consts.ProgramStatus
import com.example.eeos.domain.model.Member
import com.example.eeos.presentation.detail.ProgramDetailUiState
import com.example.eeos.presentation.detail.ProgramDetailViewModel
Expand Down Expand Up @@ -87,11 +88,31 @@ fun BottomSheetContents(
)
)
)
Text(
text = stringResource(R.string.detail_bottom_sheet_description),
style = MaterialTheme.typography.bodySmall,
color = colorResource(R.color.paragraph)
)
if (attendanceUiState.value.userAttendStatus != AttendStatus.nonRelated &&
programDetailUiState.value.programStatus == ProgramStatus.active
) {
Text(
text = stringResource(R.string.detail_bottom_sheet_description_can_change),
style = MaterialTheme.typography.bodySmall,
color = colorResource(R.color.paragraph)
)
} else if (attendanceUiState.value.userAttendStatus != AttendStatus.nonRelated &&
programDetailUiState.value.programStatus == ProgramStatus.end
) {
Text(
text = stringResource(
R.string.detail_bottom_sheet_description_cant_change_program_end
),
style = MaterialTheme.typography.bodySmall,
color = colorResource(R.color.paragraph)
)
} else {
Text(
text = stringResource(R.string.detail_bottom_sheet_description_cant_change),
style = MaterialTheme.typography.bodySmall,
color = colorResource(R.color.paragraph)
)
}
Spacer(
modifier = Modifier.height(
height = dimensionResource(
Expand All @@ -100,6 +121,7 @@ fun BottomSheetContents(
)
)
AttendStatusButtons(
programDetailUiState = programDetailUiState,
attendanceUiState = attendanceUiState,
putUserAttendStatus = putUserAttendStatus
)
Expand Down
20 changes: 11 additions & 9 deletions AOS/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
<string name="detail_bottom_sheet_irrelevant">본 행사와 관련 없음</string>
<string name="detail_bottom_sheet_check_attendance">출석 체크 해주세요!</string>
<string name="detail_bottom_sheet_do_survey">수요 조사 해주세요!</string>
<string name="detail_bottom_sheet_description">본인의 출석 상태를 선택해 주세요.</string>
<string name="detail_bottom_sheet_description_can_change">본인의 출석 상태를 선택해 주세요.</string>
<string name="detail_bottom_sheet_description_cant_change">출석 상태를 변경할 수 없습니다.</string>
<string name="detail_bottom_sheet_description_cant_change_program_end">종료된 행사는 출석 상태를 변경할 수 없습니다.</string>


<!--Attend Status Confirm Dialog-->
Expand All @@ -59,14 +61,14 @@
<!--asset-->
<string name="asset_statements">
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example.eeos",
"sha256_cert_fingerprints":
["90:3F:9B:5A:EA:08:34:C7:2C:87:6B:41:0F:BC:C3:99:E0:2E:29:BD:B9:A7:AA:5E:6F:5F:E8:25:08:DC:D6:DF"]
}
}]
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example.eeos",
"sha256_cert_fingerprints":
["0F:B7:33:22:11:78:C2:48:CE:30:1E:29:53:BE:44:87:BF:53:4B:40:5C:F2:2B:29:5E:5D:CA:C3:9A:44:7D:2E"]
}
}]
</string>

</resources>

0 comments on commit d797fb2

Please sign in to comment.