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

๐Ÿ”— :: (#178) ๋ฉด์ ‘ํ›„๊ธฐ ์ž‘์„ฑ & ์กฐํšŒ ๊ฐœ๋ฐœ #250

Merged
merged 54 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6d4a470
๐ŸŒฑ :: Step ์„ค์ •
ray3238 Jun 10, 2024
f1f4100
๐ŸŒฑ :: Flow ์„ค์ •
ray3238 Jun 10, 2024
2706e70
๐ŸŒฑ :: TextField PlaceholderTextColor ๋ณ€๊ฒฝ ํ•จ์ˆ˜ ์ถ”๊ฐ€
ray3238 Jun 10, 2024
22af8f9
๐ŸŒฑ :: ๋ฉด์ ‘ ํ›„๊ธฐ ์ž‘์„ฑ ํผ๋ธ”๋ฆฌ์‹ฑ
ray3238 Jun 10, 2024
a9ba3ea
๐Ÿ› ๏ธ :: ์ฃผ์„ ์ œ๊ฑฐ
ray3238 Jun 10, 2024
16fd0bb
๐Ÿ› ๏ธ :: ๋ณ€์ˆ˜๋ช… ๋ณ€๊ฒฝ
ray3238 Jun 10, 2024
9995a6d
๐ŸŒฑ :: WritableReviewViewModel ์ถ”๊ฐ€
ray3238 Jun 10, 2024
fbdf238
๐ŸŒฑ :: AddReview VC, VM ์„ค์ •
ray3238 Jun 10, 2024
d81d8e3
๐ŸŒฑ :: VC, VM ๋“ฑ๋ก
ray3238 Jun 10, 2024
c2ad28d
๐ŸŒฑ :: InterviewReview VC, VM ์„ค์ •
ray3238 Jun 11, 2024
d4bfc78
๐ŸŒฑ :: Step ๋ฐ Flow ์„ค์ •
ray3238 Jun 11, 2024
439cead
๐Ÿ› ๏ธ :: ๋กœ์ง ์„ค์ •
ray3238 Jun 11, 2024
a33b466
๐ŸŒฑ :: ์•ฑ ๋“ฑ๋ก
ray3238 Jun 11, 2024
0c32cb4
๐ŸŒฑ :: ํ›„๊ธฐ ์ž‘์„ฑ BottomSheet ์ถ”๊ฐ€
ray3238 Jun 11, 2024
df4f448
๐ŸŒฑ :: Flow ์„ค์ •
ray3238 Jun 12, 2024
3750e3c
๐Ÿ› ๏ธ :: Step ์žฌ์„ค์ •
ray3238 Jun 12, 2024
3c9487a
๐ŸŒฑ :: viewModel ๋“ฑ๋ก
ray3238 Jun 12, 2024
36be6f6
๐ŸŒฑ :: ReviewDetail API ์—ฐ๋™
ray3238 Jun 12, 2024
e838d6c
๐ŸŒฑ :: Step์œผ๋กœ ๊ฐ’ ์ „๋‹ฌ
ray3238 Jun 12, 2024
7c8e896
๐ŸŒฑ :: WritableReview ์„ค์ •
ray3238 Jun 12, 2024
cd291fa
๐ŸŒฑ :: Step ์„ค์ •
ray3238 Jun 10, 2024
8a7a7bd
๐ŸŒฑ :: Flow ์„ค์ •
ray3238 Jun 10, 2024
2555071
๐ŸŒฑ :: TextField PlaceholderTextColor ๋ณ€๊ฒฝ ํ•จ์ˆ˜ ์ถ”๊ฐ€
ray3238 Jun 10, 2024
bd8a75f
๐ŸŒฑ :: ๋ฉด์ ‘ ํ›„๊ธฐ ์ž‘์„ฑ ํผ๋ธ”๋ฆฌ์‹ฑ
ray3238 Jun 10, 2024
99dc66d
๐Ÿ› ๏ธ :: ์ฃผ์„ ์ œ๊ฑฐ
ray3238 Jun 10, 2024
6105ba0
๐Ÿ› ๏ธ :: ๋ณ€์ˆ˜๋ช… ๋ณ€๊ฒฝ
ray3238 Jun 10, 2024
5b74c5c
๐ŸŒฑ :: WritableReviewViewModel ์ถ”๊ฐ€
ray3238 Jun 10, 2024
9cf8caa
๐ŸŒฑ :: AddReview VC, VM ์„ค์ •
ray3238 Jun 10, 2024
34ecac9
๐ŸŒฑ :: VC, VM ๋“ฑ๋ก
ray3238 Jun 10, 2024
de638ed
๐ŸŒฑ :: InterviewReview VC, VM ์„ค์ •
ray3238 Jun 11, 2024
2ce77b8
๐ŸŒฑ :: Step ๋ฐ Flow ์„ค์ •
ray3238 Jun 11, 2024
f68b6b0
๐Ÿ› ๏ธ :: ๋กœ์ง ์„ค์ •
ray3238 Jun 11, 2024
dd0d0e6
๐ŸŒฑ :: ์•ฑ ๋“ฑ๋ก
ray3238 Jun 11, 2024
263094d
๐ŸŒฑ :: ํ›„๊ธฐ ์ž‘์„ฑ BottomSheet ์ถ”๊ฐ€
ray3238 Jun 11, 2024
8e481c2
๐ŸŒฑ :: Flow ์„ค์ •
ray3238 Jun 12, 2024
12e8710
๐Ÿ› ๏ธ :: Step ์žฌ์„ค์ •
ray3238 Jun 12, 2024
7ff5f7f
๐ŸŒฑ :: viewModel ๋“ฑ๋ก
ray3238 Jun 12, 2024
898f33b
๐ŸŒฑ :: ReviewDetail API ์—ฐ๋™
ray3238 Jun 12, 2024
d35cbed
๐ŸŒฑ :: Step์œผ๋กœ ๊ฐ’ ์ „๋‹ฌ
ray3238 Jun 12, 2024
b18e767
๐ŸŒฑ :: WritableReview ์„ค์ •
ray3238 Jun 12, 2024
706c4bb
Merge branch 'feature/(#178)-interview_review' of https://github.com/โ€ฆ
ray3238 Jun 12, 2024
fbd7e20
๐ŸŒฑ :: Step ๋ฐ Flow ์„ค์ •
ray3238 Jun 19, 2024
509544e
๐ŸŒฑ :: ๋ณ€์ˆ˜๋ช… ์ˆ˜์ •
ray3238 Jun 19, 2024
2b34fcc
๐Ÿ› ๏ธ :: ๋ชจ์ง‘์˜๋ขฐ์„œ ํ•„ํ„ฐ techCode ๋ฐ›์•„์˜ค๋Š” ํƒ€์ž… ๋ณ€๊ฒฝ
ray3238 Jun 19, 2024
5a0ee9e
๐Ÿ› ๏ธ :: ๋ฉด์ ‘ ํ›„๊ธฐ ์ž‘์„ฑ TechCode ๋ถ€๋ถ„ ์ˆ˜์ • ๋ฐ ์ถ”๊ฐ€
ray3238 Jun 19, 2024
a6fc1a3
๐ŸŒฑ :: ๋ฉด์ ‘ ํ›„๊ธฐ ์ž‘์„ฑ BottomSheet ํผ๋ธ”๋ฆฌ์‹ฑ
ray3238 Jun 19, 2024
a4a5042
๐ŸŒฑ :: ๋ฉด์ ‘ ํ›„๊ธฐ ๊ด€๋ จ API ์—ฐ๋™
ray3238 Jun 19, 2024
1e67fd4
๐Ÿ› ๏ธ :: ํ•„์š”์—†๋Š” ์ฝ”๋“œ ์‚ญ์ œ
ray3238 Jun 19, 2024
8a556c9
๐ŸŒฑ :: ๋ฉด์ ‘ ํ›„๊ธฐ ๋ทฐ ๋“ฑ๋ก
ray3238 Jun 19, 2024
d722b66
๐Ÿ› ๏ธ :: addReviewButton ํ™œ์„ฑํ™” ๋น„ํ™œ์„ฑํ™” ์„ค์ •
ray3238 Jun 20, 2024
80c1dc2
๐Ÿ› ๏ธ :: addReviewButton ๋ณ€์ˆ˜๋ช… ์ˆ˜์ •
ray3238 Jun 20, 2024
ee2cfd0
๐Ÿ› ๏ธ :: QnaEntity ๊ฐ€์ ธ์˜ค๋Š” ๋กœ์ง ์ˆ˜์ •
ray3238 Jun 20, 2024
afbd0d8
๐Ÿ› ๏ธ :: ์ฃผ์„ ์‚ญ์ œ
ray3238 Jun 20, 2024
f068691
๐ŸŒฑ :: ๋ฉด์ ‘ ํ›„๊ธฐ ์ถ”๊ฐ€ ์‹œ pop ์ฒ˜๋ฆฌ
ray3238 Jun 20, 2024
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: 6 additions & 0 deletions Projects/Core/Sources/Steps/AddReviewStep.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import RxFlow

public enum AddReviewStep: Step {
case addReviewIsRequired
case dismissToWritableReview
}
4 changes: 4 additions & 0 deletions Projects/Core/Sources/Steps/CompanyDetailStep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ public enum CompanyDetailStep: Step {
case companyDetailIsRequired
case popIsRequired
case recruitmentDetailIsRequired(id: Int)
case interviewReviewDetailIsRequired(
id: Int,
name: String
)
}
5 changes: 5 additions & 0 deletions Projects/Core/Sources/Steps/InterviewReviewStep.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import RxFlow

public enum InterviewReviewDetailStep: Step {
case interviewReviewDetailIsRequired
}
1 change: 1 addition & 0 deletions Projects/Core/Sources/Steps/MyPageStep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import RxFlow
public enum MyPageStep: Step {
case myPageIsRequired
case tabsIsRequired
case writableReviewIsRequired(_ id: Int)
case noticeIsRequired
case confirmIsRequired
}
7 changes: 7 additions & 0 deletions Projects/Core/Sources/Steps/WritableReviewStep.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import RxFlow

public enum WritableReviewStep: Step {
case writableReviewIsRequired
case addReviewIsRequired
case popToMyPage
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ struct WritableReviewListResponseDTO: Decodable {
}

struct WritableReviewCompanyResponseDTO: Decodable {
let reviewID: Int
let companyID: Int
let name: String

enum CodingKeys: String, CodingKey {
case reviewID = "id"
case companyID = "id"
case name
}
}

extension WritableReviewListResponseDTO {
func toDomain() -> [WritableReviewCompanyEntity] {
companies.map {
WritableReviewCompanyEntity(reviewID: $0.reviewID, name: $0.name)
WritableReviewCompanyEntity(companyID: $0.companyID, name: $0.name)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Foundation

public struct WritableReviewCompanyEntity: Equatable, Hashable {
public let reviewID: Int
public let companyID: Int
public let name: String

public init(reviewID: Int, name: String) {
self.reviewID = reviewID
public init(companyID: Int, name: String) {
self.companyID = companyID
self.name = name
}
}
21 changes: 21 additions & 0 deletions Projects/Flow/Sources/Company/CompanyDetailFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public final class CompanyDetailFlow: Flow {

case let.recruitmentDetailIsRequired(id):
return navigateToRecruimtentDetail(recruitmentID: id)

case let .interviewReviewDetailIsRequired(id, name):
return navigateToInterviewReviewDetail(id, name)
}
}
}
Expand Down Expand Up @@ -62,4 +65,22 @@ private extension CompanyDetailFlow {
withNextStepper: OneStepper(withSingleStep: RecruitmentDetailStep.recruitmentDetailIsRequired)
))
}

func navigateToInterviewReviewDetail(_ id: Int, _ name: String) -> FlowContributors {
let interviewReviewDetailFlow = InterviewReviewDetailFlow(container: container)

Flows.use(interviewReviewDetailFlow, when: .created) { (root) in
let view = root as? InterviewReviewDetailViewController
view?.viewModel.reviewId = id
view?.viewModel.writerName = name
self.rootViewController.navigationController?.pushViewController(
view!, animated: true
)
}

return .one(flowContributor: .contribute(
withNextPresentable: interviewReviewDetailFlow,
withNextStepper: OneStepper(withSingleStep: InterviewReviewDetailStep.interviewReviewDetailIsRequired)
))
}
}
36 changes: 36 additions & 0 deletions Projects/Flow/Sources/Company/InterviewReviewFlow.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import UIKit
import Presentation
import Swinject
import RxFlow
import Core

public final class InterviewReviewDetailFlow: Flow {
public let container: Container
private let rootViewController: InterviewReviewDetailViewController
public var root: Presentable {
return rootViewController
}

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

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

switch step {
case .interviewReviewDetailIsRequired:
return navigateToInterviewReviewDetail()
}
}
}

private extension InterviewReviewDetailFlow {
func navigateToInterviewReviewDetail() -> FlowContributors {
return .one(flowContributor: .contribute(
withNextPresentable: rootViewController,
withNextStepper: rootViewController.viewModel
))
}
}
20 changes: 20 additions & 0 deletions Projects/Flow/Sources/MyPage/MyPageFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public final class MyPageFlow: Flow {
case .tabsIsRequired:
return .end(forwardToParentFlowWithStep: TabsStep.appIsRequired)

case let .writableReviewIsRequired(id):
return navigateToWritableReview(id)

case .noticeIsRequired:
return navigateToNotice()

Expand All @@ -49,6 +52,23 @@ private extension MyPageFlow {
))
}

func navigateToWritableReview(_ id: Int) -> FlowContributors {
let writableReviewFlow = WritableReviewFlow(container: container)

Flows.use(writableReviewFlow, when: .created) { (root) in
let view = root as? WritableReviewViewController
view?.viewModel.companyID = id
self.rootViewController.pushViewController(
view!, animated: true
)
}

return .one(flowContributor: .contribute(
withNextPresentable: writableReviewFlow,
withNextStepper: OneStepper(withSingleStep: WritableReviewStep.writableReviewIsRequired)
))
}

func navigateToNotice() -> FlowContributors {
let noticeFlow = NoticeFlow(container: container)

Expand Down
48 changes: 48 additions & 0 deletions Projects/Flow/Sources/MyPage/Review/AddReviewFlow.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import UIKit
import Presentation
import Swinject
import RxFlow
import Core

public final class AddReviewFlow: Flow {
public let container: Container
private let rootViewController: AddReviewViewController
public var root: Presentable {
return rootViewController
}

public init(container: Container) {
self.container = container
self.rootViewController = AddReviewViewController(
container.resolve(AddReviewViewModel.self)!,
state: .custom(height: 500)
)
}

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

switch step {
case .addReviewIsRequired:
return navigateToAddReview()

case .dismissToWritableReview:
return dismissToWritableReview()
}
}
}

private extension AddReviewFlow {
func navigateToAddReview() -> FlowContributors {
return .one(flowContributor: .contribute(
withNextPresentable: rootViewController,
withNextStepper: rootViewController.viewModel
))
}

func dismissToWritableReview(
) -> FlowContributors {
self.rootViewController.dismissBottomSheet()
return .none
}
}
76 changes: 76 additions & 0 deletions Projects/Flow/Sources/MyPage/Review/WritableReviewFlow.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import UIKit
import Presentation
import Swinject
import RxFlow
import Core
import Domain

public final class WritableReviewFlow: Flow {
public let container: Container
private let rootViewController: WritableReviewViewController
public var root: Presentable {
return rootViewController
}

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

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

switch step {
case .writableReviewIsRequired:
return navigateToWritableReview()

case .addReviewIsRequired:
return navigateToAddReview()

case .popToMyPage:
return popToMyPage()
}
}
}

private extension WritableReviewFlow {
func navigateToWritableReview() -> FlowContributors {
return .one(flowContributor: .contribute(
withNextPresentable: rootViewController,
withNextStepper: rootViewController.viewModel
))
}

func navigateToAddReview() -> FlowContributors {
let addReviewFlow = AddReviewFlow(container: container)
Flows.use(addReviewFlow, when: .created) { root in
let view = root as? AddReviewViewController
view?.dismiss = { question, answer, techCode in
self.rootViewController.viewModel.techCode = techCode.code
self.rootViewController.viewModel.interviewReviewInfo.accept(
QnaEntity(
question: question,
answer: answer,
area: techCode.keyword
)
)
}
self.rootViewController.present(
root,
animated: false
)
}

return .one(flowContributor: .contribute(
withNextPresentable: addReviewFlow,
withNextStepper: OneStepper(
withSingleStep: AddReviewStep.addReviewIsRequired
)
))
}

func popToMyPage() -> FlowContributors {
self.rootViewController.navigationController?.popViewController(animated: true)
return .none
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@ public extension UITextField {
self.rightView = UIView(frame: CGRect(x: 0, y: 0, width: size, height: 0))
self.rightViewMode = .always
}

func setPlaceholderColor(_ placeholderColor: UIColor) {
attributedPlaceholder = NSAttributedString(
string: placeholder ?? "",
attributes: [
.foregroundColor: placeholderColor,
.font: font
].compactMapValues { $0 }
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import DesignSystem

public class CompanyDetailViewController: BaseViewController<CompanyDetailViewModel> {
private let companyDetailProfileView = CompanyDetailProfileView()
public var isTabNavigation: Bool = true
private let scrollView = UIScrollView().then {
$0.showsVerticalScrollIndicator = false
}
Expand Down Expand Up @@ -118,7 +119,14 @@ public class CompanyDetailViewController: BaseViewController<CompanyDetailViewMo
public override func bind() {
let input = CompanyDetailViewModel.Input(
viewAppear: self.viewWillAppearPublisher,
recruitmentButtonDidTap: recruitmentButton.rx.tap.asSignal()
recruitmentButtonDidTap: recruitmentButton.rx.tap.asSignal(),
interviewReviewTableViewDidTap: interviewReviewTableView.rx
.modelSelected(ReviewEntity.self)
.asObservable()
.map { ($0.reviewID, $0.writer) }
.do(onNext: { _ in
self.isTabNavigation = false
})
)

let output = viewModel.transform(input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public final class CompanyDetailViewModel: BaseViewModel, Stepper {
public struct Input {
let viewAppear: PublishRelay<Void>
let recruitmentButtonDidTap: Signal<Void>
let interviewReviewTableViewDidTap: Observable<(Int, String)>
}

public struct Output {
Expand Down Expand Up @@ -64,6 +65,12 @@ public final class CompanyDetailViewModel: BaseViewModel, Stepper {
.bind(to: steps)
.disposed(by: disposeBag)

input.interviewReviewTableViewDidTap.asObservable()
.map { id, name in
CompanyDetailStep.interviewReviewDetailIsRequired(id: id, name: name)
}
.bind(to: steps)
.disposed(by: disposeBag)
return Output(
companyDetailInfo: companyDetailInfo,
reviewListInfo: reviewListInfo
Expand Down
Loading
Loading