Hide Logs button for unrun jobs; remove inbox filter bar; bump to 1.8
Build iOS App / Build .ipa and publish source (push) Successful in 23s
Build iOS App / Build .ipa and publish source (push) Successful in 23s
- Checks: only show the Logs button once a job has actually run (terminal conclusion). Queued/running jobs are grey with no logs, so the button was useless there. - Inbox: remove the segmented filter bar (All/Assigned/By me/Review) — not useful yet. Bump to 1.8.
This commit is contained in:
@@ -187,7 +187,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 8;
|
||||
CURRENT_PROJECT_VERSION = 9;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "GiteaPR";
|
||||
@@ -197,7 +197,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.7;
|
||||
MARKETING_VERSION = 1.8;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.bueso.giteapr;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
@@ -211,7 +211,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 8;
|
||||
CURRENT_PROJECT_VERSION = 9;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "GiteaPR";
|
||||
@@ -221,7 +221,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.7;
|
||||
MARKETING_VERSION = 1.8;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.bueso.giteapr;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
|
||||
@@ -218,14 +218,16 @@ struct ChecksTab: View {
|
||||
.font(.caption)
|
||||
.buttonStyle(.bordered)
|
||||
}
|
||||
NavigationLink {
|
||||
JobLogsView(repo: vm.repo, runID: run.id, jobID: job.id,
|
||||
jobName: job.name)
|
||||
} label: {
|
||||
Text("Logs")
|
||||
.font(.caption)
|
||||
if hasRun(job) {
|
||||
NavigationLink {
|
||||
JobLogsView(repo: vm.repo, runID: run.id, jobID: job.id,
|
||||
jobName: job.name)
|
||||
} label: {
|
||||
Text("Logs")
|
||||
.font(.caption)
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,4 +265,14 @@ struct ChecksTab: View {
|
||||
let c = (job.conclusion ?? "").lowercased()
|
||||
return c == "failure" || c == "cancelled"
|
||||
}
|
||||
|
||||
/// A job has run only once it has a terminal conclusion. Queued/running
|
||||
/// jobs (grey, no logs yet) hide the Logs button.
|
||||
private func hasRun(_ job: ActionJob) -> Bool {
|
||||
let s = job.status.lowercased()
|
||||
if s == "queued" || s == "running" || s == "waiting" || s == "requested" {
|
||||
return false
|
||||
}
|
||||
return (job.conclusion ?? "").lowercased() != ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,7 @@ struct InboxView: View {
|
||||
ContentUnavailableView(
|
||||
"No open PRs",
|
||||
systemImage: "tray",
|
||||
description: Text(vm.filter == .all
|
||||
? "Nothing to review."
|
||||
: "No PRs match this filter."))
|
||||
description: Text("Nothing to review."))
|
||||
} else {
|
||||
List {
|
||||
ForEach(vm.displayedRows) { row in
|
||||
@@ -38,17 +36,6 @@ struct InboxView: View {
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .primaryAction) { settingsButton }
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .bottomBar) {
|
||||
Picker("Filter", selection: $vm.filter) {
|
||||
ForEach(InboxFilter.allCases) { f in
|
||||
Text(f.rawValue).tag(f)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
.disabled(vm.displayedRows.isEmpty && vm.isLoading)
|
||||
}
|
||||
}
|
||||
.navigationDestination(for: PRRow.self) { row in
|
||||
PRDetailView(repo: row.repo, prNumber: row.pr.number)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user