Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
StefKors committed Nov 1, 2024
1 parent e5b3ef5 commit 6881e00
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion Shared/UserInterface/Models/PipelineStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ enum PipelineStatus: String, Codable, Equatable {
case manual = "MANUAL"
/// Pipeline is scheduled to run.
case scheduled = "SCHEDULED"

static func from(_ state: GitHub.CheckStatusState?) -> Self? {
switch state {
case .pending: return .pending
Expand All @@ -45,4 +45,19 @@ enum PipelineStatus: String, Codable, Equatable {
case .none: return nil
}
}

static func from(_ state: GitHub.CheckConclusionState?) -> Self? {
switch state {
case .success: return .success
case .failure: return .failed
case .skipped: return .skipped
case .actionRequired: return .manual
case .timedOut: return .failed
case .cancelled: return .canceled
case .neutral: return .created
case .stale: return .pending // I guess?
case .startupFailure: return .failed
case .none: return nil
}
}
}
2 changes: 1 addition & 1 deletion Shared/UserInterface/Views/ActionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct ActionsView: View {
}
.zIndex(2)

let isLast = index == stages.count - 1
let isLast = index == Array(groupedByWorkflow.keys.enumerated()).count - 1
if !isLast {
Rectangle()
.fill(.quaternary)
Expand Down
2 changes: 1 addition & 1 deletion Shared/UserInterface/Views/GitHubCIJobsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct GitHubCIJobsView: View {
let destination = URL(string: path) {
HStack {
Link(destination: destination, label: {
CIStatusView(status: PipelineStatus.from(stage.status))
CIStatusView(status: PipelineStatus.from(stage.conclusion))
Text(stage.name ?? "")
})
}
Expand Down

0 comments on commit 6881e00

Please sign in to comment.