Show audit and review pickers as labeled rows
This commit is contained in:
@@ -119,15 +119,14 @@ private struct ProjectWorkflowMenu: View {
|
||||
|
||||
var body: some View {
|
||||
let current = audit ? project.auditWorkflow : project.reviewWorkflow
|
||||
let kind = audit ? "audits" : "reviews"
|
||||
Menu {
|
||||
Button("No \(kind)") { set("") }
|
||||
Button("Off") { set("") }
|
||||
ForEach(workflows, id: \.self) { name in
|
||||
Button(name) { set(name) }
|
||||
}
|
||||
} label: {
|
||||
HStack(spacing: 6) {
|
||||
Text(current.isEmpty ? "no \(kind)" : "\(kind): \(current)")
|
||||
Text(current.isEmpty ? "Off" : current)
|
||||
Image(systemName: "chevron.up.chevron.down")
|
||||
.font(.system(size: 8, weight: .semibold))
|
||||
}
|
||||
@@ -175,12 +174,21 @@ private struct ProjectBlock: View {
|
||||
HStack(alignment: .firstTextBaseline, spacing: 6) {
|
||||
Text(project.name).font(Fonts.font(13, weight: 700))
|
||||
Text(project.defaultBranch).font(Fonts.font(11)).foregroundStyle(Palette.muted)
|
||||
Spacer()
|
||||
ProjectWorkflowMenu(project: project, audit: true)
|
||||
ProjectWorkflowMenu(project: project, audit: false)
|
||||
}
|
||||
.padding(.top, 16)
|
||||
.padding(.bottom, 6)
|
||||
Grid(alignment: .leading, horizontalSpacing: 12, verticalSpacing: 4) {
|
||||
GridRow {
|
||||
Text("Audit \(project.defaultBranch)")
|
||||
ProjectWorkflowMenu(project: project, audit: true)
|
||||
}
|
||||
GridRow {
|
||||
Text("Review tasks")
|
||||
ProjectWorkflowMenu(project: project, audit: false)
|
||||
}
|
||||
}
|
||||
.font(Fonts.font(11))
|
||||
.foregroundStyle(Palette.muted)
|
||||
heading("Tasks")
|
||||
TaskRows(active: active.filter { !$0.background })
|
||||
ForEach(active.filter(\.background), id: \.id) { task in
|
||||
|
||||
Reference in New Issue
Block a user