From 60c28b2d76fd5fedadd6c7ff1222032753f55a80 Mon Sep 17 00:00:00 2001 From: ray3238 Date: Tue, 23 Jul 2024 14:24:29 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=A7=A9=20::=20step=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Core/Sources/Steps/HomeStep.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projects/Core/Sources/Steps/HomeStep.swift b/Projects/Core/Sources/Steps/HomeStep.swift index ac1ae26f..74012c0c 100644 --- a/Projects/Core/Sources/Steps/HomeStep.swift +++ b/Projects/Core/Sources/Steps/HomeStep.swift @@ -17,4 +17,6 @@ public enum HomeStep: Step { companyName: String, companyImageURL: String ) + case recruitmentDetailIsRequired(id: Int) + case none } From 3f214bbd199481b3f5fe6aeb62e77ea9f73f8ac8 Mon Sep 17 00:00:00 2001 From: ray3238 Date: Tue, 23 Jul 2024 14:24:52 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A7=A9=20::=20Flow=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Flow/Sources/Home/HomeFlow.swift | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Projects/Flow/Sources/Home/HomeFlow.swift b/Projects/Flow/Sources/Home/HomeFlow.swift index 42175aff..9be291d6 100644 --- a/Projects/Flow/Sources/Home/HomeFlow.swift +++ b/Projects/Flow/Sources/Home/HomeFlow.swift @@ -36,6 +36,12 @@ public final class HomeFlow: Flow { case let .reApplyIsRequired(recruitmentID, applicationID, companyName, companyImageURL): return navigateToReApply(recruitmentID, applicationID, companyName, companyImageURL) + + case let .recruitmentDetailIsRequired(id): + return navigateToRecruitmentDetail(id) + + case .none: + return .none } } } @@ -156,4 +162,32 @@ private extension HomeFlow { ) )) } + + func navigateToRecruitmentDetail(_ recruitmentID: Int) -> FlowContributors { + let recruitmentDetailFlow = RecruitmentDetailFlow(container: container) + + Flows.use(recruitmentDetailFlow, when: .created) { (root) in + let view = root as? RecruitmentDetailViewController + view?.viewModel.recruitmentID = recruitmentID + view?.isPopViewController = { id, bookmark in + let popView = self.rootViewController.topViewController as? RecruitmentViewController + var oldData = popView?.viewModel.recruitmentData.value + oldData?.enumerated().forEach { + if $0.element.recruitID == id { + oldData![$0.offset].bookmarked = bookmark + } + } + popView?.viewModel.recruitmentData.accept(oldData!) + popView?.isTabNavigation = false + } + self.rootViewController.pushViewController( + view!, animated: true + ) + } + + return .one(flowContributor: .contribute( + withNextPresentable: recruitmentDetailFlow, + withNextStepper: OneStepper(withSingleStep: RecruitmentDetailStep.recruitmentDetailIsRequired) + )) + } } From 75c41a9a20a0d33d378c94802ce196977f22395f Mon Sep 17 00:00:00 2001 From: ray3238 Date: Tue, 23 Jul 2024 14:25:15 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A7=A9=20::=20VC,=20VM=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Home/HomeViewController.swift | 6 +++++- .../Presentation/Sources/Home/HomeViewModel.swift | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Projects/Presentation/Sources/Home/HomeViewController.swift b/Projects/Presentation/Sources/Home/HomeViewController.swift index 45aad217..19d7adc8 100644 --- a/Projects/Presentation/Sources/Home/HomeViewController.swift +++ b/Projects/Presentation/Sources/Home/HomeViewController.swift @@ -113,7 +113,11 @@ public final class HomeViewController: BaseViewController { navigateToEasterEggDidTap: navigateToEasterEggDidTap, navigateToCompanyButtonDidTap: findCompanysCard.rx.tap.asSignal(), rejectButtonDidTap: rejectButtonDidTap, - reApplyButtonDidTap: reApplyButtonDidTap + reApplyButtonDidTap: reApplyButtonDidTap, + applicationStatusTableViewDidTap: applicationStatusTableView.rx + .modelSelected(ApplicationEntity.self) + .asObservable() + .map { ($0.recruitmentID, $0.applicationStatus) } ) titleImageView.rx.tapGesture().when(.recognized).asObservable() diff --git a/Projects/Presentation/Sources/Home/HomeViewModel.swift b/Projects/Presentation/Sources/Home/HomeViewModel.swift index 19f7dfc1..624358cc 100644 --- a/Projects/Presentation/Sources/Home/HomeViewModel.swift +++ b/Projects/Presentation/Sources/Home/HomeViewModel.swift @@ -32,6 +32,7 @@ public final class HomeViewModel: BaseViewModel, Stepper { let navigateToCompanyButtonDidTap: Signal let rejectButtonDidTap: PublishRelay let reApplyButtonDidTap: PublishRelay + let applicationStatusTableViewDidTap: Observable<(Int, ApplicationStatusType)> } public struct Output { @@ -125,6 +126,17 @@ public final class HomeViewModel: BaseViewModel, Stepper { .bind(to: steps) .disposed(by: disposeBag) + input.applicationStatusTableViewDidTap.asObservable() + .map { id, status in + if status == .pass || status == .fieldTrain { + return HomeStep.recruitmentDetailIsRequired(id: id) + } else { + return HomeStep.none + } + } + .bind(to: steps) + .disposed(by: disposeBag) + return Output( studentInfo: studentInfo, applicationList: applicationList,