# HG changeset patch # User Thomas Junk # Date 1545134263 -3600 # Node ID 9f5090fe130fa39dfbfec22ad3fa3bed092e76f3 # Parent f4b31cf5b65682546073ae35b49945c82ea619fb fix:reimported STATES in staging view diff -r f4b31cf5b656 -r 9f5090fe130f client/src/components/staging/Staging.vue --- 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 };