mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 23:46:41 +02:00
WIP
This commit is contained in:
parent
5f92b3ed5c
commit
d1909744c9
1 changed files with 37 additions and 39 deletions
|
@ -18,32 +18,7 @@ use crate::{
|
|||
action::Action,
|
||||
config::{Config, KeyBindings},
|
||||
};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct TaskReport {
|
||||
pub config: Config,
|
||||
pub command_tx: Option<UnboundedSender<Action>>,
|
||||
pub last_export: Option<std::time::SystemTime>,
|
||||
pub report: String,
|
||||
pub filter: String,
|
||||
pub current_context_filter: String,
|
||||
pub tasks: Vec<Task>,
|
||||
pub rows: Vec<Vec<String>>,
|
||||
pub state: TableState,
|
||||
pub columns: Vec<String>,
|
||||
pub labels: Vec<String>,
|
||||
pub date_time_vague_precise: bool,
|
||||
pub virtual_tags: Vec<String>,
|
||||
pub description_width: usize,
|
||||
pub current_selection: usize,
|
||||
pub current_selection_id: Option<u64>,
|
||||
pub current_selection_uuid: Option<Uuid>,
|
||||
}
|
||||
|
||||
impl TaskReport {
|
||||
pub fn new() -> Self {
|
||||
let mut s = Self::default();
|
||||
s.virtual_tags = vec![
|
||||
const VIRTUAL_TAGS: [&str; 34] = [
|
||||
"PROJECT",
|
||||
"BLOCKED",
|
||||
"UNBLOCKED",
|
||||
|
@ -78,10 +53,33 @@ impl TaskReport {
|
|||
"RECURRING",
|
||||
"INSTANCE",
|
||||
"TEMPLATE",
|
||||
]
|
||||
.iter()
|
||||
.map(|s| s.to_string())
|
||||
.collect::<Vec<_>>();
|
||||
];
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct TaskReport {
|
||||
pub config: Config,
|
||||
pub command_tx: Option<UnboundedSender<Action>>,
|
||||
pub last_export: Option<std::time::SystemTime>,
|
||||
pub report: String,
|
||||
pub filter: String,
|
||||
pub current_context_filter: String,
|
||||
pub tasks: Vec<Task>,
|
||||
pub rows: Vec<Vec<String>>,
|
||||
pub state: TableState,
|
||||
pub columns: Vec<String>,
|
||||
pub labels: Vec<String>,
|
||||
pub date_time_vague_precise: bool,
|
||||
pub virtual_tags: Vec<String>,
|
||||
pub description_width: usize,
|
||||
pub current_selection: usize,
|
||||
pub current_selection_id: Option<u64>,
|
||||
pub current_selection_uuid: Option<Uuid>,
|
||||
}
|
||||
|
||||
impl TaskReport {
|
||||
pub fn new() -> Self {
|
||||
let mut s = Self::default();
|
||||
s.virtual_tags = VIRTUAL_TAGS.iter().map(|s| s.to_string()).collect::<Vec<_>>();
|
||||
s
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue