diff --git a/src/components/tasks/ShowTasks.vue b/src/components/tasks/ShowTasks.vue
index 02be4a0b..98006a27 100644
--- a/src/components/tasks/ShowTasks.vue
+++ b/src/components/tasks/ShowTasks.vue
@@ -9,7 +9,7 @@
diff --git a/src/components/tasks/reusable/relatedTasks.vue b/src/components/tasks/reusable/relatedTasks.vue
index 720ed304..2a61e9c2 100644
--- a/src/components/tasks/reusable/relatedTasks.vue
+++ b/src/components/tasks/reusable/relatedTasks.vue
@@ -51,7 +51,7 @@
- {{ $store.getters['namespaces/getListById'](t.listId) === null ? '' : $store.getters['namespaces/getListById'](t.listId).title }} >
+ {{ $store.getters['lists/getListById'](t.listId) === null ? '' : $store.getters['lists/getListById'](t.listId).title }} >
{{t.text}}
diff --git a/src/components/tasks/reusable/singleTaskInList.vue b/src/components/tasks/reusable/singleTaskInList.vue
index 364efab6..370e3ff5 100644
--- a/src/components/tasks/reusable/singleTaskInList.vue
+++ b/src/components/tasks/reusable/singleTaskInList.vue
@@ -2,6 +2,15 @@
+
+
+ {{ $store.getters['lists/getListById'](task.listId).title }}
+
+
@@ -61,7 +70,11 @@
taskDetailRoute: {
type: String,
default: 'task.list.detail'
- }
+ },
+ showList: {
+ type: Boolean,
+ default: false,
+ },
},
watch: {
theTask(newVal) {
diff --git a/src/store/index.js b/src/store/index.js
index b291d465..fdc67593 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -2,12 +2,13 @@ import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
+import {CURRENT_LIST, ERROR_MESSAGE, IS_FULLPAGE, LOADING, ONLINE} from './mutation-types'
import config from './modules/config'
import auth from './modules/auth'
import namespaces from './modules/namespaces'
import kanban from './modules/kanban'
import tasks from './modules/tasks'
-import {CURRENT_LIST, ERROR_MESSAGE, IS_FULLPAGE, LOADING, ONLINE} from './mutation-types'
+import lists from './modules/lists'
export const store = new Vuex.Store({
modules: {
@@ -16,6 +17,7 @@ export const store = new Vuex.Store({
namespaces,
kanban,
tasks,
+ lists,
},
state: {
loading: false,
diff --git a/src/store/modules/lists.js b/src/store/modules/lists.js
new file mode 100644
index 00000000..4d31f934
--- /dev/null
+++ b/src/store/modules/lists.js
@@ -0,0 +1,25 @@
+import Vue from 'vue'
+
+export default {
+ namespaced: true,
+ // The state is an object which has the list ids as keys.
+ state: () => ({}),
+ mutations: {
+ addList(state, list) {
+ Vue.set(state, list.id, list)
+ },
+ addLists(state, lists) {
+ lists.forEach(l => {
+ Vue.set(state, l.id, l)
+ })
+ },
+ },
+ getters: {
+ getListById: state => id => {
+ if(typeof state[id] !== 'undefined') {
+ return state[id]
+ }
+ return null
+ },
+ },
+}
\ No newline at end of file
diff --git a/src/store/modules/namespaces.js b/src/store/modules/namespaces.js
index 2dd39fc4..7e480f0b 100644
--- a/src/store/modules/namespaces.js
+++ b/src/store/modules/namespaces.js
@@ -47,16 +47,6 @@ 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
- },
getListAndNamespaceById: state => listId => {
for (const n in state.namespaces) {
for (const l in state.namespaces[n].lists) {
@@ -78,6 +68,17 @@ export default {
return namespaceService.getAll({}, {is_archived: true})
.then(r => {
ctx.commit('namespaces', r)
+
+ // Put all lists in the list state
+ const lists = []
+ r.forEach(n => {
+ n.lists.forEach(l => {
+ lists.push(l)
+ })
+ })
+
+ ctx.commit('lists/addLists', lists, {root:true})
+
return Promise.resolve()
})
.catch(e => {
diff --git a/src/styles/components/tasks.scss b/src/styles/components/tasks.scss
index 0adb0635..3ea974f3 100644
--- a/src/styles/components/tasks.scss
+++ b/src/styles/components/tasks.scss
@@ -54,6 +54,13 @@
.overdue{
color: $red;
}
+
+ .task-list {
+ width: auto;
+ color: lighten($grey, 25%);
+ font-size: .9em;
+ vertical-align: text-bottom;
+ }
}
.tag {