From a8598b7d6431e68788fff05f34f06123d4d13de6 Mon Sep 17 00:00:00 2001 From: lucasjs Date: Sun, 10 Dec 2017 20:44:56 -0200 Subject: [PATCH] Edit Feedbacks #3 --- ...ess-icon.svg => register-success-icon.svg} | 0 src/router/index.js | 103 +++++++++++++++++- ...dbackView.vue => FeedbackAprendizView.vue} | 33 ++++-- src/views/FeedbackGuruView.vue | 79 ++++++++++++++ src/views/RegisterAprendizView.vue | 2 +- src/views/RegisterGuruView.vue | 2 +- 6 files changed, 202 insertions(+), 17 deletions(-) rename src/assets/icons/{register-sucess-icon.svg => register-success-icon.svg} (100%) rename src/views/{FeedbackView.vue => FeedbackAprendizView.vue} (66%) create mode 100644 src/views/FeedbackGuruView.vue diff --git a/src/assets/icons/register-sucess-icon.svg b/src/assets/icons/register-success-icon.svg similarity index 100% rename from src/assets/icons/register-sucess-icon.svg rename to src/assets/icons/register-success-icon.svg diff --git a/src/router/index.js b/src/router/index.js index 64e037e..f77dd8b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -10,7 +10,8 @@ import RegisterGuruView from '@/views/RegisterGuruView'; import RegisterAprendizView from '@/views/RegisterAprendizView'; import ProfileView from '@/views/ProfileView'; import MyProfileView from '@/views/MyProfileView'; -import FeedbackView from '@/views/FeedbackView'; +import FeedbackGuruView from '@/views/FeedbackGuruView'; +import FeedbackAprendizView from '@/views/FeedbackAprendizView'; import PostView from '@/views/PostView'; import ProfessionView from '@/views/ProfessionView'; import AskView from '@/views/AskView'; @@ -49,11 +50,25 @@ export default new Router({ path: '/postar', name: 'postar', component: PostView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/buscar', name: 'search-view', component: SearchView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/bemvindo', @@ -91,51 +106,133 @@ export default new Router({ path: '/perfil', name: 'profile', component: ProfileView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/meu-perfil', name: 'my-profile', component: MyProfileView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/profissao', name: 'profession', component: ProfessionView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { - path: '/feedback', + path: '/feedback-guru', name: 'feedback', - component: FeedbackView, + component: FeedbackGuruView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, + }, + { + path: '/feedback-aprendiz', + name: 'feedback-aprendiz', + component: FeedbackAprendizView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/perguntar', name: 'perguntar', component: AskView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/responder', name: 'responder', component: AnswerView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/perguntas', name: 'perguntas', component: QuestionsView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/sucesso-perguntas', name: 'feedback-answer', component: FeedbackAnswerView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/perguntas-respondidas', name: 'answered-questions', component: AnsweredQuestionsView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/perguntas-nao-respondidas', name: 'not-answered-questions', component: NotAnsweredQuestionsView, + beforeEnter(to, from, next) { + if (store.state.idToken) { + next(); + } else { + next('/bemvindo'); + } + }, }, { path: '/contato', diff --git a/src/views/FeedbackView.vue b/src/views/FeedbackAprendizView.vue similarity index 66% rename from src/views/FeedbackView.vue rename to src/views/FeedbackAprendizView.vue index abd0269..9f980bf 100644 --- a/src/views/FeedbackView.vue +++ b/src/views/FeedbackAprendizView.vue @@ -1,17 +1,22 @@ @@ -19,12 +24,6 @@ import MainButton from '../components/MainButton'; export default { - data() { - return { - title: 'Perfil criado com sucesso!', - text: 'Vamos começar espalhando seu conheciemento?', - }; - }, components: { 'main-button': MainButton, }, @@ -32,6 +31,8 @@ export default { \ No newline at end of file + + &-link + color $dark-blue + font-size 14pt + font-weight 700 + margin-top 40px + + .main-btn + margin-top 20px + diff --git a/src/views/FeedbackGuruView.vue b/src/views/FeedbackGuruView.vue new file mode 100644 index 0000000..716e783 --- /dev/null +++ b/src/views/FeedbackGuruView.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/src/views/RegisterAprendizView.vue b/src/views/RegisterAprendizView.vue index 3884d94..5fcc07a 100644 --- a/src/views/RegisterAprendizView.vue +++ b/src/views/RegisterAprendizView.vue @@ -160,7 +160,7 @@ export default { console.log(formData); this.$store.dispatch('signup', formData); setTimeout(() => { - this.$router.push('/home'); + this.$router.push('/feedback-aprendiz'); }, 1000); }, }, diff --git a/src/views/RegisterGuruView.vue b/src/views/RegisterGuruView.vue index cb8b7a0..b8dcde4 100644 --- a/src/views/RegisterGuruView.vue +++ b/src/views/RegisterGuruView.vue @@ -310,7 +310,7 @@ export default { console.log(formData); this.$store.dispatch('signup', formData); setTimeout(() => { - this.$router.push('/home'); + this.$router.push('/feedback-guru'); }, 1000); }, },