Close, reopen, and delete issues on iPhone
This commit is contained in:
@@ -103,6 +103,7 @@ pub struct IssueEditorPage {
|
||||
pub title: String,
|
||||
pub body: String,
|
||||
pub due_date: Option<i64>,
|
||||
pub closed: bool,
|
||||
pub labels: Vec<IssueEditorLabel>,
|
||||
pub milestones: Vec<IssueEditorMilestone>,
|
||||
}
|
||||
@@ -666,6 +667,7 @@ pub fn issue_editor_page(data: IssueEditorData) -> IssueEditorPage {
|
||||
.as_ref()
|
||||
.and_then(|issue| issue.due_date.as_deref())
|
||||
.and_then(parse_api_date),
|
||||
closed: data.issue.as_ref().and_then(|issue| issue.state.as_deref()) == Some("closed"),
|
||||
labels,
|
||||
milestones,
|
||||
}
|
||||
@@ -1513,6 +1515,7 @@ mod tests {
|
||||
title: Some("Title".into()),
|
||||
body: Some("Body".into()),
|
||||
due_date: Some("2024-02-29T18:00:00Z".into()),
|
||||
state: Some("closed".into()),
|
||||
labels: Some(vec![selected_label.clone()]),
|
||||
milestone: Some(Box::new(models::Milestone {
|
||||
id: Some(4),
|
||||
@@ -1533,8 +1536,16 @@ mod tests {
|
||||
|
||||
assert_eq!((page.title.as_str(), page.body.as_str()), ("Title", "Body"));
|
||||
assert_eq!(page.due_date, Some(1_709_164_800));
|
||||
assert!(page.closed);
|
||||
assert!(page.labels[0].selected);
|
||||
assert!(page.milestones[0].selected);
|
||||
|
||||
let new = issue_editor_page(IssueEditorData {
|
||||
issue: None,
|
||||
labels: Vec::new(),
|
||||
milestones: Vec::new(),
|
||||
});
|
||||
assert!(!new.closed);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user