From d904a2ac8b40bf69759a5e020382e896ffc1938e Mon Sep 17 00:00:00 2001 From: Titus Kristiansen <titusk@stud.ntnu.no> Date: Thu, 5 May 2022 12:39:52 +0200 Subject: [PATCH] Refactored and fixed FAQ --- src/components/BaseComponents/InputField.vue | 11 ----------- .../BaseComponents/NotificationsForm.vue | 11 ----------- .../LoginForm.vue | 0 .../NewPasswordForm.vue | 0 .../RegisterForm.vue | 0 .../ResetPasswordForm.vue | 0 src/router/index.js | 15 ++++----------- src/views/HelpView.vue | 12 ++++++------ .../{FormViews => UserAuthViews}/LoginView.vue | 2 +- .../NewPasswordView.vue | 2 +- .../{FormViews => UserAuthViews}/RegisterView.vue | 2 +- .../ResetPasswordView.vue | 2 +- .../user-component-tests/login-form.spec.js | 2 +- .../new-password-form.spec.js | 2 +- .../register-user-component.spec.js | 2 +- .../reset-password-form.spec.js | 2 +- 16 files changed, 18 insertions(+), 47 deletions(-) delete mode 100644 src/components/BaseComponents/InputField.vue delete mode 100644 src/components/BaseComponents/NotificationsForm.vue rename src/components/{FormComponents => UserAuthComponents}/LoginForm.vue (100%) rename src/components/{FormComponents => UserAuthComponents}/NewPasswordForm.vue (100%) rename src/components/{FormComponents => UserAuthComponents}/RegisterForm.vue (100%) rename src/components/{FormComponents => UserAuthComponents}/ResetPasswordForm.vue (100%) rename src/views/{FormViews => UserAuthViews}/LoginView.vue (74%) rename src/views/{FormViews => UserAuthViews}/NewPasswordView.vue (73%) rename src/views/{FormViews => UserAuthViews}/RegisterView.vue (67%) rename src/views/{FormViews => UserAuthViews}/ResetPasswordView.vue (73%) diff --git a/src/components/BaseComponents/InputField.vue b/src/components/BaseComponents/InputField.vue deleted file mode 100644 index a6cbb32..0000000 --- a/src/components/BaseComponents/InputField.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <input - class="block w-full px-4 py-2 mt-2 text-gray-700 placeholder-gray-500 bg-white border rounded-md dark:bg-gray-800 dark:border-gray-600 dark:placeholder-gray-400 focus:border-blue-400 dark:focus:border-blue-300 focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-blue-300" - /> -</template> - -<script> -export default { - name: "InputField", -}; -</script> diff --git a/src/components/BaseComponents/NotificationsForm.vue b/src/components/BaseComponents/NotificationsForm.vue deleted file mode 100644 index b142fb2..0000000 --- a/src/components/BaseComponents/NotificationsForm.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <div>This is a notification page</div> -</template> - -<script> -export default { - name: "NotificationsForm", -}; -</script> - -<style scoped></style> diff --git a/src/components/FormComponents/LoginForm.vue b/src/components/UserAuthComponents/LoginForm.vue similarity index 100% rename from src/components/FormComponents/LoginForm.vue rename to src/components/UserAuthComponents/LoginForm.vue diff --git a/src/components/FormComponents/NewPasswordForm.vue b/src/components/UserAuthComponents/NewPasswordForm.vue similarity index 100% rename from src/components/FormComponents/NewPasswordForm.vue rename to src/components/UserAuthComponents/NewPasswordForm.vue diff --git a/src/components/FormComponents/RegisterForm.vue b/src/components/UserAuthComponents/RegisterForm.vue similarity index 100% rename from src/components/FormComponents/RegisterForm.vue rename to src/components/UserAuthComponents/RegisterForm.vue diff --git a/src/components/FormComponents/ResetPasswordForm.vue b/src/components/UserAuthComponents/ResetPasswordForm.vue similarity index 100% rename from src/components/FormComponents/ResetPasswordForm.vue rename to src/components/UserAuthComponents/ResetPasswordForm.vue diff --git a/src/router/index.js b/src/router/index.js index b0a701a..3a6d7a8 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -47,7 +47,7 @@ const routes = [ { path: "/register", name: "register", - component: () => import("../views/FormViews/RegisterView.vue"), + component: () => import("../views/UserAuthViews/RegisterView.vue"), }, { path: "/messages", @@ -58,12 +58,12 @@ const routes = [ { path: "/login", name: "login", - component: () => import("../views/FormViews/LoginView.vue"), + component: () => import("../views/UserAuthViews/LoginView.vue"), }, { path: "/newPassword", name: "newPassword", - component: () => import("../views/FormViews/NewPasswordView"), + component: () => import("../views/UserAuthViews/NewPasswordView"), beforeEnter: guardRoute, }, { @@ -74,7 +74,7 @@ const routes = [ { path: "/resetPassword", name: "resetPassword", - component: () => import("../views/FormViews/ResetPasswordView.vue"), + component: () => import("../views/UserAuthViews/ResetPasswordView.vue"), }, { path: "/newCommunity", @@ -94,13 +94,6 @@ const routes = [ component: () => import("../views/ItemViews/NewItemView.vue"), beforeEnter: guardRoute, }, - { - path: "/notifications", - name: "notifications", - component: () => - import("../components/BaseComponents/NotificationsForm.vue"), - beforeEnter: guardRoute, - }, { path: "/community/:communityID", name: "communityHome", diff --git a/src/views/HelpView.vue b/src/views/HelpView.vue index 695f2c1..16026a6 100644 --- a/src/views/HelpView.vue +++ b/src/views/HelpView.vue @@ -1,16 +1,16 @@ <template> - <div class="mt-6 bg-white justify-center w-screen"> + <div class="mt-10 bg-white justify-center w-screen"> <div id="contact" class="grid place-items-center w-full"> <div class="lg:mb-0 text-gray-700 w-full"> <div class="mx-4"> - <h2 class="text-primary-dark mb-6 uppercase font-bold text-2xl"> + <h2 class="flex justify-center text-primary-dark mb-6 uppercase font-bold text-2xl mt-4"> Kontakt oss </h2> - <p class="text-gray-500 leading-relaxed mb-9"> + <p class="flex justify-center mx-auto text-gray-500 leading-relaxed mb-12 max-w-md mt-8"> {{ contact.description }} </p> </div> - <div class="flex mb-8 ml-2 w-full"> + <div class="flex justify-center mb-12 w-full"> <div class="max-w-14 max-h-14 min-h-14 min-w-14"> <LocationMarkerIcon class="w-14 h-14 text-primary-dark rounded mr-4" @@ -23,7 +23,7 @@ <p>{{ contact.country }}</p> </div> </div> - <div class="flex mb-8 ml-2 max-w-[370px] w-full"> + <div class="flex justify-center mb-10 w-full pr-11"> <div class="max-w-14 max-h-14 min-h-14 min-w-14"> <MailIcon class="w-14 h-14 text-primary-dark rounded mr-4" /> </div> @@ -36,7 +36,7 @@ </div> <div id="faq"> <div - class="mx-auto text-center px-4 text-2xl text-primary-dark font-semibold" + class="mx-auto text-center px-4 mt-8 text-2xl text-primary-dark font-semibold" > Ofte stilte spørsmål </div> diff --git a/src/views/FormViews/LoginView.vue b/src/views/UserAuthViews/LoginView.vue similarity index 74% rename from src/views/FormViews/LoginView.vue rename to src/views/UserAuthViews/LoginView.vue index ec6fa68..6ab7e4c 100644 --- a/src/views/FormViews/LoginView.vue +++ b/src/views/UserAuthViews/LoginView.vue @@ -5,7 +5,7 @@ </template> <script> -import LoginForm from "@/components/FormComponents/LoginForm"; +import LoginForm from "@/components/UserAuthComponents/LoginForm"; export default { name: "LoginView.vue", components: { diff --git a/src/views/FormViews/NewPasswordView.vue b/src/views/UserAuthViews/NewPasswordView.vue similarity index 73% rename from src/views/FormViews/NewPasswordView.vue rename to src/views/UserAuthViews/NewPasswordView.vue index 1c08586..890a8f5 100644 --- a/src/views/FormViews/NewPasswordView.vue +++ b/src/views/UserAuthViews/NewPasswordView.vue @@ -5,7 +5,7 @@ </template> <script> -import NewPasswordForm from "@/components/FormComponents/NewPasswordForm"; +import NewPasswordForm from "@/components/UserAuthComponents/NewPasswordForm"; export default { name: "NewPasswordView.vue", components: { diff --git a/src/views/FormViews/RegisterView.vue b/src/views/UserAuthViews/RegisterView.vue similarity index 67% rename from src/views/FormViews/RegisterView.vue rename to src/views/UserAuthViews/RegisterView.vue index 9301398..0bf15f1 100644 --- a/src/views/FormViews/RegisterView.vue +++ b/src/views/UserAuthViews/RegisterView.vue @@ -5,7 +5,7 @@ </template> <script> -import RegisterFormComponent from "../../components/FormComponents/RegisterForm.vue"; +import RegisterFormComponent from "../../components/UserAuthComponents/RegisterForm.vue"; export default { components: { diff --git a/src/views/FormViews/ResetPasswordView.vue b/src/views/UserAuthViews/ResetPasswordView.vue similarity index 73% rename from src/views/FormViews/ResetPasswordView.vue rename to src/views/UserAuthViews/ResetPasswordView.vue index 284c4fe..3bb12c1 100644 --- a/src/views/FormViews/ResetPasswordView.vue +++ b/src/views/UserAuthViews/ResetPasswordView.vue @@ -5,7 +5,7 @@ </template> <script> -import ResetPassword from "@/components/FormComponents/ResetPasswordForm"; +import ResetPassword from "@/components/UserAuthComponents/ResetPasswordForm"; export default { name: "ResetPasswordView.vue", components: { diff --git a/tests/unit/component-tests/user-component-tests/login-form.spec.js b/tests/unit/component-tests/user-component-tests/login-form.spec.js index 40fa711..bb0285d 100644 --- a/tests/unit/component-tests/user-component-tests/login-form.spec.js +++ b/tests/unit/component-tests/user-component-tests/login-form.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import LoginForm from "@/components/FormComponents/LoginForm.vue"; +import LoginForm from "@/components/UserAuthComponents/LoginForm.vue"; describe("LoginForm component", () => { let wrapper; diff --git a/tests/unit/component-tests/user-component-tests/new-password-form.spec.js b/tests/unit/component-tests/user-component-tests/new-password-form.spec.js index 638e597..3d52388 100644 --- a/tests/unit/component-tests/user-component-tests/new-password-form.spec.js +++ b/tests/unit/component-tests/user-component-tests/new-password-form.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import NewPasswordForm from "@/components/FormComponents/NewPasswordForm.vue"; +import NewPasswordForm from "@/components/UserAuthComponents/NewPasswordForm.vue"; describe("NewPasswordForm component", () => { let wrapper; diff --git a/tests/unit/component-tests/user-component-tests/register-user-component.spec.js b/tests/unit/component-tests/user-component-tests/register-user-component.spec.js index 9accd16..4c2ca3b 100644 --- a/tests/unit/component-tests/user-component-tests/register-user-component.spec.js +++ b/tests/unit/component-tests/user-component-tests/register-user-component.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import RegisterFormComponent from "@/components/FormComponents/RegisterForm"; +import RegisterFormComponent from "@/components/UserAuthComponents/RegisterForm"; describe("RegisterFormComponent", () => { let wrapper; diff --git a/tests/unit/component-tests/user-component-tests/reset-password-form.spec.js b/tests/unit/component-tests/user-component-tests/reset-password-form.spec.js index 1dc9f0a..45f67ce 100644 --- a/tests/unit/component-tests/user-component-tests/reset-password-form.spec.js +++ b/tests/unit/component-tests/user-component-tests/reset-password-form.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import ResetPasswordForm from "@/components/FormComponents/ResetPasswordForm.vue"; +import ResetPasswordForm from "@/components/UserAuthComponents/ResetPasswordForm.vue"; describe("ResetPasswordForm component", () => { let wrapper; -- GitLab