Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔗 :: (#227) recruitmentsearch -> searchrecruitment #248

Merged
merged 7 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Projects/Core/Sources/Steps/RecruitmentSearchStep.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Projects/Core/Sources/Steps/RecruitmentStep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import RxFlow
public enum RecruitmentStep: Step {
case recruitmentIsRequired
case recruitmentDetailIsRequired(recruitmentId: Int)
case recruitmentSearchIsRequired
case searchRecruitmentIsRequired
}
6 changes: 6 additions & 0 deletions Projects/Core/Sources/Steps/SearchRecruitmentStep.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import RxFlow

public enum SearchRecruitmentStep: Step {
case searchRecruitmentIsRequired
case recruitmentDetailIsRequired(id: Int)
}
16 changes: 8 additions & 8 deletions Projects/Flow/Sources/Recruitment/RecruitmentFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public final class RecruitmentFlow: Flow {
case let .recruitmentDetailIsRequired(id):
return navigateToRecruitmentDetail(recruitmentID: id)

case .recruitmentSearchIsRequired:
return navigateToRecruitmentSearch()
case .searchRecruitmentIsRequired:
return navigateToSearchRecruitment()
}
}
}
Expand Down Expand Up @@ -77,19 +77,19 @@ private extension RecruitmentFlow {
))
}

func navigateToRecruitmentSearch() -> FlowContributors {
let recruitmentSearchFlow = RecruitmentSearchFlow(container: container)
func navigateToSearchRecruitment() -> FlowContributors {
let searchRecruitmentFlow = SearchRecruitmentFlow(container: container)

Flows.use(recruitmentSearchFlow, when: .created) { (root) in
let view = root as? RecruitmentSearchViewController
Flows.use(searchRecruitmentFlow, when: .created) { (root) in
let view = root as? SearchRecruitmentViewController
self.rootViewController.pushViewController(
view!, animated: true
)
}

return .one(flowContributor: .contribute(
withNextPresentable: recruitmentSearchFlow,
withNextStepper: OneStepper(withSingleStep: RecruitmentSearchStep.recruitmentSearchIsRequired)
withNextPresentable: searchRecruitmentFlow,
withNextStepper: OneStepper(withSingleStep: SearchRecruitmentStep.searchRecruitmentIsRequired)
))
}
}
16 changes: 8 additions & 8 deletions Projects/Flow/Sources/Recruitment/RecruitmentSearchFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ import Swinject
import RxFlow
import Core

public final class RecruitmentSearchFlow: Flow {
public final class SearchRecruitmentFlow: Flow {
public let container: Container
private let rootViewController: RecruitmentSearchViewController
private let rootViewController: SearchRecruitmentViewController
public var root: Presentable {
return rootViewController
}

public init(container: Container) {
self.container = container
self.rootViewController = container.resolve(RecruitmentSearchViewController.self)!
self.rootViewController = container.resolve(SearchRecruitmentViewController.self)!
}

public func navigate(to step: Step) -> FlowContributors {
guard let step = step as? RecruitmentSearchStep else { return .none }
guard let step = step as? SearchRecruitmentStep else { return .none }

switch step {
case .recruitmentSearchIsRequired:
return navigateToRecruitmentSearch()
case .searchRecruitmentIsRequired:
return navigateToSearchRecruitment()

case let .recruitmentDetailIsRequired(id):
return navigateToRecruitmentDetail(id)
}
}
}

private extension RecruitmentSearchFlow {
func navigateToRecruitmentSearch() -> FlowContributors {
private extension SearchRecruitmentFlow {
func navigateToSearchRecruitment() -> FlowContributors {
return .one(flowContributor: .contribute(
withNextPresentable: rootViewController,
withNextStepper: rootViewController.viewModel
Expand Down
10 changes: 5 additions & 5 deletions Projects/Presentation/Sources/DI/PresentationAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ public final class PresentationAssembly: Assembly {
CompanyViewModel(fetchCompanyListUseCase: resolver.resolve(FetchCompanyListUseCase.self)!)
}

container.register(RecruitmentSearchViewController.self) { resolver in
RecruitmentSearchViewController(
resolver.resolve(RecruitmentSearchViewModel.self)!
container.register(SearchRecruitmentViewController.self) { resolver in
SearchRecruitmentViewController(
resolver.resolve(SearchRecruitmentViewModel.self)!
)
}
container.register(RecruitmentSearchViewModel.self) { resolver in
RecruitmentSearchViewModel(
container.register(SearchRecruitmentViewModel.self) { resolver in
SearchRecruitmentViewModel(
fetchRecruitmentListUseCase: resolver.resolve(FetchRecruitmentListUseCase.self)!,
bookmarkUseCase: resolver.resolve(BookmarkUseCase.self)!
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public final class RecruitmentViewModel: BaseViewModel, Stepper {

input.searchButtonDidTap.asObservable()
.map {
RecruitmentStep.recruitmentSearchIsRequired
RecruitmentStep.searchRecruitmentIsRequired
}
.bind(to: steps)
.disposed(by: disposeBag)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Then
import Core
import DesignSystem

public final class RecruitmentSearchViewController: BaseViewController<RecruitmentSearchViewModel> {
public final class SearchRecruitmentViewController: BaseViewController<SearchRecruitmentViewModel> {
private let searchButtonDidTap = PublishRelay<String>()
private let bookmarkButtonDidClicked = PublishRelay<Int>()
private let emptySearchView = ListEmptyView().then {
Expand Down Expand Up @@ -75,7 +75,7 @@ public final class RecruitmentSearchViewController: BaseViewController<Recruitme
}

public override func bind() {
let input = RecruitmentSearchViewModel.Input(
let input = SearchRecruitmentViewModel.Input(
viewAppear: self.viewWillAppearPublisher,
pageChange: searchTableView.rx.willDisplayCell
.filter {
Expand Down Expand Up @@ -125,7 +125,7 @@ public final class RecruitmentSearchViewController: BaseViewController<Recruitme
public override func configureNavigation() { }
}

extension RecruitmentSearchViewController: UITextFieldDelegate {
extension SearchRecruitmentViewController: UITextFieldDelegate {
public func textFieldShouldReturn(_ textField: UITextField) -> Bool {
let title = textField.text
viewModel.searchText = title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import RxFlow
import Core
import Domain

public final class RecruitmentSearchViewModel: BaseViewModel, Stepper {
public final class SearchRecruitmentViewModel: BaseViewModel, Stepper {
public let steps = PublishRelay<Step>()
private let disposeBag = DisposeBag()
private let fetchRecruitmentListUseCase: FetchRecruitmentListUseCase
Expand Down Expand Up @@ -83,7 +83,7 @@ public final class RecruitmentSearchViewModel: BaseViewModel, Stepper {

input.searchTableViewDidTap.asObservable()
.map {
RecruitmentSearchStep.recruitmentDetailIsRequired(
SearchRecruitmentStep.recruitmentDetailIsRequired(
id: self.recruitmentListInfo.value[$0.row].recruitID
)
}
Expand Down
Loading