Merge branch 'develop' of https://bitbucket-student.it.hs-heilbronn.de/scm/labswp19/labswp_2019_sose_geocaching into develop
This commit is contained in:
commit
a4adca78c9
@ -4,7 +4,8 @@
|
|||||||
<div class="q-pa-md q-gutter-y-md">
|
<div class="q-pa-md q-gutter-y-md">
|
||||||
<p class="text-h5">{{ isNewCache ? "Neuen Cache erstellen" : "Cache bearbeiten"}}</p>
|
<p class="text-h5">{{ isNewCache ? "Neuen Cache erstellen" : "Cache bearbeiten"}}</p>
|
||||||
<q-input class="col" dense stack-label filled v-model="computedCache.name" label="Name" color="black"/>
|
<q-input class="col" dense stack-label filled v-model="computedCache.name" label="Name" color="black"/>
|
||||||
<q-input class="col" dense stack-label filled v-model="computedCache.rankingPoints" label="Punktewert" color="black"/>
|
<q-input class="col" dense stack-label filled v-model="computedCache.rankingPoints" label="Punktewert"
|
||||||
|
color="black"/>
|
||||||
<p class="text-h6">Beschreibung</p>
|
<p class="text-h6">Beschreibung</p>
|
||||||
<q-editor
|
<q-editor
|
||||||
:toolbar="[
|
:toolbar="[
|
||||||
@ -94,9 +95,30 @@
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-card>
|
</q-card>
|
||||||
<div class="row q-mt-xl">
|
<div v-show="validateInputBool" class="q-ma-none">
|
||||||
<q-btn @click="saveCache" class="full-width q-mb-md" color="primary" unelevated stack label="Cache speichern"
|
<q-separator v-show="validateInputBool" color="negative" class="q-mt-lg"/>
|
||||||
icon="save_alt"/>
|
<div v-if="(computedCache.name.length <= 2)">
|
||||||
|
• Name muss mindestens 3 Zeichen lang sein.
|
||||||
|
</div>
|
||||||
|
<div v-if="(computedCache.rankingPoints <= 0 || computedCache.rankingPoints > 9999 || computedCache.rankingPoints === NaN)">
|
||||||
|
• Punktewert des Caches muss 1-9999 betragen.
|
||||||
|
</div>
|
||||||
|
<div v-if="(computedCache.description.length <= 0)">
|
||||||
|
• Cachebeschreibung muss ausgefüllt sein und sollte sinnvollen Text enthalten.
|
||||||
|
</div>
|
||||||
|
<div v-if="(computedCache.reward.rewardDescription.length <= 0)">
|
||||||
|
• Cachebelohnung muss ausgefüllt sein und sollte einen netten Text enthalten.
|
||||||
|
</div>
|
||||||
|
<div v-if="(this.computedCache.stationen.length <= 0)">
|
||||||
|
• Es muss mindestens eine Station zum Cache hinzugefügt werden.
|
||||||
|
</div>
|
||||||
|
<q-separator v-show="validateInputBool" color="negative"/>
|
||||||
|
</div>
|
||||||
|
<div class="row q-mt-lg">
|
||||||
|
<q-btn @click="validateInput" class="full-width q-mb-md" color="primary" unelevated stack
|
||||||
|
label="Cache speichern"
|
||||||
|
icon="save_alt">
|
||||||
|
</q-btn>
|
||||||
<q-btn to="/overview" class="full-width" color="negative" unelevated stack label="Abbrechen"/>
|
<q-btn to="/overview" class="full-width" color="negative" unelevated stack label="Abbrechen"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -112,6 +134,9 @@
|
|||||||
return {
|
return {
|
||||||
scrolldown: false,
|
scrolldown: false,
|
||||||
isNewCache: this.$route.params.id === undefined,
|
isNewCache: this.$route.params.id === undefined,
|
||||||
|
showTooltip: false,
|
||||||
|
tooltipInfoText: "",
|
||||||
|
validateInputBool: false,
|
||||||
//tempCache: {},
|
//tempCache: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -258,7 +283,19 @@
|
|||||||
},
|
},
|
||||||
validateEverything() {
|
validateEverything() {
|
||||||
return this.validateRankingPoints();
|
return this.validateRankingPoints();
|
||||||
|
},
|
||||||
|
validateInput() {
|
||||||
|
if (this.computedCache.name.length > 2
|
||||||
|
&& (this.computedCache.rankingPoints > 0 && this.computedCache.rankingPoints <= 9999)
|
||||||
|
&& this.computedCache.description.length > 0
|
||||||
|
&& this.computedCache.reward.rewardDescription.length > 0
|
||||||
|
&& this.computedCache.stationen.length > 0) {
|
||||||
|
this.validateInputBool = false;
|
||||||
|
this.saveCache();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
this.validateInputBool = true;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
computedCache: {
|
computedCache: {
|
||||||
|
|||||||
@ -566,7 +566,7 @@
|
|||||||
const token = JSON.parse(localStorage.getItem('userToken')).token;
|
const token = JSON.parse(localStorage.getItem('userToken')).token;
|
||||||
newAdmin.roles.role = "ADMIN";
|
newAdmin.roles.role = "ADMIN";
|
||||||
JSON.stringify(newAdmin);
|
JSON.stringify(newAdmin);
|
||||||
this.$axios.patch(process.env.USER_API, '/account', newAdmin, {
|
this.$axios.patch(process.env.USER_API + '/account', newAdmin, {
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer ' + token,
|
'Authorization': 'Bearer ' + token,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user