use std::collections::HashMap;
use crate::jira::types::{Attachment, Comment, FieldOption, Issue, Transition};
#[derive(Debug)]
pub enum AppEvent {
Input(crossterm::event::Event),
SourceLoaded(String, Vec<Issue>),
SourceError(String, anyhow::Error),
SubsourceError(String, usize, anyhow::Error),
ActionDone(ActionResult),
CurrentUserResolved(String),
Tick,
PathCompletions {
generation: u64,
completions: Vec<String>,
},
UpdateWarnings(Vec<String>),
}
#[derive(Debug)]
pub enum ActionResult {
TransitionApplied {
issue_key: String,
new_status: String,
},
TransitionsLoaded {
issue_key: String,
transitions: Vec<Transition>,
},
CommentPosted {
issue_key: String,
new_comment: Comment,
},
AssignedToMe {
issue_key: String,
},
MovedToProject {
issue_key: String,
project: String,
},
Hidden {
issue_key: String,
},
FieldUpdated {
issue_key: String,
field_id: String,
new_value: serde_json::Value,
},
FieldOptionsLoaded {
issue_key: String,
field_id: String,
label: String,
original_json: serde_json::Value,
options: Vec<FieldOption>,
description: Option<String>,
multi: bool,
},
FieldNamesLoaded {
names: HashMap<String, String>,
schemas: HashMap<String, String>,
all_fields: bool,
},
CommentEdited {
issue_key: String,
updated_comment: Comment,
},
CommentDeleted {
issue_key: String,
comment_id: String,
},
AttachmentCached {
attachment_id: String,
cache_path: std::path::PathBuf,
open_after: bool,
},
AttachmentUploaded {
issue_key: String,
new_attachment: Attachment,
},
AttachmentDeleted {
issue_key: String,
attachment_id: String,
},
Error(anyhow::Error),
}