Skip to content
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,7 @@ import Foundation
import ProjectDescription

public extension String {
static func appVersion(version: String = "1.1.3") -> String {
static func appVersion(version: String = "1.1.4") -> String {
return version
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,8 @@ public struct Attendance: Equatable, Identifiable {
public extension Attendance {
var selectTeamEntity: SelectTeams? {
guard let teamPart = userInfo.split(separator: "/").first else { return nil }
let normalized = teamPart.replacingOccurrences(of: " ", with: "").uppercased()
switch normalized {
case "WEB1팀": return .web1
case "WEB2팀": return .web2
case "IOS1팀": return .ios1
case "IOS2팀": return .ios2
case "ANDROID1팀", "AND1팀": return .and1
case "ANDROID2팀", "AND2팀": return .and2
default: return nil
}
let team = SelectTeams.from(name: String(teamPart))
return team == .unknown ? nil : team
}

var selectPartEntity: SelectParts? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extension Array where Element == AttendanceTeamDTO {
map {
SelectTeamEntity(
teamId: $0.teamId,
teams: SelectTeams(rawValue: $0.name) ?? .unknown
teams: SelectTeams.from(name: $0.name)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public extension UserDTO {
return .web1
case .web2:
return .web2
case .web3:
return .web3
case .native1:
return .native1
case .native2:
return .native2
case .notTeam, .unknown:
return .unknown
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ struct LegacyModelBranchCoverageTests {
@Test("모든 팀 표기와 목록을 제공하고 알 수 없는 디코딩을 흡수한다")
func selectTeamRepresentations() throws {
let teams = SelectTeam.allCases
#expect(teams.map(\.description).count == 8)
#expect(teams.map(\.managingTeamDesc).count == 8)
#expect(teams.map(\.selectTeamDescription).count == 8)
#expect(teams.map(\.attendanceListDescription).count == 8)
#expect(teams.map(\.attandanceCardDescription).count == 8)
#expect(teams.map(\.isDescEqualToAttendanceListDescription).count == 8)
#expect(SelectTeam.teamList.count == 6)
#expect(SelectTeam.attandanceList.count == 6)
#expect(teams.count == 11)
#expect(teams.map(\.description).count == teams.count)
#expect(teams.map(\.managingTeamDesc).count == teams.count)
#expect(teams.map(\.selectTeamDescription).count == teams.count)
#expect(teams.map(\.attendanceListDescription).count == teams.count)
#expect(teams.map(\.attandanceCardDescription).count == teams.count)
#expect(teams.map(\.isDescEqualToAttendanceListDescription).count == teams.count)
#expect(SelectTeam.teamList.count == 9)
#expect(SelectTeam.attandanceList.count == 9)
#expect(try decodeTeam("") == .unknown)
#expect(try decodeTeam("new-team") == .unknown)
#expect(try decodeTeam("iOS_1") == .ios1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct EntityMappingBehaviorTests {
func selectTeamsMapping() {
let teams: [SelectTeams] = [.and1, .and2, .ios1, .ios2, .web1, .web2, .web3, .native1, .native2, .unknown]
let managing = ["Android 1", "Android 2", "iOS 1", "iOS 2", "WEB 1", "WEB 2", "WEB 3", "Native 1", "Native 2", ""]
let cards = ["Android1팀", "Android2팀", "iOS1팀", "iOS2팀", "WEB1팀", "WEB2팀", "WEB3팀", "Native1팀", "Native2팀", ""]
let cards = ["Android1팀", "Android2팀", "iOS1팀", "iOS2팀", "WEB1팀", "WEB2팀", "WEB3팀", "NATIVE 1팀", "NATIVE 2팀", ""]

for index in teams.indices {
#expect(teams[index].managingTeamDesc == managing[index])
Expand All @@ -57,9 +57,15 @@ struct EntityMappingBehaviorTests {
}
#expect(SelectTeams.from(name: "IOS 1팀") == .ios1)
#expect(SelectTeams.from(name: "WEB 3팀") == .web3)
#expect(SelectTeams.from(name: "WEB_3") == .web3)
#expect(SelectTeams.from(name: "NATIVE 1팀") == .native1)
#expect(SelectTeams.from(name: "NATIVE_1") == .native1)
#expect(SelectTeams.from(name: "NATIVE 2팀") == .native2)
#expect(SelectTeams.from(name: "NATIVE_2") == .native2)
#expect(SelectTeams.from(name: "IOS_1") == .ios1)
#expect(SelectTeams.from(name: "AND_1") == .and1)
#expect(SelectTeams.from(name: "없는 팀") == .unknown)
#expect(SelectTeam.web3.description == "Web_3")
}

@Test("SelectTeamEntity는 팀 선택과 정렬을 제공한다")
Expand All @@ -74,7 +80,7 @@ struct EntityMappingBehaviorTests {
#expect(teams[1].toSelectTeam == .web2)
#expect(teams.orderedSelectTeams() == [.and1, .web2])

for team in [SelectTeams.and1, .and2, .ios1, .ios2, .web1, .web2] {
for team in [SelectTeams.and1, .and2, .ios1, .ios2, .web1, .web2, .web3, .native1, .native2] {
#expect(SelectTeamEntity(teamId: 1, teams: team).toSelectTeam == team)
}
}
Expand Down Expand Up @@ -113,6 +119,9 @@ struct EntityMappingBehaviorTests {
let cases: [(String, SelectTeams?, SelectParts?)] = [
("WEB 1팀 / FE", .web1, .frontend),
("WEB 2팀 / BE", .web2, .backend),
("WEB 3팀 / BE", .web3, .backend),
("NATIVE 1팀 / IOS", .native1, .ios),
("NATIVE 2팀 / AND", .native2, .android),
("IOS 1팀 / IOS", .ios1, .ios),
("IOS 2팀 / PM", .ios2, .pm),
("ANDROID 1팀 / ANDROID", .and1, .android),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ import Foundation
public enum SelectTeam: String, CaseIterable, Codable, Equatable, CustomStringConvertible {
case web1 = "Web_1"
case web2 = "Web_2"
case web3 = "Web_3"
case and1 = "Android_1"
case and2 = "Android_2"
case ios1 = "iOS_1"
case ios2 = "iOS_2"
case native1 = "NATIVE_1"
case native2 = "NATIVE_2"
case notTeam = "NotTeam"

case unknown
Expand Down Expand Up @@ -43,6 +46,12 @@ public enum SelectTeam: String, CaseIterable, Codable, Equatable, CustomStringCo
return "Web_1"
case .web2:
return "Web_2"
case .web3:
return "Web_3"
case .native1:
return "NATIVE_1"
case .native2:
return "NATIVE_2"
case .notTeam:
return ""
case .unknown:
Expand All @@ -64,6 +73,12 @@ public enum SelectTeam: String, CaseIterable, Codable, Equatable, CustomStringCo
return "Web 1"
case .web2:
return "Web 2"
case .web3:
return "Web 3"
case .native1:
return "NATIVE 1"
case .native2:
return "NATIVE 2"
case .notTeam:
return ""
case .unknown:
Expand All @@ -84,7 +99,13 @@ public enum SelectTeam: String, CaseIterable, Codable, Equatable, CustomStringCo
case .web1:
return "🖥️ Web 1팀"
case .web2:
return "🖥️ Web 1팀"
return "🖥️ Web 2팀"
case .web3:
return "🖥️ Web 3팀"
case .native1:
return "📱 Native 1팀"
case .native2:
return "📱 Native 2팀"
case .notTeam:
return ""
case .unknown:
Expand All @@ -93,12 +114,12 @@ public enum SelectTeam: String, CaseIterable, Codable, Equatable, CustomStringCo
}

public static var teamList: [SelectTeam] {
return [.and1, .and2, .ios1, .ios2, .web1, .web2]
return [.and1, .and2, .ios1, .ios2, .web1, .web2, .web3, .native1, .native2]
}

// MARK: - 출석 현황 리스트
public static var attandanceList: [SelectTeam] {
return [.web1, .web2, .and1, .and2, .ios1, .ios2]
return [.web1, .web2, .web3, .and1, .and2, .ios1, .ios2, .native1, .native2]
}

// MARK: - 출석 현황 팀 이름
Expand All @@ -108,6 +129,8 @@ public enum SelectTeam: String, CaseIterable, Codable, Equatable, CustomStringCo
return "Web 1팀"
case .web2:
return "Web 2팀"
case .web3:
return "Web 3팀"
case .and1:
return "Android 1팀"
case .and2:
Expand All @@ -116,6 +139,10 @@ public enum SelectTeam: String, CaseIterable, Codable, Equatable, CustomStringCo
return "iOS 1팀"
case .ios2:
return "iOS 2팀"
case .native1:
return "NATIVE 1팀"
case .native2:
return "NATIVE 2팀"
default:
return ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public enum SelectTeams: String, CaseIterable, Equatable, CustomStringConvertibl
case .web1: return "WEB1팀"
case .web2: return "WEB2팀"
case .web3: return "WEB3팀"
case .native1: return "Native1팀"
case .native2: return "Native2팀"
case .native1: return "NATIVE 1팀"
case .native2: return "NATIVE 2팀"
case .and1: return "Android1팀"
case .and2: return "Android2팀"
case .ios1: return "iOS1팀"
Expand All @@ -68,6 +68,25 @@ public enum SelectTeams: String, CaseIterable, Equatable, CustomStringConvertibl
}

public static func from(name: String) -> SelectTeams {
SelectTeams(rawValue: name) ?? .unknown
if let team = SelectTeams(rawValue: name) {
return team
}

let normalizedName = name
.uppercased()
.replacingOccurrences(of: " ", with: "")
.replacingOccurrences(of: "팀", with: "")
switch normalizedName {
case "WEB_1", "WEB1": return .web1
case "WEB_2", "WEB2": return .web2
case "WEB_3", "WEB3": return .web3
case "NATIVE_1", "NATIVE1": return .native1
case "NATIVE_2", "NATIVE2": return .native2
case "ANDROID_1", "ANDROID1", "AND_1", "AND1": return .and1
case "ANDROID_2", "ANDROID2", "AND_2", "AND2": return .and2
case "IOS_1", "IOS1": return .ios1
case "IOS_2", "IOS2": return .ios2
default: return .unknown
}
}
}
7 changes: 5 additions & 2 deletions Projects/UI/DDDDesignKit/Sources/Component/Tabs/DDDTabs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,19 @@ public struct DDDTabs<Item: Identifiable>: View where Item.ID: Hashable {
}
}
.padding(.horizontal, 24)
.animation(
.spring(response: 0.4, dampingFraction: 0.8),
value: selectedID
)
}
.scrollDisabled(true)

Spacer()
.frame(height: 12)

DDDDivider(color: .borderInactive.opacity(0.12))
.offset(y: -12)
}
.onChange(of: selectedID) { _, selectedID in
.onChange(of: selectedID, initial: true) { _, selectedID in
guard let selectedID,
items.contains(where: { $0.id == selectedID })
else { return }
Expand Down
Loading