chore: remove obsolete teamer form from myep

This commit is contained in:
Björn Fromme
2024-11-11 18:14:56 +01:00
parent e3447310a3
commit dbb5c7f49f
@@ -2,7 +2,7 @@
<div>
<p class="text-2xl pb-4">Teamer</p>
<div class="p-4 mb-8 text-white bg-ep-primary">
Ab sofort nutzen wir zur Teameinteilung ein neues Tool. Den Zugang erhältst du hier: <a href="https://myep-team.ep-reisen.de/" target="_blank">https://myep-team.ep-reisen.de/</a>
Ab sofort nutzen wir zur Teameinteilung ein neues Tool. Den Zugang erhältst du hier: <a class="underline" href="https://myep-team.ep-reisen.de/" target="_blank">https://myep-team.ep-reisen.de/</a>
<br>
Du kannst dich mit deinen bisherigen Log-In Daten anmelden und schonmal ein wenig zurechtfinden.
<br>
@@ -10,189 +10,8 @@
<br>
Wir freuen uns, dich in der neuen Saison einteilen zu dürfen 😊
</div>
<form @submit.prevent="save()">
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div>
<h4 class="mb-2">Fährst du Ski oder Board?</h4>
<div class="flex flex-col space-y-1 pb-4">
<label class="flex items-center"
v-for="ability of abilities" :key="ability.id">
<input type="checkbox"
class="border-zinc-400 focus:border-zinc-800 ring-0 focus:ring-0 text-ep-secondary sbw:text-sbw-secondary"
v-model="userData.abilities"
:value="ability.id"/>
<span class="ml-2">{{ ability.title }}</span>
</label>
</div>
<h4 class="mb-2">Mögliche Jobprofile</h4>
<div class="flex flex-col space-y-1 pb-4">
<label class="flex items-center"
v-for="jobProfile of jobProfiles" :key="jobProfile.id">
<input type="checkbox"
class="border-zinc-400 focus:border-zinc-800 ring-0 focus:ring-0 text-ep-secondary sbw:text-sbw-secondary"
v-model="userData.jobProfiles"
:value="jobProfile.id"/>
<span class="ml-2">{{ jobProfile.title }}</span>
</label>
</div>
<h4 class="mb-2">Buszustiege</h4>
<div class="flex flex-col space-y-1 pb-4">
<label class="flex items-center"
v-for="pickup of pickups" :key="pickup.id">
<input type="checkbox"
class="border-zinc-400 focus:border-zinc-800 ring-0 focus:ring-0 text-ep-secondary sbw:text-sbw-secondary"
v-model="userData.pickups"
:value="pickup.id"/>
<span class="ml-2">{{ pickup.name }}</span>
</label>
</div>
<h4 class="mb-2">Sonstiges</h4>
<form-group label="Status">
<select id="status" v-model="userData.seniority" class="border-zinc-400 focus:border-zinc-800 ring-0 focus:ring-0 mt-1 w-full">
<option v-for="status in this.status" :value="status.value">{{ status.label }}</option>
</select>
</form-group>
<form-group label="Jackengröße">
<select v-model="userData.jacketSize" class="border-zinc-400 focus:border-zinc-800 ring-0 focus:ring-0 mt-1 w-full">
<option v-for="size of this.sizes" :value="size">{{ size }}</option>
</select>
</form-group>
<form-group label="Wünsche">
<textarea class="w-full" cols="30" rows="3" v-model="userData.notes"></textarea>
</form-group>
</div>
<div>
<h4 class="mb-2">Verfügbarkeiten</h4>
<div class="flex flex-col space-y-1 pb-4">
<label class="flex items-center"
v-for="timeFrame of timeFrames" :key="timeFrame.id">
<input type="checkbox"
class="border-zinc-400 focus:border-zinc-800 ring-0 focus:ring-0 text-ep-secondary sbw:text-sbw-secondary"
v-model="userData.availableTimeFrames"
:value="timeFrame.id"/>
<span class="ml-2">{{ timeFrame | period }}</span>
</label>
<label class="flex items-center">
<input type="checkbox"
class="border-zinc-400 focus:border-zinc-800 ring-0 focus:ring-0 text-ep-secondary sbw:text-sbw-secondary"
v-model="userData.monthLong"/>
<span class="ml-2">Ich habe Zeit und würde gerne über einen Monat am Stück in eine Destination.</span>
</label>
</div>
</div>
<div class="col-span-1 md:col-span2">
<button type="submit" class="button bg-button" :disabled="loading">
Speichern
</button>
</div>
</div>
</form>
</div>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import dayjs from 'dayjs'
import 'dayjs/locale/de'
import FormGroup from './components/FormGroup'
import { checkStatus, defaultOptions } from './api'
export default {
components: {
FormGroup
},
data () {
return {
sizes: [ 'S', 'M', 'L', 'XL', 'XXL' ],
status: [
{ value: 'jr', label: 'Neuteamer' },
{ value: 'sr', label: 'Bestandsteamer' }
],
abilities: [],
timeFrames: [],
jobProfiles: [],
pickups: [],
}
},
methods: {
...mapMutations(['beginLoading', 'endLoading', 'alert']),
save () {
const data = {
abilities: this.userData.abilities,
jobProfiles: this.userData.jobProfiles,
availableTimeFrames: this.userData.availableTimeFrames,
pickups: this.userData.pickups,
jacketSize: this.userData.jacketSize,
seniority: this.userData.seniority,
monthLong: this.userData.monthLong,
notes: this.userData.notes,
};
this.beginLoading();
const options = {
...defaultOptions,
method: 'PUT',
body: JSON.stringify(data)
}
return fetch(`${this.config.myEpApiBaseUrl}/api/teamer-data`, options)
.then(checkStatus)
.then(response => response.json())
.then(() => {
this.alert({
message: 'Die Änderungen wurden gespeichert',
success: true,
})
})
.catch(() => {
this.alert({
message: 'Es ist ein Fehler aufgetreten :(',
success: false,
})
})
.finally(() => {
this.endLoading()
this.$emit('loaded')
})
}
},
created () {
this.beginLoading();
const options = {
...defaultOptions
}
return fetch(`${this.config.myEpApiBaseUrl}/api/teamer-data`, options)
.then(checkStatus)
.then(response => response.json())
.then(data => {
this.abilities = data.abilities
this.timeFrames = data.timeFrames
this.jobProfiles = data.jobProfiles
this.pickups = data.pickups
})
.catch(() => {})
.finally(() => {
this.endLoading()
this.$emit('loaded')
})
},
computed: {
...mapState(['config', 'userData', 'loading'])
},
filters: {
period (timeFrame) {
const begin = dayjs(timeFrame.dateBegin);
const end = dayjs(timeFrame.dateEnd);
let label = begin.format('DD.MM.YYYY') + ' - ' + end.format('DD.MM.YYYY');
if (timeFrame.label) {
label += ' (' + timeFrame.label + ')'
}
return label
}
}
}
</script>