From 64a2daae25b15a4c36feec7278353355dfbd892e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Wed, 12 Sep 2018 22:34:59 +0200 Subject: [PATCH] Work on showing the tasks --- package-lock.json | 5 ++ package.json | 3 +- src/app.vue | 2 +- src/components/TheCollections/Calendar.vue | 57 +++++++++++++++------- src/components/TheCollections/General.vue | 6 +++ src/components/TheDetails.vue | 13 ++++- src/components/TheRouter.js | 7 ++- src/components/TheSettings.vue | 2 +- src/dummyCalendars.js | 12 +++++ src/main.js | 3 ++ src/store.js | 8 ++- 11 files changed, 93 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index bf8dbd53..be84e3a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12853,6 +12853,11 @@ "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.0.1.tgz", "integrity": "sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w==" }, + "vuex-router-sync": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/vuex-router-sync/-/vuex-router-sync-5.0.0.tgz", + "integrity": "sha512-Mry2sO4kiAG64714X1CFpTA/shUH1DmkZ26DFDtwoM/yyx6OtMrc+MxrU+7vvbNLO9LSpgwkiJ8W+rlmRtsM+w==" + }, "w3c-hr-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", diff --git a/package.json b/package.json index bad568f1..2c66fa2f 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "v-tooltip": "2.0.0-rc.33", "vue": "^2.5.17", "vue-router": "3.0.1", - "vuex": "^3.0.1" + "vuex": "^3.0.1", + "vuex-router-sync": "^5.0.0" }, "devDependencies": { "@vue/test-utils": "^1.0.0-beta.24", diff --git a/src/app.vue b/src/app.vue index e210c183..c302a18b 100644 --- a/src/app.vue +++ b/src/app.vue @@ -121,7 +121,7 @@ License along with this library. If not, see . -
+
diff --git a/src/components/TheCollections/Calendar.vue b/src/components/TheCollections/Calendar.vue index 8392160b..830ddfc9 100644 --- a/src/components/TheCollections/Calendar.vue +++ b/src/components/TheCollections/Calendar.vue @@ -21,8 +21,8 @@ License along with this library. If not, see . diff --git a/src/components/TheCollections/General.vue b/src/components/TheCollections/General.vue index 6a97a7c0..7298e238 100644 --- a/src/components/TheCollections/General.vue +++ b/src/components/TheCollections/General.vue @@ -66,6 +66,12 @@ export default { components: { 'task-body': TaskBody }, + props: { + collectionId: { + type: String, + default: '' + } + }, computed: Object.assign({}, mapState({ calendars: state => state.calendars, diff --git a/src/components/TheDetails.vue b/src/components/TheDetails.vue index 9ae6833e..0742ae0c 100644 --- a/src/components/TheDetails.vue +++ b/src/components/TheDetails.vue @@ -243,7 +243,7 @@ License along with this library. If not, see . ng-show="task.calendar.writable"> - + @@ -279,6 +279,15 @@ export default { } }, computed: mapState({ - }) + }), + methods: { + closeDetails: function() { + if (this.$route.params.calendarId) { + this.$router.push({ path: `/calendars/${this.$route.params.calendarId}` }) + } else { + this.$router.push({ path: `/collections/${this.$route.params.collectionId}` }) + } + } + } } diff --git a/src/components/TheRouter.js b/src/components/TheRouter.js index 72af1ba6..cbd81494 100644 --- a/src/components/TheRouter.js +++ b/src/components/TheRouter.js @@ -35,8 +35,11 @@ const routes = [ // reliably with router-link due to // https://github.com/vuejs/vue-router/issues/419 { path: '/collections/week', component: CollectionWeek }, - { path: '/collections/:collectionId', component: CollectionGeneral }, - { path: '/calendars/:id', component: CollectionCalendar, props: true } + { path: '/collections/week/tasks/:taskId', component: CollectionWeek }, + { path: '/collections/:collectionId', component: CollectionGeneral, props: true }, + { path: '/collections/:collectionId/tasks/:taskId', component: CollectionGeneral, props: true }, + { path: '/calendars/:calendarId', component: CollectionCalendar, props: true }, + { path: '/calendars/:calendarId/tasks/:taskId', component: CollectionCalendar, props: true } ] Vue.use(VueRouter) diff --git a/src/components/TheSettings.vue b/src/components/TheSettings.vue index c336cce3..ded0deb7 100644 --- a/src/components/TheSettings.vue +++ b/src/components/TheSettings.vue @@ -20,7 +20,7 @@ License along with this library. If not, see . -->