changeset 2378:c69432c1c4ac

router: fixed frontend routing. renamed routes. changed display according to new route names
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 22 Feb 2019 12:38:47 +0100
parents fdec7a652f34
children f04d33fec01e
files client/src/components/App.vue client/src/router.js
diffstat 2 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/App.vue	Fri Feb 22 12:28:14 2019 +0100
+++ b/client/src/components/App.vue	Fri Feb 22 12:38:47 2019 +0100
@@ -5,27 +5,27 @@
         <div class="mr-auto d-flex">
           <Sidebar :routeName="routeName"></Sidebar>
           <div :class="searchContainer">
-            <Search v-if="routeName == 'mainview'"></Search>
-            <Contextbox v-if="routeName == 'mainview'"></Contextbox>
+            <Search v-if="isMapVisible"></Search>
+            <Contextbox v-if="isMapVisible"></Contextbox>
           </div>
         </div>
         <div class="ml-auto d-flex">
           <div class="d-flex flex-column align-items-end">
-            <Profiles v-if="routeName == 'mainview'"></Profiles>
-            <Pdftool v-if="routeName == 'mainview'"></Pdftool>
+            <Profiles v-if="isMapVisible"></Profiles>
+            <Pdftool v-if="isMapVisible"></Pdftool>
           </div>
           <div class="d-flex flex-column align-items-end">
-            <Identify v-if="routeName == 'mainview'"></Identify>
-            <Layers v-if="routeName == 'mainview'"></Layers>
+            <Identify v-if="isMapVisible"></Identify>
+            <Layers v-if="isMapVisible"></Layers>
           </div>
-          <Toolbar v-if="routeName == 'mainview'"></Toolbar>
+          <Toolbar v-if="isMapVisible"></Toolbar>
         </div>
       </div>
       <div class="flex-fill"></div>
       <div class="d-flex flex-row align-items-end">
-        <Infobar v-if="routeName == 'mainview'"></Infobar>
+        <Infobar v-if="isMapVisible"></Infobar>
       </div>
-      <Zoom v-if="routeName == 'mainview'"></Zoom>
+      <Zoom v-if="isMapVisible"></Zoom>
     </div>
     <div class="d-flex flex-column"><router-view /></div>
     <vue-snotify></vue-snotify>
@@ -88,6 +88,9 @@
   computed: {
     ...mapState("user", ["isAuthenticated"]),
     ...mapState("application", ["contextBoxContent", "showSearchbar"]),
+    isMapVisible() {
+      return /stretches|review|bottlenecks|mainview/.test(this.routeName);
+    },
     routeName() {
       const routeName = this.$route.name;
       return routeName;
--- a/client/src/router.js	Fri Feb 22 12:28:14 2019 +0100
+++ b/client/src/router.js	Fri Feb 22 12:38:47 2019 +0100
@@ -176,7 +176,7 @@
     },
     {
       path: "/bottlenecks",
-      name: "mainview",
+      name: "bottlenecks",
       component: Main,
       meta: {
         requiresAuth: true
@@ -190,7 +190,7 @@
     },
     {
       path: "/review/:id?",
-      name: "mainview",
+      name: "review",
       component: Main,
       meta: {
         requiresAuth: true
@@ -209,7 +209,7 @@
     },
     {
       path: "/stretches",
-      name: "mainview",
+      name: "stretches",
       component: Main,
       meta: {
         requiresAuth: true