-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/#74 - SecretDetail Feature 기반 구현 및 MainFeature 라우팅 연결 #78
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e8cafd2
[#74] feat: SecretClient revealPayload 추가
doyeonk429 1ba081f
[#74] feat: SecretDetailFeature 기반 구현
doyeonk429 5f87a5d
[#74] feat: MainFeature SecretDetail 라우팅 연결
doyeonk429 ff4796e
[#74] fix: 사이드바 전환 시 secretDetail 미정리 버그 수정
doyeonk429 386250f
[#74] fix: SecretDetail 코드리뷰 반영
doyeonk429 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
99 changes: 99 additions & 0 deletions
99
Projects/DVPresentation/Sources/Features/SecretDetail/Model/SecretDetailError.swift
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 |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| // Copyright © 2026 Devault. All rights reserved | ||
|
|
||
| import Foundation | ||
|
|
||
| import ComposableArchitecture | ||
| import DVDomain | ||
|
|
||
| // MARK: - SecretDetailError | ||
|
|
||
| /// Secret 조회/복호화 실패 시 Presentation 계층 오류. | ||
| enum SecretDetailError: Equatable { | ||
| /// 생체인증·패스코드 인증 요구. | ||
| case authRequired | ||
| /// 복호화 실패 (키 없음·복호화 오류·디코딩 실패). | ||
| case decryptionFailed | ||
| /// 그 외 예기치 않은 오류. | ||
| case unexpected | ||
|
|
||
| static func map(_ error: SecretUseCaseError) -> SecretDetailError { | ||
| switch error { | ||
| case .authenticationFailure: | ||
| return .authRequired | ||
| case .cryptoFailure(let crypto): | ||
| switch crypto { | ||
| case .keyUnavailable, .keychainFailure, | ||
| .decryptionFailed, .decodingFailed: | ||
| return .decryptionFailed | ||
| case .encryptionFailed, .encodingFailed: | ||
| return .unexpected | ||
| } | ||
| case .secretNotFound, .repositoryFailure, | ||
| .invalidName, .invalidSecretType, .unexpected: | ||
| return .unexpected | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // MARK: - AlertState Presets | ||
|
|
||
| extension AlertState where Action == SecretDetailFeature.Action.Alert { | ||
|
|
||
| static func payloadRevealFailed(_ error: SecretDetailError) -> Self { | ||
| switch error { | ||
| case .authRequired: | ||
| return Self { | ||
| TextState("Authentication required", bundle: .module) | ||
| } actions: { | ||
| ButtonState(role: .cancel) { TextState("OK", bundle: .module) } | ||
| } message: { | ||
| TextState( | ||
| "Please authenticate to view the secret.", | ||
| bundle: .module | ||
| ) | ||
| } | ||
|
|
||
| case .decryptionFailed: | ||
| return Self { | ||
| TextState("Failed to reveal secret", bundle: .module) | ||
| } actions: { | ||
| ButtonState(role: .cancel) { TextState("OK", bundle: .module) } | ||
| } message: { | ||
| TextState( | ||
| "The secret could not be decrypted. Check that your device passcode is enabled.", | ||
| bundle: .module | ||
| ) | ||
| } | ||
|
|
||
| case .unexpected: | ||
| return Self { | ||
| TextState("Failed to reveal secret", bundle: .module) | ||
| } actions: { | ||
| ButtonState(role: .cancel) { TextState("OK", bundle: .module) } | ||
| } message: { | ||
| TextState( | ||
| "An unexpected error occurred. Please try again.", | ||
| bundle: .module | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| static var confirmDiscard: Self { | ||
| Self { | ||
| TextState("Discard changes?", bundle: .module) | ||
| } actions: { | ||
| ButtonState(role: .destructive, action: .confirmDiscard) { | ||
| TextState("Discard", bundle: .module) | ||
| } | ||
| ButtonState(role: .cancel) { | ||
| TextState("Keep editing", bundle: .module) | ||
| } | ||
| } message: { | ||
| TextState( | ||
| "Your unsaved changes will be lost.", | ||
| bundle: .module | ||
| ) | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.