Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/commands/initiatives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ struct InitiativeRow {
name: String,
#[tabled(rename = "Status")]
status: String,
#[tabled(rename = "Progress")]
progress: String,
#[tabled(rename = "Health")]
health: String,
#[tabled(rename = "Projects")]
project_count: String,
}
Expand Down Expand Up @@ -113,7 +113,7 @@ async fn list_initiatives(output: &OutputOptions, pagination: &PaginationOptions
description
status
sortOrder
progress
health
projects {
nodes {
id
Expand Down Expand Up @@ -143,10 +143,7 @@ async fn list_initiatives(output: &OutputOptions, pagination: &PaginationOptions
.iter()
.filter_map(|v| {
let i = serde_json::from_value::<Initiative>(v.clone()).ok()?;
let progress = format!(
"{}%",
(v["progress"].as_f64().unwrap_or(0.0) * 100.0) as i32
);
let health = v["health"].as_str().unwrap_or("-").to_string();
let project_count = v["projects"]["nodes"]
.as_array()
.map(|a| a.len().to_string())
Expand All @@ -155,7 +152,7 @@ async fn list_initiatives(output: &OutputOptions, pagination: &PaginationOptions
id: i.id,
name: truncate(&i.name, max_width),
status: i.status.as_deref().unwrap_or("-").to_string(),
progress,
health,
project_count,
})
})
Expand Down Expand Up @@ -396,4 +393,3 @@ async fn delete_initiative(id: &str, force: bool) -> Result<()> {

Ok(())
}

2 changes: 0 additions & 2 deletions src/commands/issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,6 @@ async fn get_issue(id: &str, output: &OutputOptions, history: bool, comments: bo
toProject { name }
archived
trashed
slaBreachesAt
slaStartedAt
}
}"#
} else {
Expand Down
Loading