diff client/src/components/Sidebar.vue @ 1650:90211725e4a9

highlighing feature for staging area
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 20 Dec 2018 16:45:26 +0100
parents f2d24dceecc7
children f4bd67daaaff
line wrap: on
line diff
--- a/client/src/components/Sidebar.vue	Thu Dec 20 16:00:50 2018 +0100
+++ b/client/src/components/Sidebar.vue	Thu Dec 20 16:45:26 2018 +0100
@@ -141,6 +141,17 @@
 export default {
   name: "sidebar",
   props: ["routeName"],
+  watch: {
+    $route() {
+      const { review } = this.$route.query;
+      if (review) {
+        this.toggleContextBox("staging");
+        this.$store.commit("imports/setImportToReview", review);
+      } else {
+        this.$store.commit("imports/setImportToReview", -99);
+      }
+    }
+  },
   computed: {
     ...mapGetters("user", ["isSysAdmin", "isWaterwayAdmin"]),
     ...mapState("user", ["user"]),
@@ -170,7 +181,7 @@
       this.$router.push("/login");
     },
     toggleContextBox(context) {
-      this.$router.push("/");
+      if (this.$route.path !== "/") this.$router.push("/");
       this.$store.commit("application/showContextBox", true);
       this.$store.commit("application/contextBoxContent", context);
       this.$store.commit("application/showSearchbar", true);