diff --git a/Classes/Bookmark/BookmarkCloudMigrator.swift b/Classes/Bookmark/BookmarkCloudMigrator.swift index e9bcfeb28..cc12a49ea 100644 --- a/Classes/Bookmark/BookmarkCloudMigrator.swift +++ b/Classes/Bookmark/BookmarkCloudMigrator.swift @@ -45,7 +45,7 @@ final class BookmarkCloudMigrator { init(username: String, oldBookmarks: [Bookmark], client: BookmarkCloudMigratorClient) { self.bookmarks = oldBookmarks.compactMap { switch $0.type { - case .commit, .release, .securityVulnerability: return nil + case .commit, .release, .securityVulnerability, .ci_activity: return nil case .issue, .pullRequest: return .issueOrPullRequest(owner: $0.owner, name: $0.name, number: $0.number) case .repo: diff --git a/Classes/Notifications/NewFeaturesController.swift b/Classes/Notifications/NewFeaturesController.swift index b328cdf51..edc898b59 100644 --- a/Classes/Notifications/NewFeaturesController.swift +++ b/Classes/Notifications/NewFeaturesController.swift @@ -59,13 +59,12 @@ final class NewFeaturesController { } } } - + // fetches for the latest changes func fetch(success: @escaping () -> Void) { guard let url = fetchURL, (testing == true || hasFetchedLatest == false) else { return } hasFetchedLatest = true - let task = session.dataTask(with: url) { (data, response, _) in if let response = response as? HTTPURLResponse, response.statusCode == 200, diff --git a/Classes/Notifications/Notification+NotificationViewModel.swift b/Classes/Notifications/Notification+NotificationViewModel.swift index fd02e3b40..8482bf92c 100644 --- a/Classes/Notifications/Notification+NotificationViewModel.swift +++ b/Classes/Notifications/Notification+NotificationViewModel.swift @@ -19,17 +19,21 @@ func CreateNotificationViewModels( var models = [NotificationViewModel]() for notification in v3notifications { - guard let type = NotificationType(rawValue: notification.subject.type.rawValue), - let identifier = notification.subject.identifier + guard let type = NotificationType(rawValue: notification.subject.type.rawValue) else { continue } - let number: NotificationViewModel.Number - switch identifier { - case .hash(let h): number = .hash(h) - case .number(let n): number = .number(n) - case .release(let r): number = .release(r) + + if notification.subject.identifier != nil { + guard let identifier = notification.subject.identifier + else {continue} + switch identifier { + case .hash(let h): number = .hash(h) + case .number(let n): number = .number(n) + case .release(let r): number = .release(r) + } + } else { + number = .number(1) } - models.append(NotificationViewModel( v3id: notification.id, repo: notification.repository.name, @@ -47,8 +51,9 @@ func CreateNotificationViewModels( branch: "master", issuesEnabled: true )) + } - + DispatchQueue.main.async { completion(models) } diff --git a/Classes/Notifications/NotificationCell.swift b/Classes/Notifications/NotificationCell.swift index 50447c90c..a3a42a326 100644 --- a/Classes/Notifications/NotificationCell.swift +++ b/Classes/Notifications/NotificationCell.swift @@ -171,7 +171,7 @@ final class NotificationCell: SelectableCell, CAAnimationDelegate { titleAttributes[.font] = Styles.Text.secondary.preferredFont switch model.number { case .number(let number): - guard model.type != .securityVulnerability else { break } + guard model.type != .securityVulnerability || model.type != .ci_activity else { break } title.append(NSAttributedString(string: "#\(number)", attributes: titleAttributes)) default: break } @@ -184,10 +184,11 @@ final class NotificationCell: SelectableCell, CAAnimationDelegate { case .open: tintColor = Styles.Colors.Green.medium.color case .pending: tintColor = Styles.Colors.Blue.medium.color } - iconImageView.tintColor = tintColor + + iconImageView.tintColor = tintColor + iconImageView.image = model.type.icon(merged: model.state == .merged)? .withRenderingMode(.alwaysTemplate) - let hasComments = model.comments > 0 commentButton.alpha = hasComments ? 1 : 0.3 commentButton.setTitle(hasComments ? model.comments.abbreviated : "", for: .normal) diff --git a/Classes/Notifications/NotificationModelController.swift b/Classes/Notifications/NotificationModelController.swift index 9a962eb9a..1b1481265 100644 --- a/Classes/Notifications/NotificationModelController.swift +++ b/Classes/Notifications/NotificationModelController.swift @@ -94,6 +94,7 @@ final class NotificationModelController { } } else { githubClient.client.send(V3NotificationRequest(all: all, page: page)) { [weak self] result in + switch result { case .success(let response): self?.handle( @@ -244,6 +245,7 @@ final class NotificationModelController { case .created: mapped = .created } + // Seems important githubClient.client.send(V3IssuesRequest(filter: mapped, page: page), completion: { result in // iterate result data, convert to InboxDashboardModel switch result { diff --git a/Classes/Notifications/NotificationSectionController.swift b/Classes/Notifications/NotificationSectionController.swift index f49914139..e1c10f431 100644 --- a/Classes/Notifications/NotificationSectionController.swift +++ b/Classes/Notifications/NotificationSectionController.swift @@ -75,13 +75,18 @@ final class NotificationSectionController: ListSwiftSectionController - - com.apple.security.application-groups - - group.com.whoisryannystrom.freetime - - + diff --git a/Local Pods/GitHubAPI/GitHubAPI/V3DataResponse.swift b/Local Pods/GitHubAPI/GitHubAPI/V3DataResponse.swift index 672f86c4b..05027ae9f 100644 --- a/Local Pods/GitHubAPI/GitHubAPI/V3DataResponse.swift +++ b/Local Pods/GitHubAPI/GitHubAPI/V3DataResponse.swift @@ -21,7 +21,6 @@ public struct V3DataResponse: EntityResponse { // https://developer.github.com/v3/#schema decoder.dateDecodingStrategy = .iso8601 - self.data = try decoder.decode(T.self, from: input) self.next = (response?.allHeaderFields["Link"] as? String)?.httpNextPageNumber } diff --git a/Local Pods/GitHubAPI/GitHubAPI/V3Notification.swift b/Local Pods/GitHubAPI/GitHubAPI/V3Notification.swift index 4e2f5a96b..fd567830e 100644 --- a/Local Pods/GitHubAPI/GitHubAPI/V3Notification.swift +++ b/Local Pods/GitHubAPI/GitHubAPI/V3Notification.swift @@ -22,6 +22,7 @@ public struct V3Notification: Codable { case teamMention = "team_mention" case reviewRequested = "review_requested" case securityAlert = "security_alert" + case ci_activity = "ci_activity" } public let id: String diff --git a/Local Pods/GitHubAPI/GitHubAPI/V3NotificationSubject.swift b/Local Pods/GitHubAPI/GitHubAPI/V3NotificationSubject.swift index 494902488..284d56dce 100644 --- a/Local Pods/GitHubAPI/GitHubAPI/V3NotificationSubject.swift +++ b/Local Pods/GitHubAPI/GitHubAPI/V3NotificationSubject.swift @@ -18,6 +18,7 @@ public struct V3NotificationSubject: Codable { case release = "Release" case invitation = "RepositoryInvitation" case vulnerabilityAlert = "RepositoryVulnerabilityAlert" + case ci_activity = "CheckSuite" } public let title: String diff --git a/Resources/Assets.xcassets/actions.imageset/Contents.json b/Resources/Assets.xcassets/actions.imageset/Contents.json new file mode 100644 index 000000000..ca796ce21 --- /dev/null +++ b/Resources/Assets.xcassets/actions.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "actions@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "actions@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Resources/Assets.xcassets/actions.imageset/actions@2x.png b/Resources/Assets.xcassets/actions.imageset/actions@2x.png new file mode 100644 index 000000000..7bed25713 Binary files /dev/null and b/Resources/Assets.xcassets/actions.imageset/actions@2x.png differ diff --git a/Resources/Assets.xcassets/actions.imageset/actions@3x.png b/Resources/Assets.xcassets/actions.imageset/actions@3x.png new file mode 100644 index 000000000..fa1a323b2 Binary files /dev/null and b/Resources/Assets.xcassets/actions.imageset/actions@3x.png differ diff --git a/Resources/Freetime.entitlements b/Resources/Freetime.entitlements index 34a3087a5..c280ba75c 100644 --- a/Resources/Freetime.entitlements +++ b/Resources/Freetime.entitlements @@ -6,9 +6,5 @@ com.apple.developer.ubiquity-kvstore-identifier $(TeamIdentifierPrefix)$(CFBundleIdentifier) - com.apple.security.application-groups - - group.com.whoisryannystrom.freetime -