This repository was archived by the owner on Sep 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,17 @@ final class BookmarkViewModel: ListDiffable {
2424 style: Styles . Text. body. with ( foreground: Styles . Colors. Gray. dark. color)
2525 ) )
2626 switch bookmark. type {
27- case . issue, . pullRequest:
27+ case . securityVulnerability:
28+ assertionFailure ( " Type \( bookmark. type) is not expected to be bookmarkable. " )
29+ fallthrough
30+ case . issue, . pullRequest, . release:
2831 builder. add ( text: bookmark. title)
29- case . commit, . repo:
32+ case . commit:
33+ assertionFailure ( " Type \( bookmark. type) is not expected to be bookmarkable. " )
34+ fallthrough
35+ case . repo:
3036 builder. add ( text: " \( bookmark. owner) / " )
3137 . add ( text: bookmark. name, traits: . traitBold)
32- case . release:
33- builder. add ( text: bookmark. title)
3438 }
3539
3640 text = StyledTextRenderer (
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ extension NotificationType {
1818 case . issue: image = #imageLiteral( resourceName: " issue-opened " )
1919 case . pullRequest: image = #imageLiteral( resourceName: " git-pull-request " )
2020 case . release: image = #imageLiteral( resourceName: " tag " )
21+ case . securityVulnerability: image = #imageLiteral( resourceName: " alert " )
2122 }
2223
2324 return image
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ enum NotificationType: String {
1515 case commit = " Commit "
1616 case repo = " Repository "
1717 case release = " Release "
18+ case securityVulnerability = " RepositoryVulnerabilityAlert "
1819
1920 var localizedString : String {
2021 switch self {
@@ -23,6 +24,7 @@ enum NotificationType: String {
2324 case . repo: return NSLocalizedString ( " Repository " , comment: " " )
2425 case . release: return NSLocalizedString ( " Release " , comment: " " )
2526 case . pullRequest: return Constants . Strings. pullRequest
27+ case . securityVulnerability: return NSLocalizedString ( " Security Vulnerability " , comment: " " )
2628 }
2729 }
2830}
You can’t perform that action at this time.
0 commit comments