Skip to content

Commit

Permalink
Merge pull request #91 from TeamHY2/Fix/#90-Ranking&Home-QA
Browse files Browse the repository at this point in the history
[Fix] RankingScreen QA 대응
  • Loading branch information
Seokki-Kwon authored Nov 13, 2024
2 parents 388b1f2 + 5860b4a commit 2bbb0b1
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 57 deletions.
19 changes: 13 additions & 6 deletions HongikYeolgong2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@
5E847A772CDBD5590034C2A7 /* AllStudyRecord.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E847A762CDBD5590034C2A7 /* AllStudyRecord.swift */; };
5EAE88722CDF9B4500DCBA31 /* UserProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EAE88712CDF9B4500DCBA31 /* UserProfile.swift */; };
5ED93CD72CE2311D004A7931 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5ED93CD62CE2311D004A7931 /* GoogleService-Info.plist */; };
5ED93CD92CE36905004A7931 /* AuthKey_843UNB7W58.p8 in Resources */ = {isa = PBXBuildFile; fileRef = 5ED93CD82CE36905004A7931 /* AuthKey_843UNB7W58.p8 */; };
5ED93CDB2CE3690D004A7931 /* Secrets-prod.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 5ED93CDA2CE3690D004A7931 /* Secrets-prod.xcconfig */; };
98B5F00A2CDB362C007CF5FA /* Secrets-dev.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 98B5F0092CDB362C007CF5FA /* Secrets-dev.xcconfig */; };
98B5F00C2CDB6226007CF5FA /* StudyTimeResponseDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98B5F00B2CDB6226007CF5FA /* StudyTimeResponseDTO.swift */; };
Expand Down Expand Up @@ -319,7 +318,6 @@
5E847A762CDBD5590034C2A7 /* AllStudyRecord.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllStudyRecord.swift; sourceTree = "<group>"; };
5EAE88712CDF9B4500DCBA31 /* UserProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfile.swift; sourceTree = "<group>"; };
5ED93CD62CE2311D004A7931 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
5ED93CD82CE36905004A7931 /* AuthKey_843UNB7W58.p8 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AuthKey_843UNB7W58.p8; sourceTree = "<group>"; };
5ED93CDA2CE3690D004A7931 /* Secrets-prod.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Secrets-prod.xcconfig"; sourceTree = "<group>"; };
98B5F0092CDB362C007CF5FA /* Secrets-dev.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Secrets-dev.xcconfig"; sourceTree = "<group>"; };
98B5F00B2CDB6226007CF5FA /* StudyTimeResponseDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudyTimeResponseDTO.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -455,6 +453,14 @@
path = WiseSaying;
sourceTree = "<group>";
};
474FF2FB2CE36F4100ABEE63 /* Recovered References */ = {
isa = PBXGroup;
children = (
5ED93CDA2CE3690D004A7931 /* Secrets-prod.xcconfig */,
);
name = "Recovered References";
sourceTree = "<group>";
};
4763FFB62CB9133600990336 /* Util */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -808,6 +814,7 @@
47B1D4BB2C9CB1760071B62B /* HongikYeolgong2Tests */,
47B1D4C52C9CB1760071B62B /* HongikYeolgong2UITests */,
47B1D4A92C9CB1740071B62B /* Products */,
474FF2FB2CE36F4100ABEE63 /* Recovered References */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -1456,7 +1463,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 16;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"HongikYeolgong2/Resources/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = P4D4ZQC4YF;
Expand All @@ -1478,7 +1485,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.5;
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.teamHY2.HongikYeolgong2;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1503,7 +1510,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 16;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"HongikYeolgong2/Resources/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = P4D4ZQC4YF;
Expand All @@ -1525,7 +1532,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.5;
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.teamHY2.HongikYeolgong2;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
version = "1.8">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,43 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<key>Promises (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>3</integer>
<integer>4</integer>
</dict>
<key>Promises (Playground).xcscheme</key>
<key>Promises (Playground) 3.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>Promises (Playground) 4.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
</dict>
<key>Promises (Playground) 5.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>6</integer>
</dict>
<key>Promises (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class StudySessionInteractorImpl: StudySessionInteractor {
private let cancleBag = CancelBag()
private let studySessionRepository: StudySessionRepository
private let timer = Timer.publish(every: 1.0, on: .main, in: .common).autoconnect()
private let addedTime: TimeInterval = .init(minutes: 1)
private let addedTime: TimeInterval = .init(minutes: 31)

private var lastTime: Date?
private var subscription: AnyCancellable?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,46 @@ final class UserDataMigrationInteractor: UserDataInteractor {
self.socialLoginRepository = socialLoginRepository
}


/// 기존 유저를 검색하고 ID를 반환합니다.
/// - Parameter idToken: identityToken
/// - Returns: 유저ID
/// NOTE: - 유저를 찾지 못하는 경우 실패없이 성공을 반환하고 가입을 진행합니다.
func findFirebaseUser(with idToken: String) -> AnyPublisher<String, Never> {
let nonce = randomNonceString()
return Future<String, Never> { promise in

let credential = OAuthProvider.credential(
withProviderID: "apple.com",
idToken: idToken,
rawNonce: nonce
)

Auth.auth().signIn(with: credential) { [weak self] (result, error) in
guard let self = self,
let userId = result?.user.uid else {
promise(.success(""))
return
}

let docRef = db.collection("User").document(userId)

docRef.getDocument { (document, error) in
guard let isDocExists = document?.exists else {
promise(.success(""))
return
}

if isDocExists {
promise(.success(userId))
} else {
promise(.success(""))
}
}
}
}.eraseToAnyPublisher()
}

/// 애플로그인을 요청합니다.
/// - Parameter authorization: ASAuthorization
func requestAppleLogin(_ authorization: ASAuthorization) {
Expand All @@ -43,39 +83,14 @@ final class UserDataMigrationInteractor: UserDataInteractor {
return
}

// nonce 생성
let nonce = randomNonceString()
// credential 생성
let credential = OAuthProvider.credential(
withProviderID: "apple.com",
idToken: idToken,
rawNonce: nonce
)

var uid: String = ""

// credential로 로그인 요청
Auth.auth().signIn(with: credential) { [weak self] (result, error) in
guard let self = self,
let userId = result?.user.uid else { return }

let docRef = db.collection("User").document(userId)

docRef.getDocument { (document, error) in
guard error == nil else { return }

guard let isDocExists = document?.exists else { return }

if isDocExists {
uid = userId
findFirebaseUser(with: idToken)
.flatMap { [weak self] userID -> AnyPublisher<LoginResponseDTO, NetworkError> in
guard let self = self else {
return Fail(error: NetworkError.decodingError("")).eraseToAnyPublisher()
}
let loginReqDto: LoginRequestDTO = .init(email: userID, idToken: idToken)
return authRepository.signIn(loginReqDto: loginReqDto)
}
}

let loginReqDto: LoginRequestDTO = .init(email: uid, idToken: idToken)

authRepository
.signIn(loginReqDto: loginReqDto)
.receive(on: DispatchQueue.main)
.sink(
receiveCompletion: { _ in},
Expand Down
2 changes: 1 addition & 1 deletion HongikYeolgong2/Injected/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension AppState {
var startTime: Date = .now
var endTime: Date = .now
var remainingTime: TimeInterval = 0
var minimumTime: TimeInterval = .init(seconds: 30)
var minimumTime: TimeInterval = .init(minutes: 30)

var isAddTime: Bool {
remainingTime <= minimumTime
Expand Down
4 changes: 2 additions & 2 deletions HongikYeolgong2/Models/StudyNotificationType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ enum StudyNotificationType {
var timeOffset: TimeInterval {
switch self {
case .extensionAvailable:
return .init(seconds: 30)
return .init(minutes: 30)
case .urgent:
return .init(seconds: 10)
return .init(minutes: 10)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct OnboardingPageView: View {
ForEach(0..<3, id: \.self) { index in
Group {
if index == tabIndex {
Image(.shineCount02)
Image(.shineOnboarding)
.frame(width: 9, height: 9)
} else {
Circle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct OnboardingView: View {
NavigationStack {
VStack {
Spacer()

OnboardingPageView(tabIndex: $tabIndex)

AppleLoginButton(
Expand Down
23 changes: 14 additions & 9 deletions HongikYeolgong2/Presentation/Ranking/Component/RankingCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,47 @@ struct RankingCell: View {
var body: some View {
VStack(spacing: 0) {
HStack(spacing: 0) {
HStack(spacing: 14) {
HStack(spacing: 14.adjustToScreenWidth) {
Text("\(departmentRankInfo.currentRank)")
.font(.pretendard(size: 16, weight: .regular))
.foregroundStyle(setFontColor)

Text(departmentRankInfo.department)
.font(.pretendard(size: 16, weight: .regular), lineHeight: 26.adjustToScreenHeight)
.foregroundStyle(setFontColor)
.lineLimit(1)
}

Spacer()

HStack(spacing: 22) {
HStack(spacing: 0) {
Text("\(departmentRankInfo.studyDurationOfWeek)H")
.font(.pretendard(size: 12, weight: .regular))
.foregroundStyle(setFontColor)
HStack(spacing: 7) {
Text("\(departmentRankInfo.rankChange)")


HStack {
Text(rankChangeText)
.font(.pretendard(size: 12, weight: .regular))
.foregroundStyle(setFontColor)
.frame(maxWidth: 40, alignment: .trailing)

rankImage
}
}
}
.padding(EdgeInsets(
top: 13.adjustToScreenHeight,
leading: 24.adjustToScreenWidth,
bottom: 13.adjustToScreenHeight,
trailing: 24.adjustToScreenWidth))
.padding(.vertical, 13.adjustToScreenHeight)
.padding(.horizontal, 24.adjustToScreenWidth)
}
.background(setBackground)
}
}

extension RankingCell {
private var rankChangeText: String {
departmentRankInfo.rankChange > 0 ? "+\(departmentRankInfo.rankChange)" : "\(departmentRankInfo.rankChange)"
}

private var setBackground: some View {
switch departmentRankInfo.currentRank {
case 1:
Expand Down
3 changes: 2 additions & 1 deletion HongikYeolgong2/Presentation/Record/RecordView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ struct RecordView: View {
minutes: studyTime.dayMinutes)
}
}
.modifier(IOSBackground())

.padding(.horizontal, 32.adjustToScreenWidth)
.padding(.top, 32.adjustToScreenHeight)
.padding(.bottom, 36.adjustToScreenHeight)
.modifier(IOSBackground())
.onAppear {
// 이용 시간 가져오기
studyTimeInteractor.getStudyTime(StudyTime: $studyTime)
Expand Down
2 changes: 1 addition & 1 deletion HongikYeolgong2/Presentation/Root/InitialView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct InitialView: View {
.onAppear { checkUserSession() }
}
}
.onAppear {
.onAppear {
resolveUserPermissions()
}
.onReceive(canRequestFirstPushPermissions) { _ in
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "shineOnboarding.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2bbb0b1

Please sign in to comment.