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 {
24
24
style: Styles . Text. body. with ( foreground: Styles . Colors. Gray. dark. color)
25
25
) )
26
26
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:
28
31
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:
30
36
builder. add ( text: " \( bookmark. owner) / " )
31
37
. add ( text: bookmark. name, traits: . traitBold)
32
- case . release:
33
- builder. add ( text: bookmark. title)
34
38
}
35
39
36
40
text = StyledTextRenderer (
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ extension NotificationType {
18
18
case . issue: image = #imageLiteral( resourceName: " issue-opened " )
19
19
case . pullRequest: image = #imageLiteral( resourceName: " git-pull-request " )
20
20
case . release: image = #imageLiteral( resourceName: " tag " )
21
+ case . securityVulnerability: image = #imageLiteral( resourceName: " alert " )
21
22
}
22
23
23
24
return image
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ enum NotificationType: String {
15
15
case commit = " Commit "
16
16
case repo = " Repository "
17
17
case release = " Release "
18
+ case securityVulnerability = " RepositoryVulnerabilityAlert "
18
19
19
20
var localizedString : String {
20
21
switch self {
@@ -23,6 +24,7 @@ enum NotificationType: String {
23
24
case . repo: return NSLocalizedString ( " Repository " , comment: " " )
24
25
case . release: return NSLocalizedString ( " Release " , comment: " " )
25
26
case . pullRequest: return Constants . Strings. pullRequest
27
+ case . securityVulnerability: return NSLocalizedString ( " Security Vulnerability " , comment: " " )
26
28
}
27
29
}
28
30
}
You can’t perform that action at this time.
0 commit comments