diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2fa9d42..6661d89 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: cache: paths: - node_modules/ - key: "$CI_BUILD_REPO" + key: "$CI_COMMIT_REF_NAME" deploy-prod: stage: deploy diff --git a/src/App.vue b/src/App.vue index 7986880..90b8ffa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,6 +11,9 @@ export default { mounted() { this.$store.commit("init") + if (!this.$store.state.surveyCompletedOnce) { + this.$router.push("/") + } }, } diff --git a/src/components/Question.vue b/src/components/Question.vue index ec32091..0f1ecbf 100644 --- a/src/components/Question.vue +++ b/src/components/Question.vue @@ -98,6 +98,7 @@ this.$router.push("/questionnaire/" + nextQuestion) } else { + this.$store.commit("setSurveyCompleted") router.push('/results') } } diff --git a/src/store/index.js b/src/store/index.js index adff0fb..8dd1086 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -6,6 +6,7 @@ Vue.use(Vuex) export default new Vuex.Store({ state: { + surveyCompletedOnce: false, answers: [], questions: [] }, @@ -16,6 +17,9 @@ export default new Vuex.Store({ answerQuestion(state, pl) { this.state.answers[pl.id] = pl.answer }, + setSurveyCompleted() { + this.state.surveyCompletedOnce = true + }, init() { axios.get('https://avian-safeguard-214619.firebaseio.com/questions.json') .then(res => { diff --git a/src/views/HelpPage.vue b/src/views/HelpPage.vue index dac58c5..6bc268a 100644 --- a/src/views/HelpPage.vue +++ b/src/views/HelpPage.vue @@ -5,12 +5,12 @@ @media screen and (min-width : 906px) { .help { - width: 30%; + width: 600px; margin-left: auto; margin-right: auto; } } - + button { width: 80%; margin-bottom: 5%; @@ -43,6 +43,7 @@ this.$router.push("/questionnaire/" + nextQuestion) } else { + this.$store.commit("setSurveyCompleted") router.push('/results') } }, diff --git a/src/views/Home.vue b/src/views/Home.vue index a4f5491..0555109 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -5,10 +5,10 @@ justify-content: center; padding: 0.5em; } - + @media screen and (min-width : 906px) { .home { - width: 30%; + width: 600px; margin-left: auto; margin-right: auto; } diff --git a/src/views/Questionnaire.vue b/src/views/Questionnaire.vue index f25c872..b99760d 100644 --- a/src/views/Questionnaire.vue +++ b/src/views/Questionnaire.vue @@ -40,13 +40,12 @@ diff --git a/src/views/Warning.vue b/src/views/Warning.vue index 0c1a328..3404d4a 100644 --- a/src/views/Warning.vue +++ b/src/views/Warning.vue @@ -9,7 +9,7 @@ @media screen and (min-width : 906px) { .warning { - width: 30%; + width: 600px; margin-left: auto; margin-right: auto; }