feat(tasks): add task author to default columns

This commit is contained in:
xeruf 2024-08-19 21:18:11 +03:00
parent 721c200b97
commit c64a1fa051
2 changed files with 18 additions and 16 deletions

View File

@ -30,7 +30,7 @@ Immutable:
- `parentid` - unique task id of the parent, if any
- `name` - initial name of the task
- `created` - task creation timestamp
- `author` - name of the task creator
- `author` - name or abbreviated key of the task creator
Task:
- `status` - pure task status
- `hashtags` - list of hashtags set for the task

View File

@ -119,19 +119,21 @@ impl Tasks {
tasks: Default::default(),
history: Default::default(),
users: Default::default(),
properties: vec![
"state".into(),
"rtime".into(),
"hashtags".into(),
"rpath".into(),
"desc".into(),
],
sorting: VecDeque::from([
"state".into(),
"hashtags".into(),
"rtime".into(),
"name".into(),
]),
properties: [
"author",
"state",
"rtime",
"hashtags",
"rpath",
"desc",
].into_iter().map(|s| s.to_string()).collect(),
sorting: [
"author",
"state",
"hashtags",
"rtime",
"name",
].into_iter().map(|s| s.to_string()).collect(),
view: Default::default(),
tags: Default::default(),
tags_excluded: Default::default(),
@ -502,7 +504,7 @@ impl Tasks {
pub(crate) fn get_author(&self, pubkey: &PublicKey) -> String {
self.users.get(pubkey)
.and_then(|m| m.name.clone())
.unwrap_or_else(|| pubkey.to_string())
.unwrap_or_else(|| format!("{:.6}", pubkey.to_string()))
}
// Movement and Selection