diff client/src/router.js @ 1879:9a2fbeaabd52 dev-pdf-generation

merging in from branch default
author Bernhard Reiter <bernhard@intevation.de>
date Tue, 15 Jan 2019 10:07:10 +0100
parents 11669276e197
children 733cfc3db48a
line wrap: on
line diff
--- a/client/src/router.js	Tue Jan 15 09:54:46 2019 +0100
+++ b/client/src/router.js	Tue Jan 15 10:07:10 2019 +0100
@@ -20,19 +20,6 @@
 
 /*  facilitate codesplitting */
 const Login = () => import("./components/Login.vue");
-const Main = () => import("./components/Main.vue");
-const Usermanagement = () =>
-  import("./components/usermanagement/Usermanagement.vue");
-const Logs = () => import("./components/Logs.vue");
-const Importqueue = () => import("./components/importqueue/Importqueue.vue");
-const Importschedule = () =>
-  import("./components/importschedule/Importschedule.vue");
-const Systemconfiguration = () =>
-  import("./components/Systemconfiguration.vue");
-const Importsoundingresults = () =>
-  import("./components/ImportSoundingresults.vue");
-
-const Importstretches = () => import("./components/ImportStretches.vue");
 
 Vue.use(Router);
 
@@ -46,7 +33,7 @@
     {
       path: "/usermanagement",
       name: "usermanagement",
-      component: Usermanagement,
+      component: () => import("./components/usermanagement/Usermanagement.vue"),
       meta: {
         requiresAuth: true
       },
@@ -62,7 +49,7 @@
     {
       path: "/logs",
       name: "logs",
-      component: Logs,
+      component: () => import("./components/Logs.vue"),
       meta: {
         requiresAuth: true
       },
@@ -78,7 +65,7 @@
     {
       path: "/systemconfiguration",
       name: "systemconfiguration",
-      component: Systemconfiguration,
+      component: () => import("./components/Systemconfiguration.vue"),
       meta: {
         requiresAuth: true
       },
@@ -93,8 +80,24 @@
     },
     {
       path: "/importqueue",
+      name: "importqueues",
+      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: "/importqueue/:id",
       name: "importqueue",
-      component: Importqueue,
+      component: () => import("./components/importqueue/Importqueue.vue"),
       meta: {
         requiresAuth: true
       },
@@ -110,7 +113,7 @@
     {
       path: "/importsoundingresults",
       name: "importsoundingresults",
-      component: Importsoundingresults,
+      component: () => import("./components/ImportSoundingresults.vue"),
       meta: {
         requiresAuth: true
       },
@@ -124,9 +127,25 @@
       }
     },
     {
-      path: "/importstretches",
-      name: "importstretches",
-      component: Importstretches,
+      path: "/importwaterwayprofiles",
+      name: "waterwayprofiles",
+      component: () => import("./components/ImportWaterwayProfiles"),
+      meta: {
+        requiresAuth: true
+      },
+      beforeEnter: (to, from, next) => {
+        const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"];
+        if (!isWaterwayAdmin) {
+          next("/");
+        } else {
+          next();
+        }
+      }
+    },
+    {
+      path: "/importapprovedgaugemeasurement",
+      name: "approvedgaugemeasurement",
+      component: () => import("./components/ImportApprovedGaugeMeasurement"),
       meta: {
         requiresAuth: true
       },
@@ -142,7 +161,7 @@
     {
       path: "/importschedule",
       name: "importschedule",
-      component: Importschedule,
+      component: () => import("./components/importschedule/Importschedule.vue"),
       meta: {
         requiresAuth: true
       },
@@ -158,7 +177,7 @@
     {
       path: "/",
       name: "mainview",
-      component: Main,
+      component: () => import("./components/Main.vue"),
       meta: {
         requiresAuth: true
       },