Merge remote-tracking branch 'origin/master'

This commit is contained in:
thilo 2020-03-22 19:54:28 +01:00
commit b3b8a10d92
9 changed files with 23 additions and 9 deletions

View file

@ -6,7 +6,7 @@ stages:
cache: cache:
paths: paths:
- node_modules/ - node_modules/
key: "$CI_BUILD_REPO" key: "$CI_COMMIT_REF_NAME"
deploy-prod: deploy-prod:
stage: deploy stage: deploy

View file

@ -11,6 +11,9 @@
export default { export default {
mounted() { mounted() {
this.$store.commit("init") this.$store.commit("init")
if (!this.$store.state.surveyCompletedOnce) {
this.$router.push("/")
}
}, },
} }
</script> </script>

View file

@ -98,6 +98,7 @@
this.$router.push("/questionnaire/" + nextQuestion) this.$router.push("/questionnaire/" + nextQuestion)
} }
else { else {
this.$store.commit("setSurveyCompleted")
router.push('/results') router.push('/results')
} }
} }

View file

@ -6,6 +6,7 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
surveyCompletedOnce: false,
answers: [], answers: [],
questions: [] questions: []
}, },
@ -16,6 +17,9 @@ export default new Vuex.Store({
answerQuestion(state, pl) { answerQuestion(state, pl) {
this.state.answers[pl.id] = pl.answer this.state.answers[pl.id] = pl.answer
}, },
setSurveyCompleted() {
this.state.surveyCompletedOnce = true
},
init() { init() {
axios.get('https://avian-safeguard-214619.firebaseio.com/questions.json') axios.get('https://avian-safeguard-214619.firebaseio.com/questions.json')
.then(res => { .then(res => {

View file

@ -5,7 +5,7 @@
@media screen and (min-width : 906px) { @media screen and (min-width : 906px) {
.help { .help {
width: 30%; width: 600px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
@ -43,6 +43,7 @@
this.$router.push("/questionnaire/" + nextQuestion) this.$router.push("/questionnaire/" + nextQuestion)
} }
else { else {
this.$store.commit("setSurveyCompleted")
router.push('/results') router.push('/results')
} }
}, },

View file

@ -8,7 +8,7 @@
@media screen and (min-width : 906px) { @media screen and (min-width : 906px) {
.home { .home {
width: 30%; width: 600px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }

View file

@ -40,13 +40,12 @@
<style scoped> <style scoped>
@media screen and (min-width : 906px) { @media screen and (min-width : 906px) {
.questionnaire { .questionnaire {
width: 30%; width: 600px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
} }
#back-button { #back-button {
position: absolute; position: absolute;
margin-left: 2%; margin-left: 2%;

View file

@ -4,6 +4,9 @@
<p class="risk-chance alert" v-if="risk >= 66">hoch</p> <p class="risk-chance alert" v-if="risk >= 66">hoch</p>
<p class="risk-chance warning" v-if="risk >= 33 && risk < 66">durchschnittlich</p> <p class="risk-chance warning" v-if="risk >= 33 && risk < 66">durchschnittlich</p>
<p class="risk-chance success" v-if="risk < 33">niedrig</p> <p class="risk-chance success" v-if="risk < 33">niedrig</p>
<p class="text-center"><router-link style="text-decoration:none" to="/">
Zurück zum Anfang
</router-link></p>
<p v-if="bad.length > 0">Auf Folgendes sollten Sie achten:</p> <p v-if="bad.length > 0">Auf Folgendes sollten Sie achten:</p>
<div v-for="card in bad" v-bind:key="card.description" class="card-advice alert"> <div v-for="card in bad" v-bind:key="card.description" class="card-advice alert">
<div class="card-advice-title">{{ card.title }}</div> <div class="card-advice-title">{{ card.title }}</div>
@ -75,7 +78,7 @@
@media screen and (min-width : 906px) { @media screen and (min-width : 906px) {
.results { .results {
width: 30%; width: 600px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
@ -114,4 +117,7 @@
.risk-chance.alert { .risk-chance.alert {
color: #E94A47; color: #E94A47;
} }
.text-center {
text-align: center;
}
</style> </style>

View file

@ -9,7 +9,7 @@
@media screen and (min-width : 906px) { @media screen and (min-width : 906px) {
.warning { .warning {
width: 30%; width: 600px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }