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

feat: 1.0.8 버전 업데이트에 따른 기능 추가 및 수정 #175

Merged
merged 33 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
60a1018
[fix] #173 카테고리 타입 별 버튼 수정
stealmh Dec 24, 2024
708300b
[fix] #173 애니메이션 버그 수정
stealmh Dec 24, 2024
35aac43
[feat] #173 편집하기 로직 연결
stealmh Dec 24, 2024
67c1f36
[fix] #173 편집하기 조건 수정
stealmh Dec 24, 2024
00a1372
[feat] navigationBar View Modifier autoclosure 버전 추가
stealmh Dec 24, 2024
8460670
[fix] 미분류 카테고리 편집에서 card action 받지 못하게 수정
stealmh Dec 24, 2024
d090866
[feat] #173 편집하기 버튼 액션 추가
stealmh Dec 24, 2024
1c7cb18
[feat] #173 편집하기 체크기능 및 화면리스트 구성
stealmh Dec 24, 2024
53706b3
[feat] #173 편집하기 뷰 구성
stealmh Dec 24, 2024
ec08b3b
[feat] 버전업
stealmh Dec 24, 2024
dd7c0ce
[feat] #173 뒤로가기 액션 추가
stealmh Dec 27, 2024
4b97cde
[feat] #173 편집하기 float button 구성
stealmh Dec 27, 2024
c9b67c0
[fix] print 제거
stealmh Dec 27, 2024
426a251
[fix] 레이아웃 수정
stealmh Dec 27, 2024
0671f7d
[feat] #173 Float Button Delegate 연결
stealmh Dec 27, 2024
5e682a7
[feat] #173 카테고리 추가 시트 구성
stealmh Dec 27, 2024
f168d3a
[feat] #173 포킷이동을 위한 시트 연결
stealmh Dec 27, 2024
19ec4cd
[feat] #173 미분류 링크 이동 로직 추가
stealmh Dec 29, 2024
91b37b4
[feat] #173 미분류 링크 삭제 API 추가
stealmh Dec 30, 2024
f3a36ad
[feat] #173 미분류 로직 수정
stealmh Dec 30, 2024
9331748
[feat] #173 편집하기 로직 구성
stealmh Dec 30, 2024
59911dd
[refactor] #173 PokitSelect에 PokitSelectSheet 적용
ShapeKim98 Dec 30, 2024
82935a1
[fix] Perception Error 수정
stealmh Dec 30, 2024
088fa68
[fix] #173 Perception Error 수정 @ShapeKim98
stealmh Dec 30, 2024
fc0cdcb
[feat] #173 버전 체크 로직 추가
stealmh Dec 30, 2024
6b81488
[style] 컨벤션 수정
stealmh Dec 30, 2024
a014b08
[feat] 앱 아이콘 수정
stealmh Dec 30, 2024
5fa1b2c
[feat] #173 편집할 링크가 없을 시 종료 로직 추가
stealmh Dec 30, 2024
735db31
[fix] 링크 비어있을 때 로직 종료 수정
stealmh Dec 30, 2024
e17b3ac
[refactor] #173 링크 편집 개선
stealmh Dec 30, 2024
0f60b85
[feat] #173 버전 체크 검증 테스트 케이스 추가
stealmh Dec 31, 2024
e884ac6
[fix] 불필요 코드 삭제
stealmh Jan 1, 2025
89594ce
[feat] Dependency openURL 리팩토링
stealmh Jan 1, 2025
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Projects/App/Resources/Assets.xcassets/AppIcon.appiconset/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Projects/App/Resources/Assets.xcassets/AppIcon.appiconset/29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Projects/App/Resources/Assets.xcassets/AppIcon.appiconset/40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Projects/App/Resources/Assets.xcassets/AppIcon.appiconset/50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Projects/App/Resources/Pokit-info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.7</string>
<string>1.0.8</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// ContentDeleteRequest.swift
// CoreKit
//
// Created by asobi on 12/30/24.
//

import Foundation
/// 미분류 링크 삭제
public struct ContentDeleteRequest: Encodable {
let contentId: [Int]

public init(contentId: [Int]) {
self.contentId = contentId
}
}

extension ContentDeleteRequest {
public static let mock: Self = Self(contentId: [551321312,4333333])
}
21 changes: 21 additions & 0 deletions Projects/CoreKit/Sources/Data/DTO/Content/ContentMoveRequest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// ContentMoveRequest.swift
// CoreKit
//
// Created by 김민호 on 12/29/24.
//
import Foundation
/// 미분류 링크를 카테고리로 이동
public struct ContentMoveRequest: Encodable {
let contentIds: [Int]
let categoryId: Int

public init(contentIds: [Int], categoryId: Int) {
self.contentIds = contentIds
self.categoryId = categoryId
}
}

extension ContentMoveRequest {
public static let mock: Self = Self(contentIds: [123,456], categoryId: 444)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
import Foundation

public struct VersionResponse: Decodable {
public let recentVersion: String
public let results: [VersionDTO]
}

public struct VersionDTO: Decodable {
public let version: String
public let trackId: Int
}

extension VersionResponse {
static let mock: Self = Self(recentVersion: "1.0.0")
static let mock: Self = Self(results: [VersionDTO(version: "1.0.0", trackId: 2415354644)])
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ extension ContentClient: DependencyKey {
try await provider.requestNoBody(
.썸네일_수정(contentId: id, model: model)
)
},
미분류_링크_포킷_이동: { model in
try await provider.requestNoBody(.미분류_링크_포킷_이동(model: model))
},
미분류_링크_삭제: { model in
try await provider.requestNoBody(.미분류_링크_삭제(model: model))
}
)
}()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ extension ContentClient: TestDependencyKey {
카테고리_내_컨텐츠_목록_조회: { _, _, _ in .mock },
미분류_카테고리_컨텐츠_조회: { _ in .mock },
컨텐츠_검색: { _, _ in .mock },
썸네일_수정: { _, _ in }
썸네일_수정: { _, _ in },
미분류_링크_포킷_이동: { _ in },
미분류_링크_삭제: { _ in }
)
}()
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,11 @@ public struct ContentClient {
_ contentId: String,
_ model: ThumbnailRequest
) async throws -> Void
public var 미분류_링크_포킷_이동: @Sendable (
_ model: ContentMoveRequest
) async throws -> Void
public var 미분류_링크_삭제: @Sendable (
_ model: ContentDeleteRequest
) async throws -> Void
}

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public enum ContentEndpoint {
condition: BaseConditionRequest
)
case 썸네일_수정(contentId: String, model: ThumbnailRequest)
case 미분류_링크_포킷_이동(model: ContentMoveRequest)
case 미분류_링크_삭제(model: ContentDeleteRequest)
}

extension ContentEndpoint: TargetType {
Expand Down Expand Up @@ -57,13 +59,18 @@ extension ContentEndpoint: TargetType {
return ""
case let .썸네일_수정(contentId, _):
return "/thumbnail/\(contentId)"
case .미분류_링크_포킷_이동:
return ""
case .미분류_링크_삭제:
return "/uncategorized"
}
}

public var method: Moya.Method {
switch self {
case .컨텐츠_삭제,
.즐겨찾기_취소:
.즐겨찾기_취소,
.미분류_링크_삭제:
return .put

case .컨텐츠_상세_조회,
Expand All @@ -72,7 +79,8 @@ extension ContentEndpoint: TargetType {
return .post

case .컨텐츠_수정,
.썸네일_수정:
.썸네일_수정,
.미분류_링크_포킷_이동:
return .patch

case .카태고리_내_컨텐츠_목록_조회,
Expand Down Expand Up @@ -135,6 +143,12 @@ extension ContentEndpoint: TargetType {
)
case let .썸네일_수정(_, model):
return .requestJSONEncodable(model)

case let .미분류_링크_포킷_이동(model):
return .requestJSONEncodable(model)

case let .미분류_링크_삭제(model):
return .requestJSONEncodable(model)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public enum VersionEndpoint {

extension VersionEndpoint: TargetType {
public var baseURL: URL {
return Constants.serverURL.appendingPathComponent(Constants.versionPath, conformingTo: .url)
let bundleID = Bundle.main.bundleIdentifier ?? ""
let countryCode = Locale.current.language.region?.identifier ?? ""
return URL(string: "https://itunes.apple.com/lookup?bundleId=\(bundleID)&country=\(countryCode)")!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 서버에 버전 체크 api 있지 않나여?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

써봤는데 최신 버전이랍시고 1.0.1 리턴되던데 버려진 api느낌같아서 만들었습니다

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

써봤는데 최신 버전이랍시고 1.0.1 리턴되던데 버려진 api느낌같아서 만들었습니다

어라..ㅋㅋㅋㅋㅋㅋㅋㅋ

}

public var path: String {
Expand Down
14 changes: 10 additions & 4 deletions Projects/DSKit/Sources/Components/PokitLinkCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
private let link: Item
private let state: PokitLinkCard.State
private let type: PokitLinkCard.CardType
private let action: () -> Void
private let action: (() -> Void)?
private let kebabAction: (() -> Void)?
private let fetchMetaData: (() -> Void)?
private let favoriteAction: (() -> Void)?
Expand All @@ -24,7 +24,7 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
link: Item,
state: PokitLinkCard.State,
type: PokitLinkCard.CardType = .accept,
action: @escaping () -> Void,
action: (() -> Void)? = nil,
kebabAction: (() -> Void)? = nil,
fetchMetaData: (() -> Void)? = nil,
favoriteAction: (() -> Void)? = nil,
Expand All @@ -42,8 +42,14 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {

public var body: some View {
VStack(spacing: 20) {
Button(action: action) {
buttonLabel
Group {
if let action {
Button(action: { action() }) {
buttonLabel
}
} else {
buttonLabel
}
}
.padding(.top, state == .top ? 0 : 20)

Expand Down
74 changes: 12 additions & 62 deletions Projects/DSKit/Sources/Components/PokitSelect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ public struct PokitSelect<Item: PokitSelectItem>: View {
}
.onChange(of: selectedItem) { onChangedSeletedItem($0) }
.sheet(isPresented: $showSheet) {
listSheet
.presentationDragIndicator(.visible)
.pokitPresentationCornerRadius()
.presentationDetents([.height(564)])
.pokitPresentationBackground()
PokitSelectSheet(
list: list,
itemSelected: { item in
listDismiss()
action(item)
},
pokitAddAction: addAction
)
.presentationDragIndicator(.visible)
.pokitPresentationCornerRadius()
.presentationDetents([.height(564)])
.pokitPresentationBackground()
}
}

Expand Down Expand Up @@ -96,63 +103,6 @@ public struct PokitSelect<Item: PokitSelectItem>: View {
.animation(.pokitDissolve, value: self.state)
}

private var listSheet: some View {
Group {
if let list {
VStack(spacing: 0) {
if let addAction {
addButton {
listDismiss()
addAction()
}
}

PokitList(
selectedItem: selectedItem,
list: list
) { item in
action(item)
listCellTapped(item)
}
}
.padding(.top, 12)
.padding(.bottom, 20)
} else {
PokitLoading()
}
}
}

@ViewBuilder
private func addButton(
action: @escaping () -> Void
) -> some View {
Button(action: action) {
HStack(spacing: 20) {
PokitIconButton(
.icon(.plusR),
state: .default(.secondary),
size: .medium,
shape: .round,
action: action
)

Text("포킷 추가하기")
.pokitFont(.b1(.b))
.foregroundStyle(.pokit(.text(.primary)))

Spacer()
}
.padding(.vertical, 22)
.padding(.horizontal, 30)
.background(alignment: .bottom) {
Rectangle()
.fill(.pokit(.border(.tertiary)))
.frame(height: 1)
}
}
}

private func partSelectButtonTapped() {
showSheet = true
}
Expand Down
87 changes: 87 additions & 0 deletions Projects/DSKit/Sources/Components/PokitSelectSheet.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
//
// PokitSelectSheet.swift
// DSKit
//
// Created by 김민호 on 12/27/24.
//

import SwiftUI
import Util


public struct PokitSelectSheet<Item: PokitSelectItem>: View {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

시트가 PokitSelect에 너무 종속된건 아닌가 생각했었는데.. 확실히 빼는게 좋은거 같아요!

@Binding
private var selectedItem: Item?

private let list: [Item]?
private let itemSelected: (Item) -> Void
private let pokitAddAction: (() -> Void)?

public init(
list: [Item]?,
selectedItem: Binding<Item?> = .constant(nil),
itemSelected: @escaping (Item) -> Void,
pokitAddAction: (() -> Void)?
) {
self.list = list
self._selectedItem = selectedItem
self.itemSelected = itemSelected
self.pokitAddAction = pokitAddAction
}


public var body: some View {
Group {
if let list {
VStack(spacing: 0) {
if let pokitAddAction {
addButton {
pokitAddAction()
}
}
PokitList(
selectedItem: selectedItem,
list: list
) { item in
itemSelected(item)
}
}
.padding(.top, 12)
.padding(.bottom, 20)
} else {
PokitLoading()
}
}
}
}
extension PokitSelectSheet {
@ViewBuilder
private func addButton(
action: @escaping () -> Void
) -> some View {
Button(action: action) {
HStack(spacing: 20) {
PokitIconButton(
.icon(.plusR),
state: .default(.secondary),
size: .medium,
shape: .round,
action: action
)

Text("포킷 추가하기")
.pokitFont(.b1(.b))
.foregroundStyle(.pokit(.text(.primary)))

Spacer()
}
.padding(.vertical, 22)
.padding(.horizontal, 30)
.background(alignment: .bottom) {
Rectangle()
.fill(.pokit(.border(.tertiary)))
.frame(height: 1)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ public extension View {
func pokitNavigationBar<Header: View>(@ViewBuilder header: () -> Header) -> some View {
modifier(PokitNavigationBarModifier(header: header))
}

func pokitNavigationBar<Header: View>(_ header: @autoclosure () -> Header) -> some View {
modifier(PokitNavigationBarModifier(header: header))
}
}
Loading
Loading