-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor/#341 2차 스프린트 3차 QA 반영 #343
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
Merged
The head ref may contain hidden characters: "refactor/#341-3\uCC28-qa"
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,12 @@ | |
| import Combine | ||
| import UIKit | ||
|
|
||
| enum ArchiveViewControllerEntryPoint { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 좋습니다~ |
||
| case mypage | ||
| case questMain | ||
| case edit | ||
| } | ||
|
|
||
| final class ArchiveQuestViewController: BaseViewController { | ||
|
|
||
| private var rootView = ArchiveQuestView(type: .activation) | ||
|
|
@@ -16,6 +22,7 @@ final class ArchiveQuestViewController: BaseViewController { | |
|
|
||
| private var questID: Int = 1 | ||
| private var questType: QuestType = .activation | ||
| var entryViewController: ArchiveViewControllerEntryPoint? | ||
|
|
||
| init(viewModel: CompleteQuestViewModel | ||
| ) { | ||
|
|
@@ -85,17 +92,23 @@ extension ArchiveQuestViewController: ToastPresentable, ToastErrorHandler { | |
|
|
||
| extension ArchiveQuestViewController: Dismissible { | ||
| func close() { | ||
| let viewController = ByeBooTabBar() | ||
| viewController.selectedIndex = 1 | ||
|
|
||
| if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, | ||
| let window = windowScene.windows.first(where: { $0.isKeyWindow }) { | ||
| guard let entryViewController else { return } | ||
| switch entryViewController { | ||
| case .mypage, .questMain: | ||
| self.navigationController?.popViewController(animated: true) | ||
| case .edit: | ||
| let viewController = ByeBooTabBar() | ||
| viewController.selectedIndex = 1 | ||
|
|
||
| ViewControllerUtils.setRootViewController( | ||
| window: window, | ||
| viewController: viewController, | ||
| withAnimation: true | ||
| ) | ||
| if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, | ||
| let window = windowScene.windows.first(where: { $0.isKeyWindow }) { | ||
|
|
||
| ViewControllerUtils.setRootViewController( | ||
| window: window, | ||
| viewController: viewController, | ||
| withAnimation: true | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,28 +19,33 @@ struct WriteActiveTypeViewModel: ViewModelType { | |
| private let saveActiveQuestUseCase: SaveQuestActiveUseCase | ||
| private let getQuestInfoUseCase: GetQuestInfoUseCase | ||
| private let editActiveQuestUseCase: EditQuestActiveUseCase | ||
| private let isValidQuestAnswerUseCase: IsValidQuestAnswerUseCase | ||
|
|
||
| private let questInfoResultSubject: PassthroughSubject<Result<QuestInfoEntity, ByeBooError>, Never> = .init() | ||
| private let questActiveResultSubject: PassthroughSubject<Result<Void, ByeBooError>, Never> = .init() | ||
| private let didSuccessPostSubject: PassthroughSubject<Result<Void, ByeBooError>, Never> = .init() | ||
| private let didSuccessEditSubject: PassthroughSubject<Result<Void, ByeBooError>, Never> = .init() | ||
| private let isValidTextSubject: PassthroughSubject<Bool, Never> = .init() | ||
|
|
||
| init( | ||
| saveQuestTypeUseCase: SaveQuestTypeUseCase, | ||
| saveActiveTypeUseCase: SaveQuestActiveUseCase, | ||
| getQuestInfoUseCase: GetQuestInfoUseCase, | ||
| editActiveQuestUseCase: EditQuestActiveUseCase | ||
| editActiveQuestUseCase: EditQuestActiveUseCase, | ||
| isValidQuestAnswerUseCase: IsValidQuestAnswerUseCase | ||
| ){ | ||
| self.saveQuestTypeUseCase = saveQuestTypeUseCase | ||
| self.saveActiveQuestUseCase = saveActiveTypeUseCase | ||
| self.getQuestInfoUseCase = getQuestInfoUseCase | ||
| self.editActiveQuestUseCase = editActiveQuestUseCase | ||
| self.isValidQuestAnswerUseCase = isValidQuestAnswerUseCase | ||
|
|
||
| output = Output( | ||
| questInfoResultPublisher: questInfoResultSubject.eraseToAnyPublisher(), | ||
| didSuccessPostPublisher: didSuccessPostSubject.eraseToAnyPublisher(), | ||
| questInfoWhenEditModeResultPublisher: questInfoResultSubject.eraseToAnyPublisher(), | ||
| didSuccessEditPublisher: didSuccessEditSubject.eraseToAnyPublisher() | ||
| didSuccessEditPublisher: didSuccessEditSubject.eraseToAnyPublisher(), | ||
| isValidTextPublisher: isValidTextSubject.eraseToAnyPublisher() | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -70,6 +75,8 @@ struct WriteActiveTypeViewModel: ViewModelType { | |
| imageKey: imageKey | ||
| ) | ||
| } | ||
| case .textFieldEditing(let answerText, let text, let imgCount): | ||
| isValidText(previousText: answerText, changingText: text, imgCount: imgCount) | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -87,13 +94,15 @@ extension WriteActiveTypeViewModel { | |
| isImageChanged: Bool | ||
| ) | ||
| case navigateFromArchiveViewController(questID: Int) | ||
| case textFieldEditing(answerText: String, text: String, imgCount: Int) | ||
| } | ||
|
|
||
| struct Output { | ||
| let questInfoResultPublisher: AnyPublisher<Result<QuestInfoEntity, ByeBooError>, Never> | ||
| let didSuccessPostPublisher: AnyPublisher<Result<Void, ByeBooError>, Never> | ||
| let questInfoWhenEditModeResultPublisher: AnyPublisher<Result<QuestInfoEntity, ByeBooError>, Never> | ||
| let didSuccessEditPublisher: AnyPublisher<Result<Void, ByeBooError>, Never> | ||
| let isValidTextPublisher: AnyPublisher<Bool, Never> | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -170,5 +179,14 @@ extension WriteActiveTypeViewModel { | |
|
|
||
| } | ||
| } | ||
|
|
||
| private func isValidText(previousText: String, changingText: String, imgCount: Int) { | ||
| let isValidText: Bool = isValidQuestAnswerUseCase.executeWhenActiceType( | ||
| previousText: previousText, | ||
| changingText: changingText, | ||
| imgCount: imgCount | ||
| ) | ||
| isValidTextSubject.send(isValidText) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 반영 감사합니당 |
||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
파라미터가 서로 다르니까 두 메서드 다 execute로 해도 나쁘지 않을듯? 개인 취향인 것 같습니당