From 48df1a44e8f8127ddc96ee650b8206eca41c35bb Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 9 May 2020 19:33:37 +0200 Subject: [PATCH] Show the list of a related task if it belongs to a different list --- src/components/tasks/reusable/relatedTasks.vue | 5 ++++- src/store/modules/namespaces.js | 12 ++++++++++++ src/styles/components/taskRelations.scss | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/tasks/reusable/relatedTasks.vue b/src/components/tasks/reusable/relatedTasks.vue index 9c98a1e3..a597fda5 100644 --- a/src/components/tasks/reusable/relatedTasks.vue +++ b/src/components/tasks/reusable/relatedTasks.vue @@ -48,8 +48,11 @@ {{ relationKindTitle(kind, rts.length) }}
- + + + {{ $store.getters['namespaces/getListById'](t.listId).title }} > + {{t.text}} diff --git a/src/store/modules/namespaces.js b/src/store/modules/namespaces.js index 59aa1e9e..eae11423 100644 --- a/src/store/modules/namespaces.js +++ b/src/store/modules/namespaces.js @@ -46,6 +46,18 @@ export default { } }, }, + getters: { + getListById: state => id => { + for (const n in state.namespaces) { + for (const l in state.namespaces[n].lists) { + if (state.namespaces[n].lists[l].id === id) { + return state.namespaces[n].lists[l] + } + } + } + return null + }, + }, actions: { loadNamespaces(ctx) { const namespaceService = new NamespaceService() diff --git a/src/styles/components/taskRelations.scss b/src/styles/components/taskRelations.scss index 35e76c00..93266260 100644 --- a/src/styles/components/taskRelations.scss +++ b/src/styles/components/taskRelations.scss @@ -22,6 +22,11 @@ .task { padding: .5em; + + .different-list { + color: lighten($dark, 50); + width: auto; + } } } }