changeset 1618:9f5090fe130f

fix:reimported STATES in staging view
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 18 Dec 2018 12:57:43 +0100
parents f4b31cf5b656
children 3093bab05c81
files client/src/components/staging/Staging.vue
diffstat 1 files changed, 4 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/staging/Staging.vue	Tue Dec 18 12:56:57 2018 +0100
+++ b/client/src/components/staging/Staging.vue	Tue Dec 18 12:57:43 2018 +0100
@@ -62,10 +62,9 @@
  */
 import { mapState } from "vuex";
 import { HTTP } from "@/lib/http.js";
+import { displayError, displayInfo } from "@/lib/errors.js";
+import StagingDetail from "./StagingDetail";
 import { STATES } from "@/store/imports.js";
-import { displayError, displayInfo } from "@/lib/errors.js";
-import { formatSurveyDate } from "@/lib/date.js";
-import StagingDetail from "./StagingDetail";
 
 export default {
   data() {
@@ -89,11 +88,7 @@
       });
     }
   },
-  STATES: STATES,
   methods: {
-    formatSurveyDate(date) {
-      return formatSurveyDate(date);
-    },
     loadData() {
       this.$store.dispatch("imports/getStaging").catch(error => {
         const { status, data } = error.response;
@@ -143,40 +138,9 @@
             message: `${status}: ${data.message || data}`
           });
         });
-    },
-    needsApproval(item) {
-      return item.status === STATES.NEEDSAPPROVAL;
-    },
-    isRejected(item) {
-      return item.status === STATES.REJECTED;
-    },
-    isApproved(item) {
-      return item.status === STATES.APPROVED;
-    },
-    zoomTo(id) {
-      if (!id) return;
-      const soundingResult = this.filteredData.filter(x => x.id == id)[0];
-      const { lat, lon, bottleneck, date } = soundingResult.summary;
-      const coordinates = [lat, lon];
-
-      this.$store.commit("map/moveMap", {
-        coordinates: coordinates,
-        zoom: 17,
-        preventZoomOut: true
-      });
-      this.$store
-        .dispatch("bottlenecks/setSelectedBottleneck", bottleneck)
-        .then(() => {
-          this.$store.commit("bottlenecks/setSelectedSurveyByDate", date);
-        });
-    },
-    toggleApproval(id, newStatus) {
-      this.$store.commit("imports/toggleApproval", {
-        id: id,
-        newStatus: newStatus
-      });
     }
-  }
+  },
+  STATES: STATES
 };
 </script>