Merge branch 'release/2022.08-03'
This commit is contained in:
Generated
+13
-13
@@ -8857,23 +8857,23 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "9.2.15",
|
||||
"version": "9.2.16",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f"
|
||||
"reference": "2593003befdcc10db5e213f9f28814f5aa8ac073"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f",
|
||||
"reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2593003befdcc10db5e213f9f28814f5aa8ac073",
|
||||
"reference": "2593003befdcc10db5e213f9f28814f5aa8ac073",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-dom": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"nikic/php-parser": "^4.13.0",
|
||||
"nikic/php-parser": "^4.14",
|
||||
"php": ">=7.3",
|
||||
"phpunit/php-file-iterator": "^3.0.3",
|
||||
"phpunit/php-text-template": "^2.0.2",
|
||||
@@ -8922,7 +8922,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15"
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.16"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -8930,7 +8930,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-03-07T09:28:20+00:00"
|
||||
"time": "2022-08-20T05:26:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
@@ -9175,16 +9175,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "9.5.21",
|
||||
"version": "9.5.22",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1"
|
||||
"reference": "e329ac6e8744f461518272612a479fde958752fe"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1",
|
||||
"reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e329ac6e8744f461518272612a479fde958752fe",
|
||||
"reference": "e329ac6e8744f461518272612a479fde958752fe",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -9261,7 +9261,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21"
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.22"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -9273,7 +9273,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-06-19T12:14:25+00:00"
|
||||
"time": "2022-08-20T08:25:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pimple/pimple",
|
||||
|
||||
Generated
-27
@@ -30,7 +30,6 @@
|
||||
"stimulus-use": "^0.25.4",
|
||||
"vue": "^2.6.14",
|
||||
"vue-router": "^3.5.2",
|
||||
"vue-scrollto": "^2.20.0",
|
||||
"vue-session": "^1.0.0",
|
||||
"vuex": "^3.6.2",
|
||||
"whatwg-fetch": "^3.6.2"
|
||||
@@ -2777,11 +2776,6 @@
|
||||
"integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/bezier-easing": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bezier-easing/-/bezier-easing-2.1.0.tgz",
|
||||
"integrity": "sha512-gbIqZ/eslnUFC1tjEvtz0sgx+xTK20wDnYMIA27VA04R7w6xxXQPZDbibjA9DTWZRA2CXtwHykkVzlCaAJAZig=="
|
||||
},
|
||||
"node_modules/big.js": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
|
||||
@@ -8206,14 +8200,6 @@
|
||||
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.4.tgz",
|
||||
"integrity": "sha512-x+/DLAJZv2mcQ7glH2oV9ze8uPwcI+H+GgTgTmb5I55bCgY3+vXWIsqbYUzbBSZnwFHEJku4eoaH/x98veyymQ=="
|
||||
},
|
||||
"node_modules/vue-scrollto": {
|
||||
"version": "2.20.0",
|
||||
"resolved": "https://registry.npmjs.org/vue-scrollto/-/vue-scrollto-2.20.0.tgz",
|
||||
"integrity": "sha512-7i+AGKJTThZnMEkhIPgrZjyAX+fXV7/rGdg+CV283uZZwCxwiMXaBLTmIc5RTA4uwGnT+E6eJle3mXQfM2OD3A==",
|
||||
"dependencies": {
|
||||
"bezier-easing": "2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-session": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vue-session/-/vue-session-1.0.0.tgz",
|
||||
@@ -10808,11 +10794,6 @@
|
||||
"integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==",
|
||||
"dev": true
|
||||
},
|
||||
"bezier-easing": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bezier-easing/-/bezier-easing-2.1.0.tgz",
|
||||
"integrity": "sha512-gbIqZ/eslnUFC1tjEvtz0sgx+xTK20wDnYMIA27VA04R7w6xxXQPZDbibjA9DTWZRA2CXtwHykkVzlCaAJAZig=="
|
||||
},
|
||||
"big.js": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
|
||||
@@ -14754,14 +14735,6 @@
|
||||
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.4.tgz",
|
||||
"integrity": "sha512-x+/DLAJZv2mcQ7glH2oV9ze8uPwcI+H+GgTgTmb5I55bCgY3+vXWIsqbYUzbBSZnwFHEJku4eoaH/x98veyymQ=="
|
||||
},
|
||||
"vue-scrollto": {
|
||||
"version": "2.20.0",
|
||||
"resolved": "https://registry.npmjs.org/vue-scrollto/-/vue-scrollto-2.20.0.tgz",
|
||||
"integrity": "sha512-7i+AGKJTThZnMEkhIPgrZjyAX+fXV7/rGdg+CV283uZZwCxwiMXaBLTmIc5RTA4uwGnT+E6eJle3mXQfM2OD3A==",
|
||||
"requires": {
|
||||
"bezier-easing": "2.1.0"
|
||||
}
|
||||
},
|
||||
"vue-session": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vue-session/-/vue-session-1.0.0.tgz",
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
"stimulus-use": "^0.25.4",
|
||||
"vue": "^2.6.14",
|
||||
"vue-router": "^3.5.2",
|
||||
"vue-scrollto": "^2.20.0",
|
||||
"vue-session": "^1.0.0",
|
||||
"vuex": "^3.6.2",
|
||||
"whatwg-fetch": "^3.6.2"
|
||||
|
||||
@@ -83,7 +83,7 @@ class ConceptController extends ActionController
|
||||
$excludedConceptUids = GeneralUtility::trimExplode(',', $this->settings['excludedConceptUids'], true);
|
||||
$limit = $this->settings['showMoreLink'] ? 4 : 0;
|
||||
$teasers = $this->productDataService->getTeasergroup($filterSettings, $excludedConceptUids, $limit);
|
||||
$pages = $this->pageRepository->findPagesByPid($this->settings['conceptsPageUid']);
|
||||
$pages = $this->pageRepository->findPagesByPid((int)$this->settings['conceptsPageUid']);
|
||||
$data = $this->configurationManager->getContentObject()->data;
|
||||
|
||||
$this->view->assignMultiple([
|
||||
|
||||
@@ -69,14 +69,14 @@ class BackendController extends ActionController
|
||||
|
||||
public function initializeAction()
|
||||
{
|
||||
$this->pageUid = (integer)GeneralUtility::_GET('id');
|
||||
$this->pageUid = (int)GeneralUtility::_GET('id');
|
||||
|
||||
parent::initializeAction();
|
||||
}
|
||||
|
||||
public function listPagesAction()
|
||||
{
|
||||
$pages = $this->pageRepository->findPagesByPid($this->pageUid);
|
||||
$pages = $this->pageRepository->findPagesByPid($this->pageUid, true);
|
||||
|
||||
$this->view->assign('pages', $pages);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace EP\EpTheme\Domain\Repository;
|
||||
|
||||
use TYPO3\CMS\Core\Domain\Repository\PageRepository as CorePageRepository;
|
||||
use TYPO3\CMS\Extbase\Persistence\Repository;
|
||||
|
||||
class PageRepository extends Repository
|
||||
@@ -13,23 +14,19 @@ class PageRepository extends Repository
|
||||
'sorting' => 'ASC',
|
||||
];
|
||||
|
||||
/**
|
||||
* @param int $pid
|
||||
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||
*/
|
||||
public function findPagesByPid($pid)
|
||||
public function findPagesByPid(int $pid, bool $includeDisabled = false)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query
|
||||
->getQuerySettings()
|
||||
->setRespectStoragePage(false)
|
||||
->setIgnoreEnableFields(true)
|
||||
->setIgnoreEnableFields($includeDisabled)
|
||||
->setIncludeDeleted(false)
|
||||
->setRespectSysLanguage(false)
|
||||
;
|
||||
$query->matching($query->logicalAnd([
|
||||
$query->equals('pid', $pid),
|
||||
$query->equals('doktype', \TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_DEFAULT)
|
||||
$query->equals('doktype', CorePageRepository::DOKTYPE_DEFAULT)
|
||||
]));
|
||||
|
||||
return $query->execute();
|
||||
|
||||
@@ -62,13 +62,12 @@
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import axios from 'axios'
|
||||
import { mapState, mapMutations, mapActions } from 'vuex'
|
||||
import flatpickr from 'flatpickr'
|
||||
import { German } from 'flatpickr/dist/l10n/de'
|
||||
import FormGroup from './components/FormGroup'
|
||||
|
||||
export default {
|
||||
export default {
|
||||
components: {
|
||||
FormGroup
|
||||
},
|
||||
@@ -76,15 +75,18 @@
|
||||
return {
|
||||
picker: null,
|
||||
formErrors: {},
|
||||
countries: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadFormOptions();
|
||||
this.$store.dispatch('loadAddress')
|
||||
this.loadAddress()
|
||||
.then(() => {
|
||||
this.picker.setDate(new Date(this.userData.dateOfBirth), true);
|
||||
});
|
||||
this.$emit('loaded')
|
||||
})
|
||||
.catch(() => {
|
||||
this.logout()
|
||||
this.$router.push({name: 'login'})
|
||||
})
|
||||
},
|
||||
mounted () {
|
||||
Vue.nextTick(() => {
|
||||
@@ -99,37 +101,32 @@
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['alert', 'beginLoading', 'endLoading']),
|
||||
loadFormOptions () {
|
||||
this.beginLoading();
|
||||
return axios({
|
||||
url: '/api/countries'
|
||||
}).then(response => {
|
||||
this.countries = response.data
|
||||
}).catch(error => {
|
||||
}).finally(() => {
|
||||
this.endLoading()
|
||||
});
|
||||
},
|
||||
...mapMutations(['logout', 'alert']),
|
||||
...mapActions(['loadAddress', 'saveAddress']),
|
||||
save () {
|
||||
this.formErrors = {};
|
||||
this.$store.dispatch('saveAddress', this.userData)
|
||||
this.formErrors = {}
|
||||
this.saveAddress(this.userData)
|
||||
.then(() => {
|
||||
this.$emit('loaded')
|
||||
})
|
||||
.catch(error => {
|
||||
this.alert({
|
||||
message: 'Bitte überprüfe deine Eingaben.',
|
||||
success: false,
|
||||
});
|
||||
const violations = error.response.data.violations;
|
||||
if (typeof violations !== 'undefined') {
|
||||
for (let violation of violations) {
|
||||
this.$set(this.formErrors, violation.property_path, violation.message);
|
||||
})
|
||||
error.response.then(data => {
|
||||
const violations = data.violations
|
||||
if (typeof violations !== 'undefined') {
|
||||
for (let violation of violations) {
|
||||
this.$set(this.formErrors, violation.property_path, violation.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['loading', 'userData'])
|
||||
...mapState(['loading', 'userData', 'countries'])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<div id="myep" class="relative mb-16">
|
||||
<nav class="w-full bg-zinc-50 flex items-center justify-between mb-8 relative" v-if="isLoggedIn">
|
||||
<span class="block text-2xl px-4">My E&P</span>
|
||||
<div class="absolute z-50 top-100 left-0 w-full bg-zinc-50 shadow lg:relative lg:top-auto lg:left-auto lg:w-auto lg:shadow-none lg:flex lg:space-x-4"
|
||||
<div class="relative mb-16">
|
||||
<a ref="container" class="block w-0 h-0 pt-24 -mt-24"></a>
|
||||
<nav class="w-full bg-zinc-50 flex items-center mb-8 relative" v-if="isLoggedIn">
|
||||
<div class="flex-1 block text-2xl px-4">My E&P</div>
|
||||
<div class="bg-zinc-50 shadow w-full lg:w-auto absolute lg:relative z-10 lg:z-auto top-full lg:top-auto bg-white left-0 lg:relative lg:shadow-none lg:flex lg:space-x-4"
|
||||
:class="{ 'hidden': !navVisible }">
|
||||
<div class="lg:flex lg:items-center m-0">
|
||||
<router-link @click.native="navVisible = false" :to="{ name: 'address' }" class="block p-4 text-black hover:bg-zinc-400 hover:text-zinc-800" active-class="bg-zinc-400 text-zinc-800">Adressdaten</router-link>
|
||||
@@ -11,7 +12,7 @@
|
||||
<router-link @click.native="navVisible = false" :to="{ name: 'events' }" class="block p-4 text-black hover:bg-zinc-400 hover:text-zinc-800" active-class="bg-zinc-400 text-zinc-800">Buchungen</router-link>
|
||||
<router-link @click.native="navVisible = false" :to="{ name: 'teamer' }" class="block p-4 text-black hover:bg-zinc-400 hover:text-zinc-800" active-class="bg-zinc-400 text-zinc-800" v-if="isTeamer">Teamer</router-link>
|
||||
</div>
|
||||
<a class="block px-4 py-4 text-black hover:bg-zinc-400 hover:text-zinc-800" href="#" @click.prevent="logout()">Logout</a>
|
||||
<a class="block px-4 py-4 text-black hover:bg-zinc-400 hover:text-zinc-800" href="#" @click.prevent="performLogout()">Logout</a>
|
||||
</div>
|
||||
<a href="#" class="lg:hidden p-4 text-black hover:text-zinc-800" :class="{ 'rotate-90': navVisible }" @click.prevent="navVisible = !navVisible">
|
||||
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>
|
||||
@@ -19,7 +20,7 @@
|
||||
</nav>
|
||||
<div class="p-4 mb-8 text-white" :class="{'bg-emerald-600': alert.success, 'bg-red-600': !alert.success}" v-if="alert.message" v-html="alert.message"></div>
|
||||
<div class="relative">
|
||||
<router-view></router-view>
|
||||
<router-view @loaded="scrollTop()"></router-view>
|
||||
<div class="absolute top-0 left-0 inset-0 bg-overlay-white" v-show="loading">
|
||||
<div class="absolute top-1/2 left-1/2 transform -translate-xy-1/2 flex items-center space-x-2 h-8">
|
||||
<img :src="config.loaderUrl" alt="" class="block w-4 h-4">
|
||||
@@ -31,7 +32,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import { mapGetters, mapState, mapActions, mapMutations } from 'vuex'
|
||||
import store from './store'
|
||||
import router from './router'
|
||||
|
||||
@@ -39,12 +40,23 @@
|
||||
store,
|
||||
router,
|
||||
methods: {
|
||||
logout () {
|
||||
this.$store.dispatch('logout')
|
||||
performLogout () {
|
||||
this.logout()
|
||||
.then(() => {
|
||||
this.$router.replace({ name: 'login' })
|
||||
}).catch(error => {});
|
||||
}
|
||||
},
|
||||
scrollTop() {
|
||||
this.$refs.container.scrollIntoView({behavior: 'smooth', block: 'start'})
|
||||
},
|
||||
...mapMutations([
|
||||
'initConfig',
|
||||
]),
|
||||
...mapActions([
|
||||
'checkLoginState',
|
||||
'loadCountries',
|
||||
'logout',
|
||||
]),
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -56,11 +68,16 @@
|
||||
...mapGetters(['isLoggedIn', 'isTeamer'])
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('init').then(() => {
|
||||
if (this.isLoggedIn) {
|
||||
this.$router.replace({ name: 'address' })
|
||||
}
|
||||
})
|
||||
this.initConfig()
|
||||
this.checkLoginState()
|
||||
.then(() => {
|
||||
if (this.isLoggedIn) {
|
||||
this.loadCountries()
|
||||
.then(() => {
|
||||
this.$router.replace({ name: 'address' })
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -158,7 +158,6 @@
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import VueScrollTo from 'vue-scrollto'
|
||||
import AccommodationSelect from './components/AccommodationSelect'
|
||||
import ContingentsOverview from './components/ContingentsOverview'
|
||||
import MutableFields from './components/MutableFields'
|
||||
@@ -171,10 +170,8 @@
|
||||
import ServiceSelect from './components/ServiceSelect'
|
||||
import ServicesOverview from './components/ServicesOverview'
|
||||
import TransportationSelect from './components/TransportationSelect'
|
||||
import axios from 'axios'
|
||||
import {mapGetters, mapMutations, mapState} from 'vuex'
|
||||
|
||||
Vue.use(VueScrollTo)
|
||||
import { mapGetters, mapMutations, mapState } from 'vuex'
|
||||
import { checkStatus, defaultOptions } from './api'
|
||||
|
||||
export default {
|
||||
name: 'BookingEdit',
|
||||
@@ -222,78 +219,95 @@
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['alert', 'beginLoading', 'endLoading']),
|
||||
loadFormOptions () {
|
||||
this.beginLoading();
|
||||
return axios({
|
||||
url: '/api/countries',
|
||||
}).then(response => {
|
||||
this.countries = response.data
|
||||
}).catch(error => {
|
||||
}).finally(() => {
|
||||
this.endLoading()
|
||||
});
|
||||
},
|
||||
loadBookingData () {
|
||||
this.beginLoading('Lade Reise- und Buchungsdaten...')
|
||||
return axios({
|
||||
url: `/api/booking/${this.bookingId}`
|
||||
}).then(response => {
|
||||
this.bookingData = response.data.bookingData;
|
||||
this.participantData = response.data.participantData;
|
||||
this.travelData = response.data.travelData;
|
||||
}).catch(() => {
|
||||
throw new Error('Reise- und Buchungsdaten konnten nicht geladen werden.');
|
||||
}).finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
return fetch(`${this.config.myEpApiBaseUrl}/api/booking/${this.bookingId}`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
this.bookingData = data.bookingData
|
||||
this.participantData = data.participantData
|
||||
this.travelData = data.travelData
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
},
|
||||
loadEventData () {
|
||||
this.beginLoading('Lade Vorgangsdaten...')
|
||||
return axios({
|
||||
url: `/api/event/${this.bookingData.bookingNumber}`
|
||||
}).then(response => {
|
||||
this.eventData = response.data;
|
||||
}).catch(error => {
|
||||
throw new Error(error.response.data.message);
|
||||
}).finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
return fetch(`${this.config.myEpApiBaseUrl}/api/event/${this.bookingData.bookingNumber}`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
this.eventData = data
|
||||
})
|
||||
.catch(error => {
|
||||
throw new Error(error.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
},
|
||||
loadMutableFields () {
|
||||
this.beginLoading('Lade mögliche Änderungen...')
|
||||
return axios({
|
||||
url: `/api/mutable-fields/${this.travelData.busproId}`
|
||||
}).then(response => {
|
||||
this.mutableFields = response.data;
|
||||
}).catch(() => {
|
||||
throw new Error('Mögliche Änderungen konnten nicht geladen werden.');
|
||||
}).finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
return fetch(`${this.config.myEpApiBaseUrl}/api/mutable-fields/${this.travelData.busproId}`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
this.mutableFields = data
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error('Mögliche Änderungen konnten nicht geladen werden.');
|
||||
})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
},
|
||||
loadContingents () {
|
||||
this.beginLoading('Lade Kontingente...')
|
||||
return axios({
|
||||
url: `/api/contingents/${this.travelData.busproId}`
|
||||
}).then(response => {
|
||||
this.contingents = response.data;
|
||||
}).catch(() => {
|
||||
throw new Error('Kontingente konnten nicht geladen werden.');
|
||||
}).finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
return fetch(`${this.config.myEpApiBaseUrl}/api/contingents/${this.travelData.busproId}`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
this.contingents = data
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error('Kontingente konnten nicht geladen werden.');
|
||||
})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
},
|
||||
loadServices () {
|
||||
this.beginLoading('Lade Leistungen...')
|
||||
return axios({
|
||||
url: `/api/services/${this.travelData.busproId}`
|
||||
}).then(response => {
|
||||
this.services = response.data;
|
||||
}).catch(() => {
|
||||
throw new Error('Leistungen konnten nicht geladen werden.');
|
||||
}).finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
return fetch(`${this.config.myEpApiBaseUrl}/api/services/${this.travelData.busproId}`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
this.services = data
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error('Leistungen konnten nicht geladen werden.');
|
||||
})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
},
|
||||
getAccommodationLabel (participant) {
|
||||
if (participant.hasOwnProperty('accommodationId') && participant.accommodationId in this.contingents) {
|
||||
@@ -413,7 +427,6 @@
|
||||
return messages
|
||||
},
|
||||
storeBookingData() {
|
||||
this.$scrollTo('#myep')
|
||||
let messages = this.validateInput();
|
||||
if (false === this.dataValid) {
|
||||
this.alert({
|
||||
@@ -423,32 +436,41 @@
|
||||
return;
|
||||
}
|
||||
this.beginLoading()
|
||||
axios({
|
||||
url: `/api/booking/${this.bookingId}`,
|
||||
method: 'put',
|
||||
data: {
|
||||
const options = {
|
||||
...defaultOptions,
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({
|
||||
participantData: this.participantData,
|
||||
selectedTransportations: this.selectedTransportations,
|
||||
remarks: this.bookingData.remarks,
|
||||
},
|
||||
}).then(response => {
|
||||
this.alert({
|
||||
message: response.data.message,
|
||||
success: true,
|
||||
});
|
||||
this.dirty = false;
|
||||
}).catch(error => {
|
||||
this.alert({
|
||||
message: error.response.data.message,
|
||||
success: false,
|
||||
})
|
||||
}).finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
}
|
||||
fetch(`${this.config.myEpApiBaseUrl}/api/booking/${this.bookingId}`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
this.alert({
|
||||
message: data.message,
|
||||
success: true,
|
||||
})
|
||||
this.dirty = false
|
||||
})
|
||||
.catch(error => {
|
||||
error.response.then(data => {
|
||||
this.alert({
|
||||
message: data.message,
|
||||
success: false,
|
||||
})
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
this.$emit('loaded')
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['loading']),
|
||||
...mapState(['config', 'loading']),
|
||||
...mapGetters(['isGroupManager']),
|
||||
availableContingents () {
|
||||
let filteredContingents = {};
|
||||
@@ -500,14 +522,14 @@
|
||||
},
|
||||
mounted () {
|
||||
this.bookingId = this.$route.params.id
|
||||
this.loadFormOptions()
|
||||
.then(() => this.loadBookingData())
|
||||
this.loadBookingData()
|
||||
.then(() => this.loadEventData())
|
||||
.then(() => this.loadMutableFields())
|
||||
.then(() => this.loadContingents())
|
||||
.then(() => this.loadServices())
|
||||
.then(() => {
|
||||
this.initialized = true;
|
||||
this.$emit('loaded')
|
||||
})
|
||||
.catch(error => {
|
||||
this.alert({
|
||||
@@ -515,9 +537,6 @@
|
||||
success: false,
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import axios from 'axios'
|
||||
import { defaultOptions, checkStatus } from './api'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
@@ -62,43 +62,59 @@
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.beginLoading();
|
||||
this.beginLoading()
|
||||
|
||||
return axios({
|
||||
url: '/api/crm-selections'
|
||||
}).then(response => {
|
||||
this.crmData = response.data
|
||||
}).catch(error => {
|
||||
this.alert({
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
success: false,
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
|
||||
return fetch(`${this.config.myEpApiBaseUrl}/api/crm-selections`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
this.crmData = data
|
||||
})
|
||||
.catch(() => {
|
||||
this.alert({
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
success: false,
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
this.$emit('loaded')
|
||||
})
|
||||
}).finally(() => {
|
||||
this.endLoading()
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['beginLoading', 'endLoading', 'alert']),
|
||||
save () {
|
||||
this.beginLoading();
|
||||
this.beginLoading()
|
||||
|
||||
return axios({
|
||||
url: '/api/crm-selections',
|
||||
method: 'put',
|
||||
data: this.crmData
|
||||
}).then(() => {
|
||||
this.alert({
|
||||
message: 'Die Änderungen wurden gespeichert',
|
||||
success: true,
|
||||
});
|
||||
}).catch(error => {
|
||||
this.alert({
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
success: false,
|
||||
});
|
||||
}).finally(() => {
|
||||
this.endLoading();
|
||||
});
|
||||
const options = {
|
||||
...defaultOptions,
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(this.crmData)
|
||||
}
|
||||
|
||||
return fetch(`${this.config.myEpApiBaseUrl}/api/crm-selections`, 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')
|
||||
})
|
||||
},
|
||||
hasVisibleSelections (group) {
|
||||
if (this.hiddenSelectionGroups.indexOf(group.id) !== -1) {
|
||||
@@ -116,7 +132,7 @@
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['loading'])
|
||||
...mapState(['config', 'loading'])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -75,10 +75,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState, mapMutations, mapGetters} from 'vuex'
|
||||
import axios from 'axios'
|
||||
import { mapState, mapMutations, mapGetters } from 'vuex'
|
||||
import dayjs from 'dayjs'
|
||||
import 'dayjs/locale/de'
|
||||
import { checkStatus, defaultOptions } from './api'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
@@ -96,18 +96,26 @@ import {mapState, mapMutations, mapGetters} from 'vuex'
|
||||
created () {
|
||||
this.beginLoading();
|
||||
|
||||
return axios({
|
||||
url: '/api/events'
|
||||
}).then(response => {
|
||||
this.events = response.data;
|
||||
}).catch(error => {
|
||||
this.alert({
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
success: false,
|
||||
});
|
||||
}).finally(() => {
|
||||
this.endLoading();
|
||||
});
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
|
||||
return fetch(`${this.config.myEpApiBaseUrl}/api/events`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
this.events = data
|
||||
})
|
||||
.catch(() => {
|
||||
this.alert({
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
success: false,
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
this.$emit('loaded')
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['beginLoading', 'endLoading', 'alert']),
|
||||
@@ -118,11 +126,7 @@ import {mapState, mapMutations, mapGetters} from 'vuex'
|
||||
return dayjs(date).format('DD.MM.YY')
|
||||
},
|
||||
getDownloadUrl (event, type) {
|
||||
return this.config.myEpApiBaseUrl
|
||||
+ '/api/events/'
|
||||
+ event.id
|
||||
+ '/' + type + '?token='
|
||||
+ sessionStorage.getItem('myep-auth-token');
|
||||
return `${this.config.myEpApiBaseUrl}/api/events/${event.id}/${type}`
|
||||
},
|
||||
calculateBalance (event) {
|
||||
if (!event.price) {
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters, mapMutations } from 'vuex'
|
||||
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
|
||||
import FormGroup from './components/FormGroup'
|
||||
|
||||
export default {
|
||||
@@ -66,6 +66,7 @@
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['alert']),
|
||||
...mapActions(['login', 'resetPassword', 'loadCountries']),
|
||||
toggleMode () {
|
||||
this.mode = this.mode === 'login' ? 'reset' : 'login';
|
||||
this.password = ''
|
||||
@@ -73,12 +74,12 @@
|
||||
submit () {
|
||||
this.message = '';
|
||||
if (this.mode === 'login') {
|
||||
this.login()
|
||||
this.performLogin()
|
||||
} else {
|
||||
this.resetPassword()
|
||||
this.performPasswordReset()
|
||||
}
|
||||
},
|
||||
login () {
|
||||
performLogin () {
|
||||
this.formErrors = {};
|
||||
if (!this.email || !this.password) {
|
||||
this.alert({
|
||||
@@ -87,15 +88,21 @@
|
||||
});
|
||||
return
|
||||
}
|
||||
this.$store.dispatch('login', {
|
||||
this.login({
|
||||
email: this.email,
|
||||
password: this.password
|
||||
}).then(() => {
|
||||
this.$router.push({ name: 'address' });
|
||||
this.loadCountries()
|
||||
.then(() => {
|
||||
this.$router.push({ name: 'address' })
|
||||
})
|
||||
}).catch(error => {
|
||||
});
|
||||
}).finally(() => {
|
||||
this.email = ''
|
||||
this.password = ''
|
||||
})
|
||||
},
|
||||
resetPassword () {
|
||||
performPasswordReset () {
|
||||
this.formErrors = {};
|
||||
if (!this.email) {
|
||||
this.alert({
|
||||
@@ -104,9 +111,8 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$store.dispatch('resetPassword',
|
||||
this.email
|
||||
).then(response => {
|
||||
this.resetPassword(this.email)
|
||||
.then(response => {
|
||||
this.email = '';
|
||||
if (response.data.success) {
|
||||
this.alert({
|
||||
@@ -130,7 +136,9 @@
|
||||
this.$set(this.formErrors, violation.property_path, violation.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}).finally(() => {
|
||||
this.$emit('loaded')
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import axios from 'axios'
|
||||
import { checkStatus, defaultOptions } from './api'
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
@@ -28,33 +28,44 @@
|
||||
|
||||
this.beginLoading();
|
||||
|
||||
return axios({
|
||||
url: '/api/newsletter',
|
||||
method: 'put',
|
||||
data
|
||||
}).then(() => {
|
||||
this.alert({
|
||||
message: 'Die Änderungen wurden gespeichert',
|
||||
success: true,
|
||||
});
|
||||
}).catch(error => {
|
||||
this.alert({
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
success: false,
|
||||
});
|
||||
}).finally(() => {
|
||||
this.endLoading();
|
||||
});
|
||||
const options = {
|
||||
...defaultOptions,
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(data)
|
||||
}
|
||||
|
||||
return fetch(`${this.config.myEpApiBaseUrl}/api/newsletter`, 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')
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['loading', 'userData']),
|
||||
...mapState(['config', 'loading', 'userData']),
|
||||
statusMessage () {
|
||||
let message = 'Du bist aktuell';
|
||||
message += this.userData.newsletter ? ' ' : ' <strong>nicht</strong> ';
|
||||
message += 'zum Newsletter angemeldet.';
|
||||
return message;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$emit('loaded')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,81 +1,77 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Teamer</h1>
|
||||
<p class="text-2xl pb-4">Teamer</p>
|
||||
<form @submit.prevent="save()">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<h4>Fährst du Ski oder Board?</h4>
|
||||
<div class="form-group">
|
||||
<div class="checkbox" v-for="ability of abilities">
|
||||
<label>
|
||||
<input type="checkbox" class="form-control" v-model="userData.abilities"
|
||||
:value="ability.id" />
|
||||
<span class="cr"><i class="cr-icon glyphicon glyphicon-ok"></i></span>
|
||||
{{ ability['title'] }}
|
||||
</label>
|
||||
</div>
|
||||
<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>Mögliche Jobprofile</h4>
|
||||
<div class="form-group">
|
||||
<div class="checkbox" v-for="jobProfile of jobProfiles">
|
||||
<label>
|
||||
<input type="checkbox" class="form-control" v-model="userData.jobProfiles"
|
||||
:value="jobProfile.id" />
|
||||
<span class="cr"><i class="cr-icon glyphicon glyphicon-ok"></i></span>
|
||||
{{ jobProfile['title'] }}
|
||||
</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>Sonstiges</h4>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" class="form-control" v-model="userData.wantsToLead"/>
|
||||
<span class="cr"><i class="cr-icon glyphicon glyphicon-ok"></i></span>
|
||||
Ich möchte eine Fahrtenleitung übernehmen.
|
||||
</label>
|
||||
</div>
|
||||
<h4 class="mb-2">Sonstiges</h4>
|
||||
<div class="flex flex-col space-y-1 pb-4">
|
||||
<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.wantsToLead"/>
|
||||
<span class="ml-2">Ich möchte eine Fahrtenleitung übernehmen</span>
|
||||
</label>
|
||||
</div>
|
||||
<form-group label="Status">
|
||||
<select id="status" v-model="userData.seniority" class="form-control">
|
||||
<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="form-control">
|
||||
<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="xxlarge form-control" cols="30" rows="3" v-model="userData.notes"></textarea>
|
||||
<textarea class="w-full" cols="30" rows="3" v-model="userData.notes"></textarea>
|
||||
</form-group>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<h4>Verfügbarkeiten</h4>
|
||||
<div class="checkbox" v-for="timeFrame in timeFrames">
|
||||
<label>
|
||||
<input type="checkbox" class="form-control" v-model="userData.availableTimeFrames"
|
||||
<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="cr"><i class="cr-icon glyphicon glyphicon-ok"></i></span>
|
||||
{{ timeFrame | period }}
|
||||
<span class="ml-2">{{ timeFrame | period }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" class="form-control" v-model="userData.monthLong"/>
|
||||
<span class="cr"><i class="cr-icon glyphicon glyphicon-ok"></i></span>
|
||||
Ich habe Zeit und würde gerne über einen Monat am Stück in eine Destination.
|
||||
<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>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<button type="submit" class="button bg-button" :disabled="loading">
|
||||
Speichern
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-span-1 md:col-span2">
|
||||
<button type="submit" class="button bg-button" :disabled="loading">
|
||||
Speichern
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -84,10 +80,10 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import axios from 'axios'
|
||||
import dayjs from 'dayjs'
|
||||
import 'dayjs/locale/de'
|
||||
import FormGroup from './components/FormGroup'
|
||||
import { checkStatus, defaultOptions } from './api'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -121,42 +117,57 @@
|
||||
|
||||
this.beginLoading();
|
||||
|
||||
return axios({
|
||||
url: '/api/teamer-data',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
.then(() => {
|
||||
this.alert({
|
||||
message: 'Die Änderungen wurden gespeichert',
|
||||
success: true,
|
||||
});
|
||||
}).catch(error => {
|
||||
this.alert({
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
success: false,
|
||||
});
|
||||
}).finally(() => {
|
||||
this.endLoading();
|
||||
});
|
||||
|
||||
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();
|
||||
|
||||
return axios({
|
||||
url: '/api/teamer-data'
|
||||
}).then(response => {
|
||||
this.abilities = response.data.abilities;
|
||||
this.timeFrames = response.data.timeFrames;
|
||||
this.jobProfiles = response.data.jobProfiles;
|
||||
}).catch(error => {
|
||||
}).finally(() => {
|
||||
this.endLoading();
|
||||
});
|
||||
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
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
this.endLoading()
|
||||
this.$emit('loaded')
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userData', 'loading'])
|
||||
...mapState(['config', 'userData', 'loading'])
|
||||
},
|
||||
filters: {
|
||||
period (timeFrame) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
const defaultOptions = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
credentials: 'include',
|
||||
}
|
||||
|
||||
function checkStatus(response) {
|
||||
if (response.ok) {
|
||||
return response
|
||||
} else {
|
||||
const error = new Error(response.status)
|
||||
error.response = response.json()
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
function handleError() {
|
||||
commit('alert', {
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
success: false,
|
||||
})
|
||||
throw error
|
||||
}
|
||||
|
||||
export { checkStatus, handleError, defaultOptions }
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
{{ label }}:
|
||||
</label>
|
||||
<slot></slot>
|
||||
<span class="block text-sm mt-1" v-show="error">
|
||||
<span class="block text-sm mt-1 text-red-500" v-show="error">
|
||||
{{ error }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import axios from 'axios'
|
||||
import { checkStatus, handleError, defaultOptions } from '../api'
|
||||
|
||||
const configElement = document.getElementById('appconfig')
|
||||
const config = JSON.parse(configElement.innerHTML)
|
||||
|
||||
axios.defaults.baseURL = config.myEpApiBaseUrl
|
||||
axios.defaults.withCredentials = true
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
const defaultUserData = {
|
||||
@@ -33,6 +30,7 @@ export default new Vuex.Store({
|
||||
statusMessage: '',
|
||||
authenticated: false,
|
||||
userData: defaultUserData,
|
||||
countries: [],
|
||||
alert: {
|
||||
message: '',
|
||||
success: true,
|
||||
@@ -72,125 +70,168 @@ export default new Vuex.Store({
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
init({commit}) {
|
||||
commit('initConfig');
|
||||
commit('beginLoading');
|
||||
checkLoginState({commit, state}) {
|
||||
commit('beginLoading')
|
||||
|
||||
return axios({
|
||||
url: '/api/ping',
|
||||
method: 'get',
|
||||
}).then(response => {
|
||||
commit('login')
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
commit('endLoading');
|
||||
})
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
|
||||
return fetch(`${state.config.myEpApiBaseUrl}/api/ping`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(() => {
|
||||
commit('login')
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
commit('endLoading')
|
||||
})
|
||||
},
|
||||
loadCountries({commit, state}) {
|
||||
commit('beginLoading')
|
||||
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
|
||||
return fetch(`${state.config.myEpApiBaseUrl}/api/countries`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
commit('setCountries', data)
|
||||
})
|
||||
.catch(handleError)
|
||||
.finally(() => {
|
||||
commit('endLoading')
|
||||
})
|
||||
},
|
||||
login({commit}, credentials) {
|
||||
commit('beginLoading');
|
||||
commit('beginLoading')
|
||||
|
||||
return axios({
|
||||
url: '/api/login',
|
||||
method: 'post',
|
||||
data: {
|
||||
const options = {
|
||||
...defaultOptions,
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
username: credentials.email,
|
||||
password: credentials.password
|
||||
},
|
||||
}).then(response => {
|
||||
commit('login', response.data);
|
||||
}).catch(error => {
|
||||
commit('logout');
|
||||
commit('alert', {
|
||||
message: 'Der Login ist fehlgeschlagen :(',
|
||||
success: false,
|
||||
});
|
||||
throw error;
|
||||
}).finally(() => {
|
||||
commit('endLoading');
|
||||
});
|
||||
},
|
||||
logout({commit}) {
|
||||
commit('beginLoading');
|
||||
})
|
||||
}
|
||||
|
||||
return axios({
|
||||
url: '/api/logout',
|
||||
}).catch(error => {
|
||||
}).finally(() => {
|
||||
commit('logout');
|
||||
commit('endLoading');
|
||||
});
|
||||
},
|
||||
resetPassword({commit}, email) {
|
||||
commit('beginLoading');
|
||||
|
||||
return axios({
|
||||
url: '/api/reset-password',
|
||||
data: {email: email},
|
||||
method: 'post'
|
||||
}).then(response => {
|
||||
return response;
|
||||
}).finally(() => {
|
||||
commit('endLoading');
|
||||
});
|
||||
},
|
||||
register({commit}, userData) {
|
||||
commit('beginLoading');
|
||||
|
||||
return axios({
|
||||
url: '/api/register',
|
||||
data: userData,
|
||||
method: 'post'
|
||||
}).then(response => {
|
||||
return response;
|
||||
}).finally(() => {
|
||||
commit('endLoading');
|
||||
});
|
||||
},
|
||||
loadAddress({commit}) {
|
||||
commit('beginLoading');
|
||||
|
||||
return axios({
|
||||
url: '/api/address',
|
||||
method: 'get',
|
||||
}).then(response => {
|
||||
commit('setUserData', response.data);
|
||||
if (response.data.watchlist) {
|
||||
commit('setWatchlist', response.data.watchlist);
|
||||
}
|
||||
}).catch(() => {
|
||||
commit('alert', {
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
success: false,
|
||||
});
|
||||
}).finally(() => {
|
||||
commit('endLoading');
|
||||
});
|
||||
},
|
||||
saveAddress({commit, state}, data) {
|
||||
commit('beginLoading');
|
||||
|
||||
return axios({
|
||||
url: '/api/address',
|
||||
method: 'put',
|
||||
data
|
||||
}).then(() => {
|
||||
commit('alert', {
|
||||
message: 'Die Änderungen wurden gespeichert',
|
||||
success: true,
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.config.status >= 500) {
|
||||
return fetch(`${config.myEpApiBaseUrl}/api/login`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
commit('login', data)
|
||||
})
|
||||
.catch(error => {
|
||||
commit('logout')
|
||||
commit('alert', {
|
||||
message: 'Es ist ein Fehler aufgetreten :(',
|
||||
message: 'Der Login ist fehlgeschlagen :(',
|
||||
success: false,
|
||||
});
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}).finally(() => {
|
||||
commit('endLoading');
|
||||
});
|
||||
throw error
|
||||
})
|
||||
.finally(() => {
|
||||
commit('endLoading')
|
||||
})
|
||||
},
|
||||
logout({commit}) {
|
||||
commit('beginLoading')
|
||||
|
||||
const options = {
|
||||
...defaultOptions
|
||||
}
|
||||
|
||||
return fetch(`${config.myEpApiBaseUrl}/api/logout`, options)
|
||||
.then(checkStatus)
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
commit('logout')
|
||||
commit('endLoading')
|
||||
})
|
||||
},
|
||||
resetPassword({commit}, email) {
|
||||
commit('beginLoading')
|
||||
|
||||
const options = {
|
||||
...defaultOptions,
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
email
|
||||
})
|
||||
}
|
||||
|
||||
return fetch(`${config.myEpApiBaseUrl}/api/reset-password`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(response => response)
|
||||
.catch(handleError)
|
||||
.finally(() => {
|
||||
commit('endLoading')
|
||||
})
|
||||
},
|
||||
register({commit}, userData) {
|
||||
commit('beginLoading')
|
||||
|
||||
const options = {
|
||||
...defaultOptions,
|
||||
method: 'POST',
|
||||
body: JSON.stringify(userData)
|
||||
}
|
||||
|
||||
return fetch(`${config.myEpApiBaseUrl}/api/register`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => data)
|
||||
.catch(handleError)
|
||||
.finally(() => {
|
||||
commit('endLoading')
|
||||
})
|
||||
},
|
||||
loadAddress({commit}) {
|
||||
commit('beginLoading')
|
||||
|
||||
const options = {
|
||||
...defaultOptions,
|
||||
}
|
||||
|
||||
return fetch(`${config.myEpApiBaseUrl}/api/address`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
commit('setUserData', data)
|
||||
if (data.watchlist) {
|
||||
commit('setWatchlist', data.watchlist)
|
||||
}
|
||||
})
|
||||
.catch(handleError)
|
||||
.finally(() => {
|
||||
commit('endLoading')
|
||||
})
|
||||
},
|
||||
saveAddress({commit, state}, data) {
|
||||
commit('beginLoading')
|
||||
|
||||
const options = {
|
||||
...defaultOptions,
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(data)
|
||||
}
|
||||
|
||||
return fetch(`${config.myEpApiBaseUrl}/api/address`, options)
|
||||
.then(checkStatus)
|
||||
.then(response => response.json())
|
||||
.then(() => {
|
||||
commit('alert', {
|
||||
message: 'Die Änderungen wurden gespeichert',
|
||||
success: true,
|
||||
})
|
||||
})
|
||||
.catch(handleError)
|
||||
.finally(() => {
|
||||
commit('endLoading')
|
||||
})
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
|
||||
Reference in New Issue
Block a user