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

πŸ”€ :: [#311] μ •λ³΄μž…λ ₯ UI κ°„μ†Œν™” #312

Merged
merged 1 commit into from
Nov 25, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public struct InputStudentInformationRequestDTO: Encodable {
public let languageCertificates: [LanguageCertificate]
public let major: String
public let militaryService: MilitaryServiceType
public let portfolioURL: String
public let profileImgURL: String
public let regions: [String]
public let salary: Int
Expand All @@ -26,7 +25,6 @@ public struct InputStudentInformationRequestDTO: Encodable {
languageCertificates: [LanguageCertificate],
major: String,
militaryService: MilitaryServiceType,
portfolioURL: String,
profileImgURL: String,
regions: [String],
salary: Int,
Expand All @@ -42,7 +40,6 @@ public struct InputStudentInformationRequestDTO: Encodable {
self.languageCertificates = languageCertificates
self.major = major
self.militaryService = militaryService
self.portfolioURL = portfolioURL
self.profileImgURL = profileImgURL
self.regions = regions
self.salary = salary
Expand All @@ -60,7 +57,6 @@ public struct InputStudentInformationRequestDTO: Encodable {
case languageCertificates
case major
case militaryService
case portfolioURL = "portfolioUrl"
case profileImgURL = "profileImgUrl"
case regions
case salary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public struct InputInformationPageTitleView: View {

public var body: some View {
VStack(spacing: 16) {
SMSPageControl(pageCount: pageCount, selectedPage: selectedPage)
.padding(.horizontal, 20)

SMSSeparator()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ final class InputInformationIntent: InputInformationIntentProtocol {
languageCertificates: state.languages,
major: inputProfileInfo.major,
militaryService: militaryServiceType,
portfolioURL: inputProfileInfo.portfoiloURL,
profileImgURL: profileImageURL,
regions: inputWorkInfo.workRegion,
salary: inputWorkInfo.salary,
Expand Down Expand Up @@ -107,7 +106,7 @@ final class InputInformationIntent: InputInformationIntentProtocol {
extension InputInformationIntent: InputProfileDelegate {
func completeToInputProfile(input: InputProfileInformationObject) {
model?.updateInputProfileInformationObject(object: input)
model?.nextButtonDidTap()
inputInformationDelegate?.completeToInputInformation()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public struct InputProfileInformationObject {
public let introduce: String
public let contactEmail: String
public let major: String
public let portfoiloURL: String
public let techStacks: [String]

public init(
Expand All @@ -19,15 +18,13 @@ public struct InputProfileInformationObject {
introduce: String,
contactEmail: String,
major: String,
portfoiloURL: String,
techStacks: [String]
) {
self.profileImageData = profileImageData
self.profileImageFilename = profileImageFilename
self.introduce = introduce
self.contactEmail = contactEmail
self.major = major
self.portfoiloURL = portfoiloURL
self.techStacks = techStacks
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ final class InputProfileInfoIntent: InputProfileInfoIntentProtocol {
model?.updateMajor(major: major)
}

func updatePortfolioURL(portfolioURL: String) {
model?.updatePortfolioURL(portfolioURL: portfolioURL)
}

func techStackAppendIsRequired() {
model?.updateIsPresentedTeckStackAppend(isPresented: true)
}
Expand Down Expand Up @@ -81,7 +77,7 @@ final class InputProfileInfoIntent: InputProfileInfoIntentProtocol {
model?.updateProfileImage(imageResult: imageResult)
}

func nextButtonDidTap(state: any InputProfileInfoStateProtocol) {
func completeButtonDidTap(state: any InputProfileInfoStateProtocol) {
var errorSet = Set<InputProfileErrorField>()
if state.profileImage == nil {
errorSet.insert(.profile)
Expand All @@ -101,10 +97,6 @@ final class InputProfileInfoIntent: InputProfileInfoIntentProtocol {
errorSet.insert(.major)
}

let urlValidator = URLValidator()
if !urlValidator.validate(state.portfolioURL) {
errorSet.insert(.portfoilo)
}

model?.updateErrorFieldSet(set: errorSet)
guard
Expand All @@ -119,7 +111,6 @@ final class InputProfileInfoIntent: InputProfileInfoIntentProtocol {
introduce: state.introduce,
contactEmail: state.email,
major: state.major,
portfoiloURL: state.portfolioURL,
techStacks: state.techStacks
)
inputProfileDelegate?.completeToInputProfile(input: input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ protocol InputProfileInfoIntentProtocol {
func updateIntroduce(introduce: String)
func updateEmail(email: String)
func updateMajor(major: String)
func updatePortfolioURL(portfolioURL: String)
func techStackAppendIsRequired()
func techStackAppendDismissed()
func techStackAppendDidComplete(techStacks: [String])
Expand All @@ -17,7 +16,7 @@ protocol InputProfileInfoIntentProtocol {
func imageMethodPickerIsRequired()
func imageMethodPickerDismissed()
func imageDidSelected(imageResult: PickedImageResult?)
func nextButtonDidTap(state: any InputProfileInfoStateProtocol)
func completeButtonDidTap(state: any InputProfileInfoStateProtocol)
func cameraIsRequired()
func cameraDismissed()
func activeSelfEntering()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ final class InputProfileInfoModel: ObservableObject, InputProfileInfoStateProtoc
@Published var email: String = ""
@Published var major: String = ""
@Published var majorList: [String] = []
@Published var portfolioURL: String = ""
@Published var techStacks: [String] = []
@Published var isPresentedMajorSheet: Bool = false
@Published var isPresentedImagePicker: Bool = false
Expand All @@ -19,8 +18,7 @@ final class InputProfileInfoModel: ObservableObject, InputProfileInfoStateProtoc
var isDisabledNextButton: Bool {
introduce.isEmpty ||
email.isEmpty ||
major.isEmpty ||
portfolioURL.isEmpty
major.isEmpty
}
}

Expand All @@ -41,10 +39,6 @@ extension InputProfileInfoModel: InputProfileInfoActionProtocol {
self.majorList = majorList
}

func updatePortfolioURL(portfolioURL: String) {
self.portfolioURL = portfolioURL
}

func updateTeckStacks(techStacks: [String]) {
self.techStacks = techStacks
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ protocol InputProfileInfoStateProtocol {
var email: String { get }
var major: String { get }
var majorList: [String] { get }
var portfolioURL: String { get }
var techStacks: [String] { get }
var isPresentedMajorSheet: Bool { get }
var isPresentedImagePicker: Bool { get }
Expand All @@ -32,7 +31,6 @@ protocol InputProfileInfoActionProtocol: AnyObject {
func updateEmail(email: String)
func updateMajor(major: String)
func updateMajorList(majorList: [String])
func updatePortfolioURL(portfolioURL: String)
func updateTeckStacks(techStacks: [String])
func removeTeckStacks(techStack: String)
func updateIsPresentedTeckStackAppend(isPresented: Bool)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,6 @@ struct InputProfileInfoView: View {
)
.titleWrapper("λΆ„μ•Ό")

SMSTextField(
"E.g. https://github.com",
text: Binding(
get: { state.portfolioURL },
set: intent.updatePortfolioURL(portfolioURL:)
),
errorText: "URL ν˜•μ‹μ— 맞게 μž…λ ₯ν•΄μ£Όμ„Έμš”",
isError: state.inputProfileErrorFieldSet.contains(.portfoilo)
) {
intent.techStackAppendIsRequired()
}
.keyboardType(.URL)
.focused($focusField, equals: .portfoilo)
.titleWrapper("포트폴리였 URL")

VStack(spacing: 8) {
HStack(spacing: 8) {
SMSIcon(.magnifyingglass)
Expand Down Expand Up @@ -180,8 +165,8 @@ struct InputProfileInfoView: View {
.titleWrapper("μ„ΈλΆ€μŠ€νƒ (μ΅œλŒ€ 5개)")
}

CTAButton(text: "λ‹€μŒ") {
intent.nextButtonDidTap(state: state)
CTAButton(text: "μ™„λ£Œ") {
intent.completeButtonDidTap(state: state)
}
.disabled(state.isDisabledNextButton)
.padding(.bottom, 32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ final class InputProfileInfoFeatureTests: XCTestCase {
XCTAssertEqual(sut.model.major, uuid)
}

func test_update_portfoiloURL() {
sut.intent.updatePortfolioURL(portfolioURL: "A")
XCTAssertEqual(sut.model.portfolioURL, "A")

let uuid = UUID().uuidString
sut.intent.updatePortfolioURL(portfolioURL: uuid)
XCTAssertEqual(sut.model.portfolioURL, uuid)
}

func test_bottomSheet_intet() async throws {
sut.intent.majorSheetIsRequired()
XCTAssertEqual(sut.model.isPresentedMajorSheet, true)
Expand Down
Loading