diff --git a/labswp_2019_sose_geocaching_frontend/frontend/package.json b/labswp_2019_sose_geocaching_frontend/frontend/package.json index 0657383..f262cce 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/package.json +++ b/labswp_2019_sose_geocaching_frontend/frontend/package.json @@ -19,7 +19,9 @@ "openlayers": "^4.6.5", "quasar": "^1.0.0-rc.2", "vue-qrcode-reader": "^1.4.2", - "vuelayers": "^0.11.4" + "vuelayers": "^0.11.4", + "lodash": "^4.17.11", + "ol": "^5.3.1" }, "devDependencies": { "@quasar/app": "^1.0.0-rc.4", diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/components/mapClickable.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/components/mapClickable.vue new file mode 100644 index 0000000..2e1f0a9 --- /dev/null +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/components/mapClickable.vue @@ -0,0 +1,337 @@ + + + + + diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue index 7c77c89..0242f20 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue @@ -60,9 +60,11 @@ -

Hinweis: Ein Cache muss mindestens aus zwei Stationen bestehen (inklusive der Endstation).

+

Hinweis: Ein Cache muss mindestens aus zwei Stationen bestehen (inklusive der Endstation). +

- +

Endstation

@@ -95,7 +97,7 @@
- +
@@ -123,7 +125,7 @@ }, created: function () { console.log("isNewCache: " + this.isNewCache); - console.log("Route Params: " + this.$route.params.id); + //console.log("Route Params: " + this.$route.params.id); if (!this.isNewCache && !this.$store.getters['cacheCollector/GET_LOCK']) { this.$axios.get('/api/allCaches') .then((response) => { @@ -163,6 +165,7 @@ const station = this.$store.getters['cacheCollector/GET_ENDSTATION']; console.log(station); this.$store.commit('cacheCollector/SET_TEMPSTATION', station); + this.$store.commit('cacheCollector/SET_LOCK', true); this.$router.push({path: `/tempendstation/`}); // add parameter }, @@ -187,75 +190,73 @@ let cache = JSON.parse(JSON.stringify(this.computedCache)); console.log(cache); cache.stationen.push(this.computedEndstation); - console.log("isnewcache "+this.isNewCache) + console.log("isnewcache " + this.isNewCache) //Error messages - if(!this.validateRankingPoints()){ + if (!this.validateRankingPoints()) { let title = "Falsche Formatierung"; let msg = "Die Ranglistenpunkte müssen eine ganze Zahl sein"; this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: msg, title: title,}); } - if(this.validateEverything()) { - if (this.isNewCache) { - console.log("CREATECACHE") - this.$axios.post('/api/createCache', cache) - .then((response) => { - console.log("POST api/createCache: " + response.statusText); - this.$store.commit('cacheCollector/RESET_NEW_CACHE'); - this.$router.push({path: '/overview'}); - }).catch((error) => { - let msg; - let title; - if (error.response) { - title = "Bitte Eingaben überprüfen!"; - msg = error.response.data; - } else if (error.request) { - title = "Verbindungsfehler!"; - msg = "Es konnte keine Verbindung zum Server aufgebaut werden. Versuchen Sie es später noch einmal!" - console.log(error.request); - } else { - title = "Error"; - msg = error.message; - console.log('Error', error.message); - } - console.log(error.config); - this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: msg, title: title,}); - }) - } else { - console.log("EDITCACHE") - this.$axios.put('/api/editCache', cache) - .then((response) => { - console.log("POST api/editCache: " + response.statusText); - this.$store.commit('cacheCollector/RESET_NEW_CACHE'); - this.$router.push({path: '/overview'}); - }).catch((error) => { - let msg; - let title; - if (error.response) { - title = "Bitte Eingaben überprüfen!"; - msg = error.response.data; - } else if (error.request) { - title = "Verbindungsfehler!"; - msg = "Es konnte keine Verbindung zum Server aufgebaut werden. Versuchen Sie es später noch einmal!" - console.log(error.request); - } else { - title = "Error"; - msg = error.message; - console.log('Error', error.message); - } - console.log(error.config); - this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: msg, title: title,}); - }) - } + if (this.isNewCache) { + console.log("CREATECACHE") + this.$axios.post('/api/createCache', cache) + .then((response) => { + console.log("POST api/createCache: " + response.statusText); + this.$store.commit('cacheCollector/RESET_NEW_CACHE'); + this.$router.push({path: '/overview'}); + }).catch((error) => { + let msg; + let title; + if (error.response) { + title = "Bitte Eingaben überprüfen!"; + msg = error.response.data; + } else if (error.request) { + title = "Verbindungsfehler!"; + msg = "Es konnte keine Verbindung zum Server aufgebaut werden. Versuchen Sie es später noch einmal!" + console.log(error.request); + } else { + title = "Error"; + msg = error.message; + console.log('Error', error.message); + } + console.log(error.config); + this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: msg, title: title,}); + }) + } else { + console.log("EDITCACHE") + this.$axios.put('/api/editCache', cache) + .then((response) => { + console.log("POST api/editCache: " + response.statusText); + this.$store.commit('cacheCollector/RESET_NEW_CACHE'); + this.$router.push({path: '/overview'}); + }).catch((error) => { + let msg; + let title; + if (error.response) { + title = "Bitte Eingaben überprüfen!"; + msg = error.response.data; + } else if (error.request) { + title = "Verbindungsfehler!"; + msg = "Es konnte keine Verbindung zum Server aufgebaut werden. Versuchen Sie es später noch einmal!" + console.log(error.request); + } else { + title = "Error"; + msg = error.message; + console.log('Error', error.message); + } + console.log(error.config); + this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: msg, title: title,}); + }) } }, validateRankingPoints: function () { - var re = new RegExp('^[0-9]+$'); - var rps = String(this.computedCache.rankingPoints); + let re = new RegExp('^[0-9]+$'); + let rps = String(this.computedCache.rankingPoints); return re.test(rps); }, - validateEverything(){ + validateEverything() { return this.validateRankingPoints(); } }, diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Register.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Register.vue index c4d9013..6489cfe 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Register.vue +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Register.vue @@ -7,7 +7,7 @@
-
@@ -15,7 +15,7 @@
-
@@ -23,7 +23,7 @@
-
@@ -32,7 +32,7 @@
-
@@ -41,7 +41,7 @@
-
@@ -97,7 +97,8 @@ }, methods: { validateEmail(email) { - var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + //var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + let re = new RegExp('^[a-zA-Z0-9.!#$%&\'*+/=?^_`{|}~-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$'); return re.test(String(email).toLowerCase()); }, register: function () { diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/StationEdit.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/StationEdit.vue index 1de5ced..51e0e0e 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/StationEdit.vue +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/StationEdit.vue @@ -1,46 +1,25 @@