changeset 1793:c0532a94a0b5

importlog links forward to the according importqueue-entry
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 14 Jan 2019 12:32:43 +0100
parents 2c71012fee5e
children de4543bfbad5
files client/src/components/Sidebar.vue client/src/components/importqueue/Importqueuedetail.vue client/src/router.js
diffstat 3 files changed, 34 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Sidebar.vue	Mon Jan 14 12:29:19 2019 +0100
+++ b/client/src/components/Sidebar.vue	Mon Jan 14 12:32:43 2019 +0100
@@ -165,13 +165,16 @@
   props: ["routeName"],
   watch: {
     $route() {
-      const { review } = this.$route.query;
+      const { review, importlog } = this.$route.query;
       if (review) {
         this.toggleContextBox("staging");
         this.$store.commit("imports/setImportToReview", review);
       } else {
         this.$store.commit("imports/setImportToReview", -99);
       }
+      if (importlog) {
+        this.$router.push("/importqueue/" + importlog);
+      }
     }
   },
   computed: {
--- a/client/src/components/importqueue/Importqueuedetail.vue	Mon Jan 14 12:29:19 2019 +0100
+++ b/client/src/components/importqueue/Importqueuedetail.vue	Mon Jan 14 12:32:43 2019 +0100
@@ -113,7 +113,13 @@
       sortAsc: true
     };
   },
+  mounted() {
+    this.openSpecificDetail();
+  },
   watch: {
+    $route() {
+      this.openSpecificDetail();
+    },
     reload() {
       if (this.reload) {
         this.entries = [];
@@ -122,6 +128,14 @@
     }
   },
   methods: {
+    openSpecificDetail() {
+      const { id } = this.$route.params;
+      if (id == this.job.id) {
+        this.showDetails(id);
+      } else {
+        this.show = false;
+      }
+    },
     formatDate(date) {
       return date
         ? new Date(date).toLocaleDateString(locale2, {
--- a/client/src/router.js	Mon Jan 14 12:29:19 2019 +0100
+++ b/client/src/router.js	Mon Jan 14 12:32:43 2019 +0100
@@ -95,6 +95,22 @@
       }
     },
     {
+      path: "/importqueue/:id",
+      name: "importqueue",
+      component: () => import("./components/importqueue/Importqueue.vue"),
+      meta: {
+        requiresAuth: true
+      },
+      beforeEnter: (to, from, next) => {
+        const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"];
+        if (!isWaterwayAdmin) {
+          next("/");
+        } else {
+          next();
+        }
+      }
+    },
+    {
       path: "/importsoundingresults",
       name: "importsoundingresults",
       component: () => import("./components/ImportSoundingresults.vue"),