forked from janek/mostr
feat(tasks): add task author to default columns
This commit is contained in:
parent
721c200b97
commit
c64a1fa051
2 changed files with 18 additions and 16 deletions
|
@ -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
|
||||
|
|
30
src/tasks.rs
30
src/tasks.rs
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue