forked from janek/mostr
refactor: rename stateless tasks to activities
This commit is contained in:
parent
d744fb8457
commit
c27ccb8282
|
@ -65,8 +65,8 @@ where
|
||||||
|
|
||||||
/// Build a task with informational output and optional labeled kind
|
/// Build a task with informational output and optional labeled kind
|
||||||
pub(crate) fn build_task(name: &str, tags: Vec<Tag>, kind: Option<(&str, Kind)>) -> EventBuilder {
|
pub(crate) fn build_task(name: &str, tags: Vec<Tag>, kind: Option<(&str, Kind)>) -> EventBuilder {
|
||||||
info!("Created {}task \"{name}\" with tags [{}]",
|
info!("Created {} \"{name}\" with tags [{}]",
|
||||||
kind.map(|k| k.0).unwrap_or_default(),
|
kind.map(|k| k.0).unwrap_or("task"),
|
||||||
tags.iter().map(format_tag).join(", "));
|
tags.iter().map(format_tag).join(", "));
|
||||||
EventBuilder::new(kind.map(|k| k.1).unwrap_or(TASK_KIND), name, tags)
|
EventBuilder::new(kind.map(|k| k.1).unwrap_or(TASK_KIND), name, tags)
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ impl Task {
|
||||||
self.state().unwrap_or_else(|| self.default_state())
|
self.state().unwrap_or_else(|| self.default_state())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns None for a stateless task.
|
/// Returns None for activities.
|
||||||
pub(crate) fn state_label(&self) -> Option<ColoredString> {
|
pub(crate) fn state_label(&self) -> Option<ColoredString> {
|
||||||
self.state()
|
self.state()
|
||||||
.or_else(|| Some(self.default_state()).filter(|_| self.is_task()))
|
.or_else(|| Some(self.default_state()).filter(|_| self.is_task()))
|
||||||
|
|
|
@ -68,7 +68,7 @@ pub(crate) struct TasksRelay {
|
||||||
view: Vec<EventId>,
|
view: Vec<EventId>,
|
||||||
search_depth: usize,
|
search_depth: usize,
|
||||||
view_depth: usize,
|
view_depth: usize,
|
||||||
pub(crate) recurse_stateless_tasks: bool,
|
pub(crate) recurse_activities: bool,
|
||||||
|
|
||||||
/// Currently active tags
|
/// Currently active tags
|
||||||
tags: BTreeSet<Tag>,
|
tags: BTreeSet<Tag>,
|
||||||
|
@ -169,7 +169,7 @@ impl TasksRelay {
|
||||||
state: Default::default(),
|
state: Default::default(),
|
||||||
search_depth: 4,
|
search_depth: 4,
|
||||||
view_depth: 0,
|
view_depth: 0,
|
||||||
recurse_stateless_tasks: true,
|
recurse_activities: true,
|
||||||
|
|
||||||
sender,
|
sender,
|
||||||
overflow: Default::default(),
|
overflow: Default::default(),
|
||||||
|
@ -1092,7 +1092,7 @@ impl TasksRelay {
|
||||||
}
|
}
|
||||||
let (input, tags) = extract_tags(note.trim());
|
let (input, tags) = extract_tags(note.trim());
|
||||||
self.submit(
|
self.submit(
|
||||||
build_task(input, tags, Some(("stateless ", Kind::TextNote)))
|
build_task(input, tags, Some(("activity", Kind::TextNote)))
|
||||||
.add_tags(self.parent_tag())
|
.add_tags(self.parent_tag())
|
||||||
.add_tags(self.tags.iter().cloned())
|
.add_tags(self.tags.iter().cloned())
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue