mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-05-09 16:29:41 +08:00
status event model has status enum instead of closed
This commit is contained in:
@@ -81,7 +81,7 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsIssue: Is
|
||||
id: closed.fragments.nodeFields.id,
|
||||
actor: closed.actor?.login ?? Strings.unknown,
|
||||
date: date,
|
||||
closed: true,
|
||||
status: .closed,
|
||||
pullRequest: false
|
||||
)
|
||||
results.append(model)
|
||||
@@ -91,7 +91,7 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsIssue: Is
|
||||
id: reopened.fragments.nodeFields.id,
|
||||
actor: reopened.actor?.login ?? Strings.unknown,
|
||||
date: date,
|
||||
closed: false,
|
||||
status: .open,
|
||||
pullRequest: false
|
||||
)
|
||||
results.append(model)
|
||||
|
||||
@@ -77,7 +77,7 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsPullReque
|
||||
id: closed.fragments.nodeFields.id,
|
||||
actor: closed.actor?.login ?? Strings.unknown,
|
||||
date: date,
|
||||
closed: true,
|
||||
status: .closed,
|
||||
pullRequest: true
|
||||
)
|
||||
results.append(model)
|
||||
@@ -87,7 +87,7 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsPullReque
|
||||
id: reopened.fragments.nodeFields.id,
|
||||
actor: reopened.actor?.login ?? Strings.unknown,
|
||||
date: date,
|
||||
closed: false,
|
||||
status: .open,
|
||||
pullRequest: true
|
||||
)
|
||||
results.append(model)
|
||||
|
||||
@@ -55,8 +55,15 @@ final class IssueStatusEventCell: UICollectionViewCell {
|
||||
]
|
||||
label.attributedText = NSAttributedString(string: model.actor, attributes: actorAttributes)
|
||||
|
||||
button.config(pullRequest: model.pullRequest, status: model.closed ? .closed : .open)
|
||||
button.setTitle(model.closed ? Strings.closed : Strings.reopened, for: .normal)
|
||||
button.config(pullRequest: model.pullRequest, status: model.status)
|
||||
|
||||
let title: String
|
||||
switch model.status {
|
||||
case .open: title = Strings.reopened // open event only happens when RE-opening
|
||||
case .closed: title = Strings.closed
|
||||
case .merged: fatalError("Merge events handled in other model+cell")
|
||||
}
|
||||
button.setTitle(title, for: .normal)
|
||||
|
||||
dateLabel.setText(date: model.date)
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@ final class IssueStatusEventModel: ListDiffable {
|
||||
let id: String
|
||||
let actor: String
|
||||
let date: Date
|
||||
let closed: Bool
|
||||
let status: IssueStatus
|
||||
let pullRequest: Bool
|
||||
|
||||
init(id: String, actor: String, date: Date, closed: Bool, pullRequest: Bool) {
|
||||
init(id: String, actor: String, date: Date, status: IssueStatus, pullRequest: Bool) {
|
||||
self.id = id
|
||||
self.actor = actor
|
||||
self.date = date
|
||||
self.closed = closed
|
||||
self.status = status
|
||||
self.pullRequest = pullRequest
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>377</string>
|
||||
<string>379</string>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>org-appextension-feature-password-management</string>
|
||||
|
||||
Reference in New Issue
Block a user