diff --git a/package-lock.json b/package-lock.json index bf8401f585cf13c85d81e6a8f01912a151578266..894267d8427354bf139f24226b19df82101d6cf5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@heroicons/vue": "^1.0.6", "@mdi/font": "5.9.55", + "@vue-hero-icons/outline": "^1.7.2", "@vuelidate/core": "^2.0.0-alpha.40", "@vuelidate/validators": "^2.0.0-alpha.28", "axios": "^0.26.1", @@ -2826,6 +2827,14 @@ "dev": true, "license": "MIT" }, + "node_modules/@vue-hero-icons/outline": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@vue-hero-icons/outline/-/outline-1.7.2.tgz", + "integrity": "sha512-mgMpncarjZHXY1K2tyjbYHf53yQG9amroDR9t2iH/umpsN8+f8RNcTy1m131EZ8WBCm8MpF97XpXPV129rvtVg==", + "dependencies": { + "babel-helper-vue-jsx-merge-props": "^2.0.3" + } + }, "node_modules/@vue/babel-helper-vue-jsx-merge-props": { "version": "1.2.1", "dev": true, @@ -4171,6 +4180,11 @@ "follow-redirects": "^1.14.8" } }, + "node_modules/babel-helper-vue-jsx-merge-props": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz", + "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg==" + }, "node_modules/babel-jest": { "version": "27.5.1", "dev": true, @@ -16880,6 +16894,14 @@ "version": "21.0.0", "dev": true }, + "@vue-hero-icons/outline": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@vue-hero-icons/outline/-/outline-1.7.2.tgz", + "integrity": "sha512-mgMpncarjZHXY1K2tyjbYHf53yQG9amroDR9t2iH/umpsN8+f8RNcTy1m131EZ8WBCm8MpF97XpXPV129rvtVg==", + "requires": { + "babel-helper-vue-jsx-merge-props": "^2.0.3" + } + }, "@vue/babel-helper-vue-jsx-merge-props": { "version": "1.2.1", "dev": true @@ -17766,6 +17788,11 @@ "follow-redirects": "^1.14.8" } }, + "babel-helper-vue-jsx-merge-props": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz", + "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg==" + }, "babel-jest": { "version": "27.5.1", "dev": true, diff --git a/package.json b/package.json index 66788b9ffdf616d6288db4223c4c69ed8106e191..e02ef530fc185de6dac101e77ea5d312fc4374b0 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@heroicons/vue": "^1.0.6", "@mdi/font": "5.9.55", + "@vue-hero-icons/outline": "^1.7.2", "@vuelidate/core": "^2.0.0-alpha.40", "@vuelidate/validators": "^2.0.0-alpha.28", "axios": "^0.26.1", diff --git a/public/favicon.ico b/public/favicon.ico index 2bbee9c7589aa7943fe472849934b7f220ed43cd..d899f3ca760e7fa3736c98bba9641cc472e4da64 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/assets/additem.png b/src/assets/additem.png deleted file mode 100644 index 90717a87fef71f1c0a37ba3b80150954f52673c0..0000000000000000000000000000000000000000 Binary files a/src/assets/additem.png and /dev/null differ diff --git a/src/assets/members.png b/src/assets/members.png deleted file mode 100644 index 51775f6bead51014d3143631c292421752d024b6..0000000000000000000000000000000000000000 Binary files a/src/assets/members.png and /dev/null differ diff --git a/src/assets/messages.png b/src/assets/messages.png deleted file mode 100644 index b8c15889efc747b700220ca819b2c12caa09e780..0000000000000000000000000000000000000000 Binary files a/src/assets/messages.png and /dev/null differ diff --git a/src/assets/newCommunity.png b/src/assets/newCommunity.png deleted file mode 100644 index 73bfba9f8000cecabb461394d7fe2f6b90c02b56..0000000000000000000000000000000000000000 Binary files a/src/assets/newCommunity.png and /dev/null differ diff --git a/src/assets/notifications.png b/src/assets/notifications.png deleted file mode 100644 index a612605af4bc91be42f5989632fb3287aac7bbfd..0000000000000000000000000000000000000000 Binary files a/src/assets/notifications.png and /dev/null differ diff --git a/src/assets/profile.png b/src/assets/profile.png deleted file mode 100644 index 79b3e5f3624b8db0593ca77997f52633c34f7de9..0000000000000000000000000000000000000000 Binary files a/src/assets/profile.png and /dev/null differ diff --git a/src/assets/removeIcon.png b/src/assets/removeIcon.png deleted file mode 100644 index 3c66b2a75ff7d81fd33622bf13a903f838f114ee..0000000000000000000000000000000000000000 Binary files a/src/assets/removeIcon.png and /dev/null differ diff --git a/src/components/BaseComponents/NavBar.vue b/src/components/BaseComponents/NavBar.vue index fd47bedcff48104aefc91e09887d6a00812006c3..58020e292abccaa07ac2e7cfa6d66f30961e42fc 100644 --- a/src/components/BaseComponents/NavBar.vue +++ b/src/components/BaseComponents/NavBar.vue @@ -12,25 +12,22 @@ </div> <ul class="flex"> <li> - <img + <PlusIcon class="m-6 cursor-pointer h-7" - src="../../assets/additem.png" alt="Legg til" - @click="$router.push('/addNewItem')" + @click="$router.push('/newItem')" /> </li> <li> - <img + <ChatAlt2Icon class="m-6 cursor-pointer h-7" - src="../../assets/messages.png" alt="Meldinger" @click="$router.push('/messages')" /> </li> <li> - <img + <UserCircleIcon class="m-6 cursor-pointer h-7" - src="../../assets/profile.png" alt="Profil" @click="loadProfile" /> @@ -41,10 +38,17 @@ <script> import { parseUserFromToken } from "@/utils/token-utils"; +import {PlusIcon, ChatAlt2Icon, UserCircleIcon} from "@heroicons/vue/outline"; export default { name: "NavBar.vue", + components:{ + PlusIcon, + ChatAlt2Icon, + UserCircleIcon, + }, + methods: { async loadProfile() { if (this.$store.state.user.token !== null) { diff --git a/src/components/CommunityComponents/CommunityHamburger.vue b/src/components/CommunityComponents/CommunityHamburger.vue index e060566e73a400fbe368f168136a2e1cff1f8a7b..2ff217132d67798d84e31a7d166ee007e4d615ba 100644 --- a/src/components/CommunityComponents/CommunityHamburger.vue +++ b/src/components/CommunityComponents/CommunityHamburger.vue @@ -6,21 +6,21 @@ <ul class="py-1"> <li id="newItem"> <router-link - to="/addNewItem" + to="/newItem" class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white" >Opprett Utleie</router-link > </li> <li id="getMembers"> <router-link - :to="'/group/' + communityID + '/memberlist'" + :to="'/community/' + communityID + '/memberlist'" class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white" >Se Medlemmer </router-link> </li> <li id="adminGroup"> <router-link - :to="'/group/' + communityID + '/memberlist'" + :to="'/community/' + communityID + '/memberlist'" class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white" >Administrer Gruppe</router-link > diff --git a/src/components/CommunityComponents/CommunityHome.vue b/src/components/CommunityComponents/CommunityHome.vue index cf72f17cc2691d0fbb21ec2077197ab1a21d1197..477ba7fbbf0b314242af6e2762be65c67b040ee2 100644 --- a/src/components/CommunityComponents/CommunityHome.vue +++ b/src/components/CommunityComponents/CommunityHome.vue @@ -41,8 +41,8 @@ </template> <script> -import ItemCard from "@/components/CommunityComponents/ItemCard.vue"; import CommunityHeader from "@/components/CommunityComponents/CommunityHeader.vue"; +import ItemCard from "@/components/ItemComponents/ItemCard"; import { GetCommunity, GetListingsInCommunity } from "@/utils/apiutil"; export default { name: "SearchItemListComponent", diff --git a/src/components/CommunityComponents/NewCommunityForm.vue b/src/components/CommunityComponents/NewCommunityForm.vue index df068e7a3a788a8a8b505923240db216d23b961b..d9bf923296a42c70521274ba6dcc5e275b75bb22 100644 --- a/src/components/CommunityComponents/NewCommunityForm.vue +++ b/src/components/CommunityComponents/NewCommunityForm.vue @@ -1,7 +1,5 @@ <template> - <div - class="w-full max-w-md m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl mt-[10%] p-4" - > + <div class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4"> <!-- Component heading --> <h3 class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8" @@ -162,13 +160,6 @@ </button> --> <!-- Button for removing an image --> - <button - class="w-1/12 ml-5 text-white bg-white-500 font-medium rounded-lg text-sm" - v-show="imageAdded" - @click="removeImage" - > - <img src="../../assets/removeIcon.png" alt="Remove icon image" /> - </button> </div> <!-- Div box for showing all chosen images --> @@ -178,8 +169,13 @@ </div> <!-- Save item button --> - <div class="flex justify-center mt-10"> - <Button @click="saveClicked" id="saveButton" :text="'Lagre'"> </Button> + <div class="flex justify-center mt-10 float-right"> + <Button + @click="saveClicked" + id="saveButton" + :text="'Lagre'" + > + </Button> </div> </div> </template> diff --git a/src/components/FormComponents/LoginForm.vue b/src/components/FormComponents/LoginForm.vue index 5b0756332f1d1537e74dbeaa9e301efcae83e511..a3c4dd2f9e049ec7b1fe18c68427659223bbd9d7 100644 --- a/src/components/FormComponents/LoginForm.vue +++ b/src/components/FormComponents/LoginForm.vue @@ -1,7 +1,5 @@ <template> - <div - class="w-full max-w-md m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl mt-[10%]" - > + <div class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full"> <div class="px-6 py-4 mt-4"> <h3 class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8" diff --git a/src/components/FormComponents/NewPasswordForm.vue b/src/components/FormComponents/NewPasswordForm.vue index 84d6ab5bdd784ad1e26cd96fcb8b189941dd66ba..667da928ac0430fea928a78723f73af715622209 100644 --- a/src/components/FormComponents/NewPasswordForm.vue +++ b/src/components/FormComponents/NewPasswordForm.vue @@ -1,7 +1,10 @@ <template> <div - class="w-full max-w-sm p-6 m-auto bg-white rounded-md shadow-md dark:bg-gray-800 mt-8" + class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4" > + + <h3 class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8">Endre passord</h3> + <div id="firstPasswordField" :class="{ error: v$.user.password.$errors.length }" @@ -14,7 +17,7 @@ <input type="password" v-model="v$.user.password.$model" - class="block w-full px-4 py-2 mt-2 text-gray-700 bg-white border rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-primary-light dark:focus:border-primary-light focus:ring-primary-light focus:outline-none focus:ring focus:ring-opacity-40" + 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" /> <!-- error message --> <div v-for="(error, index) of v$.user.password.$errors" :key="index"> @@ -44,7 +47,7 @@ <input type="password" v-model="v$.user.rePassword.$model" - class="block w-full px-4 py-2 mt-2 text-gray-700 bg-white border rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-primary-light dark:focus:border-primary-light focus:ring-primary-light focus:outline-none focus:ring focus:ring-opacity-40" + 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" /> <!-- error message --> <div v-for="(error, index) of v$.user.rePassword.$errors" :key="index"> @@ -59,25 +62,27 @@ </div> <div id="buttonsField" class="mt-6"> - <button + <Button + class="float-right" @click="setNewPassword" - class="w-full px-4 py-2 tracking-wide text-white transition-colors duration-200 transform bg-gray-700 rounded-md hover:bg-gray-600 focus:outline-none focus:bg-gray-600" - > - Endre passord - </button> + :text="'Sett ny passord'" + /> </div> </div> </template> <script> import useVuelidate from "@vuelidate/core"; -import { required, minLength, sameAs } from "@vuelidate/validators"; +import { required, minLength, sameAs, helpers } from "@vuelidate/validators"; import { doNewPassword } from "@/utils/apiutil"; import { mapState } from "vuex"; +import Button from "@/components/BaseComponents/ColoredButton"; export default { name: "NewPasswordForm.vue", + components:{ + Button,}, setup() { return { v$: useVuelidate() }; }, @@ -85,13 +90,12 @@ export default { return { user: { password: { - required, - minLength: minLength(8), + required: helpers.withMessage(`Feltet må være utfylt`, required), + minLength: helpers.withMessage('Passordet må være minst 8 karakterer lang', minLength(8)), }, rePassword: { - required, - minLength: minLength(8), - sameAs: sameAs(this.user.password), + sameAs: helpers.withMessage('Passordene må være like', sameAs(this.user.password)), + required: helpers.withMessage(`Feltet må være utfylt`, required), }, }, }; @@ -129,7 +133,7 @@ export default { if (newPasswordResponse.newPasswordSet === true) { console.log("New password set"); - await this.$router.push("/endre"); + await this.$router.push("/"); } else if (newPasswordResponse.newPasswordSet === false) { console.log("Couldn't set new password"); } else { diff --git a/src/components/FormComponents/RegisterForm.vue b/src/components/FormComponents/RegisterForm.vue index ce4b136d25abe1dbcf27d8d0f7e2a33898fbf3d3..a2fc3c208a551402412bb31dffc3e73fac640275 100644 --- a/src/components/FormComponents/RegisterForm.vue +++ b/src/components/FormComponents/RegisterForm.vue @@ -1,6 +1,6 @@ <template> <div - class="w-full max-w-md m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl mt-[10%] p-4" + class="w-full max-w-md mx-auto mb-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl p-4" > <h3 class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8" diff --git a/src/components/FormComponents/ResetPasswordForm.vue b/src/components/FormComponents/ResetPasswordForm.vue index eba14df70b599e53369b9fd94e34e2828b22f811..a3232e339f78a7ce82eee0a3199b966d9bc90178 100644 --- a/src/components/FormComponents/ResetPasswordForm.vue +++ b/src/components/FormComponents/ResetPasswordForm.vue @@ -1,5 +1,8 @@ <template> - <div class="resetPassword"> + <div class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4"> + + <h3 class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8">Glemt passordet ditt?</h3> + <div id="emailField" class="m-6" @@ -14,10 +17,11 @@ <input type="email" id="email" - class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-medium focus:border-primary-medium block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-medium dark:focus:border-primary-medium" + 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" placeholder="eksempel@eksempel.no" v-model="v$.email.$model" required + @keyup.enter="sendHome" /> <!-- error message --> <div v-for="(error, index) of v$.email.$errors" :key="index"> @@ -30,22 +34,27 @@ </div> </div> </div> + <Button + class="float-right" + @click="sendHome" + :text="'Tilbakestill passord'" + /> </div> - <button - @click="sendHome" - class="flex justify-center align-items: flex-end; text-white bg-primary-medium hover:bg-primary-dark focus:ring-4 focus:outline-none focus:ring-primary-light font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-primary-medium dark:hover:bg-primary-dark dark:focus:ring-primary-dark" - > - Send e-post - </button> + </div> </template> <script> import useVuelidate from "@vuelidate/core"; import { required, email, helpers } from "@vuelidate/validators"; +import Button from "@/components/BaseComponents/ColoredButton"; + export default { name: "ResetPassword.vue", + components:{ + Button, + }, data() { return { showError: false, @@ -58,7 +67,7 @@ export default { validations() { return { email: { - required, + required: helpers.withMessage('Feltet må være utfylt', required), email: helpers.withMessage(`E-posten er ugyldig`, email), }, }; diff --git a/src/components/CommunityComponents/ItemCard.vue b/src/components/ItemComponents/ItemCard.vue similarity index 100% rename from src/components/CommunityComponents/ItemCard.vue rename to src/components/ItemComponents/ItemCard.vue diff --git a/src/components/CommunityComponents/NewItemForm.vue b/src/components/ItemComponents/NewItemForm.vue similarity index 97% rename from src/components/CommunityComponents/NewItemForm.vue rename to src/components/ItemComponents/NewItemForm.vue index 05e46edf06e298d7e70a5731fc941c1a69900080..ea6abb83500cae80226ad71f2816b129cce4fb85 100644 --- a/src/components/CommunityComponents/NewItemForm.vue +++ b/src/components/ItemComponents/NewItemForm.vue @@ -1,13 +1,7 @@ <template> - <div - class="w-full max-w-md m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl mt-[3%] p-4" - > + <div class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4"> <!-- Component heading --> - <h3 - class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8" - > - Utleie - </h3> + <h3 class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8">Opprett ny utleie</h3> <!-- Title --> <div class="mb-6" :class="{ error: v$.item.title.$errors.length }"> @@ -212,7 +206,7 @@ </div> <!-- Save item button --> - <div class="flex justify-center"> + <div class="float-right"> <Button :text="'Lagre'" @click="saveClicked" id="saveButton" /> </div> </div> diff --git a/src/components/CommunityComponents/SearchItemList.vue b/src/components/ItemComponents/SearchItemList.vue similarity index 97% rename from src/components/CommunityComponents/SearchItemList.vue rename to src/components/ItemComponents/SearchItemList.vue index 32d806a98d18ec9156da12eae1a2a1f715c0fcdc..00ed0583f51be18a36e249fb9e04a599a840d862 100644 --- a/src/components/CommunityComponents/SearchItemList.vue +++ b/src/components/ItemComponents/SearchItemList.vue @@ -31,7 +31,7 @@ </template> <script> -import ItemCard from "@/components/CommunityComponents/ItemCard"; +import ItemCard from "@/components/ItemComponents/ItemCard"; export default { name: "SearchItemListComponent", diff --git a/src/components/UserProfileComponents/UserProfile.vue b/src/components/UserProfileComponents/UserProfile.vue index 08bdebd48ed65c5753281d64535e04b89dbf2055..7ee44e43946ce93d577ae888efc9923d71f7aacc 100644 --- a/src/components/UserProfileComponents/UserProfile.vue +++ b/src/components/UserProfileComponents/UserProfile.vue @@ -1,6 +1,6 @@ <template> <div - class="w-full max-w-xl m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl mt-[10%] p-6" + class="w-full max-w-xl m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl p-4" > <div v-show="isCurrentUser" class="float-right px-4 pt-4"> <button @@ -27,7 +27,7 @@ v-show="dropdown" class="z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700" > - <ul class="py-1 absolute bg-white" aria-labelledby="dropdownDefault"> + <ul class="py-1 absolute bg-white ring-1 ring-gray-300 rounded-xl" aria-labelledby="dropdownDefault"> <li> <router-link to="" @@ -37,7 +37,7 @@ </li> <li> <router-link - :to="'/user/' + id + '/groups'" + :to="'/user/' + id + '/communites'" class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white" >Mine grupper </router-link> diff --git a/src/router/index.js b/src/router/index.js index 31ebabc8df5f12718e9f02da3c8083b966da2db5..436a688cd7721a4f54c21dff55db17571030e5b6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,8 +1,5 @@ import store from "@/store"; import { createRouter, createWebHistory } from "vue-router"; -import HomeView from "../views/CommunityViews/CommunityView.vue"; -import LoginView from "../views/FormViews/LoginView.vue"; -import NewPasswordView from "../views/FormViews/NewPasswordView"; /** * Guards routes. If token is null, no user is logged in and only the @@ -21,7 +18,7 @@ const routes = [ { path: "/", name: "home", - component: HomeView, + component: () => import("../views/CommunityViews/CommunityView.vue"), }, { path: "/profile/:id", @@ -37,27 +34,24 @@ const routes = [ { path: "/messages", name: "messages", - component: () => - import( - /* webpackChunkName: "register" */ "../views/ChatViews/ChatView.vue" - ), + component: () => import("../views/ChatViews/ChatView.vue"), beforeEnter: guardRoute, }, { path: "/login", name: "login", - component: LoginView, + component: () => import("../views/FormViews/LoginView.vue"), }, { path: "/newPassword", name: "newPassword", - component: NewPasswordView, + component: () => import("../views/FormViews/NewPasswordView"), beforeEnter: guardRoute, }, { path: "/searchItemList", name: "searchItemList", - component: () => import("../views/CommunityViews/SearchItemListView.vue"), + component: () => import("../views/ItemViews/SearchItemListView.vue"), }, { path: "/resetPassword", @@ -65,20 +59,21 @@ const routes = [ component: () => import("../views/FormViews/ResetPasswordView.vue"), }, { - path: "/createNewGroup", - name: "createNewGroup", + path: "/newCommunity", + name: "newCommunity", component: () => import("../views/CommunityViews/NewCommunityView.vue"), + beforeEnter: guardRoute, }, { - path: "/group/:id/memberlist", + path: "/community/:id/memberlist", name: "memberlist", component: () => import("../views/CommunityViews/MemberListView.vue"), beforeEnter: guardRoute, }, { - path: "/addNewItem", - name: "addNewItem", - component: () => import("../views/CommunityViews/NewItemView.vue"), + path: "/newItem", + name: "newItem", + component: () => import("../views/ItemViews/NewItemView.vue"), beforeEnter: guardRoute, }, { @@ -88,13 +83,14 @@ const routes = [ beforeEnter: guardRoute, }, { - path: "/user/:id/groups", - name: "myGroups", + path: "/user/:id/communities", + name: "myCommunities", component: () => import("../views/CommunityViews/MyCommunitiesView.vue"), + beforeEnter: guardRoute, }, { path: "/community/:communityID", - name: "GroupHome", + name: "communityHome", component: () => import("../views/CommunityViews/CommunityHomeView.vue"), }, { diff --git a/src/views/CommunityViews/CommunityView.vue b/src/views/CommunityViews/CommunityView.vue index 9fd39f5f305a7592f633795254899fa3cf3883a8..97b774a1c48dc778df7996ae32c0e743e7435f6e 100644 --- a/src/views/CommunityViews/CommunityView.vue +++ b/src/views/CommunityViews/CommunityView.vue @@ -2,9 +2,9 @@ <div v-if="loggedIn"> <div class="flex flex-row p-4 relative"> <p class="capitalize font-bold w-full">Mine felleskap</p> - <PlusIcon + <UserAddIcon class="cursor-pointer max-h-6 max-w-6 float-right grow" - @click="$router.push('/createNewGroup')" + @click="$router.push('/newCommunity')" v-if="loggedIn" alt="Lag ett nytt felleskap" /> @@ -18,7 +18,7 @@ <script> import CommunityList from "@/components/CommunityComponents/CommunityList.vue"; import { getMyGroups, getVisibleGroups } from "@/utils/apiutil"; -import { PlusIcon } from "@heroicons/vue/outline"; +import { UserAddIcon } from "@heroicons/vue/outline"; export default { name: "HomeView", @@ -31,7 +31,7 @@ export default { }, components: { CommunityList, - PlusIcon, + UserAddIcon, }, async created() { this.publicCommunities = await getVisibleGroups(); diff --git a/src/views/CommunityViews/NewCommunityView.vue b/src/views/CommunityViews/NewCommunityView.vue index 38eacf3ba70f4df9c97093d2e5712fb961dc4c4d..f78ccde49e36551c8f47530ef8ed51bd944ce1a1 100644 --- a/src/views/CommunityViews/NewCommunityView.vue +++ b/src/views/CommunityViews/NewCommunityView.vue @@ -1,5 +1,8 @@ <template> - <NewCommunity /> + <div class="h-screen grid md:mt-8"> + <NewCommunity /> + </div> + </template> <script> diff --git a/src/views/FormViews/LoginView.vue b/src/views/FormViews/LoginView.vue index 9b35159fb022cebd9f041bb806bed054024e6f91..ec6fa68a7c9b217e2d199d2bd8b9d8781556343a 100644 --- a/src/views/FormViews/LoginView.vue +++ b/src/views/FormViews/LoginView.vue @@ -1,5 +1,5 @@ <template> - <div class="h-screen grid"> + <div class="h-screen grid md:mt-8"> <LoginForm></LoginForm> </div> </template> diff --git a/src/views/FormViews/NewPasswordView.vue b/src/views/FormViews/NewPasswordView.vue index 710ce20f0fc1b334635f7703bb2c74902ec93bca..1c08586c58f04a984fa22a5af77219c79907c145 100644 --- a/src/views/FormViews/NewPasswordView.vue +++ b/src/views/FormViews/NewPasswordView.vue @@ -1,5 +1,5 @@ <template> - <div class="newPasswordPage"> + <div class="h-screen grid md:mt-8"> <NewPasswordForm></NewPasswordForm> </div> </template> @@ -13,11 +13,3 @@ export default { }, }; </script> - -<style scoped> -.newPasswordPage { - background-color: white; - height: 100%; - overflow: auto; -} -</style> diff --git a/src/views/FormViews/RegisterView.vue b/src/views/FormViews/RegisterView.vue index 2b431f1d01e0312d4b450f11b18ea78c5a033d70..93013987e5e31384c4391768e5468a6bc77df35d 100644 --- a/src/views/FormViews/RegisterView.vue +++ b/src/views/FormViews/RegisterView.vue @@ -1,5 +1,5 @@ <template> - <div class="h-screen grid"> + <div class="h-screen grid md:mt-8"> <RegisterFormComponent /> </div> </template> diff --git a/src/views/FormViews/ResetPasswordView.vue b/src/views/FormViews/ResetPasswordView.vue index 2345d329aafdc34d561fc78a8a965639e9304c1c..284c4fe3582728f817ad5fb7b6fbb98373dd38dc 100644 --- a/src/views/FormViews/ResetPasswordView.vue +++ b/src/views/FormViews/ResetPasswordView.vue @@ -1,5 +1,5 @@ <template> - <div class="resetPassword"> + <div class="h-screen grid md:mt-8"> <ResetPassword></ResetPassword> </div> </template> @@ -13,11 +13,3 @@ export default { }, }; </script> - -<style scoped> -.resetPassword { - background-color: white; - height: 100%; - overflow: auto; -} -</style> diff --git a/src/views/CommunityViews/NewItemView.vue b/src/views/ItemViews/NewItemView.vue similarity index 54% rename from src/views/CommunityViews/NewItemView.vue rename to src/views/ItemViews/NewItemView.vue index 8bbca71dd407668fe3de9abd0720d41eeea1c508..fa8ba75077b76aa1a1af647d9b54ea9bf599a7ac 100644 --- a/src/views/CommunityViews/NewItemView.vue +++ b/src/views/ItemViews/NewItemView.vue @@ -1,9 +1,12 @@ <template> - <AddNewItem></AddNewItem> + <div class="h-screen grid md:mt-8"> + <AddNewItem/> + </div> + </template> <script> -import AddNewItem from "@/components/CommunityComponents/NewItemForm"; +import AddNewItem from "@/components/ItemComponents/NewItemForm"; export default { name: "AddNewItemView.vue", diff --git a/src/views/CommunityViews/SearchItemListView.vue b/src/views/ItemViews/SearchItemListView.vue similarity index 71% rename from src/views/CommunityViews/SearchItemListView.vue rename to src/views/ItemViews/SearchItemListView.vue index 1725bf8e672f75b7fe3e2600f6ae9bffaf4c063c..7da50f9397c5dee29f471267b8cb08866edcccfb 100644 --- a/src/views/CommunityViews/SearchItemListView.vue +++ b/src/views/ItemViews/SearchItemListView.vue @@ -3,7 +3,7 @@ </template> <script> -import SearchItemListComponent from "@/components/CommunityComponents/SearchItemList"; +import SearchItemListComponent from "@/components/ItemComponents/SearchItemList"; export default { name: "SearchItemListView", components: { diff --git a/src/views/UserProfileViews/ProfileView.vue b/src/views/UserProfileViews/ProfileView.vue index aa1bbd6ac97f782fbf65fb73787d982afeffd0c9..a490eb09dfd233803ffd624b428fa206ec767f63 100644 --- a/src/views/UserProfileViews/ProfileView.vue +++ b/src/views/UserProfileViews/ProfileView.vue @@ -1,6 +1,6 @@ <template> <div> - <large-profile-card :isCurrentUser="true" class="align-top" /> + <LargeProfileCard :isCurrentUser="true" class="md:mt-8" /> </div> </template> diff --git a/tests/unit/component-tests/community-component-tests/__snapshots__/create-new-group.spec.js.snap b/tests/unit/component-tests/community-component-tests/__snapshots__/create-new-group.spec.js.snap deleted file mode 100644 index 0203fd3b821ba687b171ce226171b61b5a90deae..0000000000000000000000000000000000000000 --- a/tests/unit/component-tests/community-component-tests/__snapshots__/create-new-group.spec.js.snap +++ /dev/null @@ -1,175 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CreateNewGroup elements rendering renders correctly 1`] = ` -<div - class="w-full max-w-md m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl mt-[10%] p-4" -> - <!-- Component heading --> - <h3 - class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8" - > - Opprett ny gruppe - </h3> - <!-- Radio boxes --> - <div - class="mt-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" - id="radioBoxLabel" - > - Synlighet - </label> - <div - class="form-check" - > - <input - class="form-check-input appearance-none rounded-full h-4 w-4 border border-gray-300 bg-white checked:bg-primary-medium checked:border-primary-medium focus:outline-none transition duration-200 mt-1 align-top bg-no-repeat bg-center bg-contain float-left mr-2 cursor-pointer" - id="flexRadioOpen" - name="flexRadioDefault" - type="radio" - value="Åpen" - /> - <label - class="form-check-label inline-block text-gray-800" - for="flexRadioOpen" - id="radioBoxOpenLabel" - > - Åpen - </label> - </div> - <div - class="form-check" - > - <input - class="form-check-input appearance-none rounded-full h-4 w-4 border border-gray-300 bg-white checked:bg-primary-medium checked:border-primary-medium focus:outline-none transition duration-200 mt-1 align-top bg-no-repeat bg-center bg-contain float-left mr-2 cursor-pointer" - id="flexRadioPrivate" - name="flexRadioDefault" - type="radio" - value="Privat" - /> - <label - class="form-check-label inline-block text-gray-800" - for="flexRadioPrivate" - id="radioBoxPrivateLabel" - > - Privat - </label> - </div> - </div> - <!-- Title --> - <div - class="mt-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" - id="titleLabel" - > - Gruppenavn - </label> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="title" - required="" - type="text" - /> - <!-- error message for title--> - - - </div> - <!-- Place --> - <div - class="mt-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" - > - By/Sted - </label> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - required="" - type="text" - /> - <!-- error message for place--> - - - </div> - <!-- Description --> - <div - class="mt-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400" - id="descriptionLabel" - > - Beskrivelse - </label> - <textarea - 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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="description" - required="" - rows="4" - /> - <!-- error message for description --> - - - </div> - <!-- Images --> - <div - class="mt-6" - > - <label - class="block mb-2 text-xl font-medium text-gray-900 dark:text-gray-400" - id="imageLabel" - > - Bilde - </label> - <input - accept="image/png, image/jpeg" - multiple="" - style="display: none;" - type="file" - /> - <!-- Button for adding an image --> - <div - class="inline-flex rounded-md shadow-sm" - > - <div - class="text-error uppercase text-center" - > - midlertidig fjernet - </div> - <!-- <button - @click="$refs.file.click()" - class="text-black bg-gray-200 hover:bg-grey-800 focus:ring-4 focus:outline-none focus:ring-grey-300 font-medium rounded-lg text-sm sm:w-auto px-5 py-2.5 text-center dark:bg-grey-600 dark:hover:bg-grey-700 dark:focus:ring-grey-800 disabled:opacity-50" - :disabled="imageAdded" - > - Velg bilde - </button> --> - <!-- Button for removing an image --> - <button - class="w-1/12 ml-5 text-white bg-white-500 font-medium rounded-lg text-sm" - style="display: none;" - > - <img - alt="Remove icon image" - src="" - /> - </button> - </div> - <!-- Div box for showing all chosen images --> - - - </div> - <!-- Save item button --> - <div - class="flex justify-center mt-10" - > - <button-stub - id="saveButton" - text="Lagre" - /> - </div> -</div> -`; diff --git a/tests/unit/component-tests/community-component-tests/__snapshots__/new-item-form.spec.js.snap b/tests/unit/component-tests/community-component-tests/__snapshots__/new-item-form.spec.js.snap deleted file mode 100644 index c762c869566cb255d92ef914c550f218c79ed08b..0000000000000000000000000000000000000000 --- a/tests/unit/component-tests/community-component-tests/__snapshots__/new-item-form.spec.js.snap +++ /dev/null @@ -1,210 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`NewItemForm component renders correctly 1`] = ` -<div - class="w-full max-w-md m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl mt-[3%] p-4" -> - <!-- Component heading --> - <h3 - class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8" - > - Utleie - </h3> - <!-- Title --> - <div - class="mb-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" - id="titleLabel" - > - Tittel - </label> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="title" - required="" - type="text" - /> - <!-- error message for title--> - - - </div> - <!-- Select category --> - <div - class="mb-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400" - id="selectCategoryLabel" - > - Kategori - </label> - <select - 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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="categories" - > - <option - class="text-gray-400" - disabled="" - value="" - > - Select a category - </option> - - <option - class="text-gray-900 text-sm" - > - Hage - </option> - <option - class="text-gray-900 text-sm" - > - Kjøkken - </option> - <option - class="text-gray-900 text-sm" - > - Musikk - </option> - <option - class="text-gray-900 text-sm" - > - Annet - </option> - - </select> - <!-- error message for select box --> - - - </div> - <!-- Select Group --> - <div - class="mb-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400" - > - Gruppe - </label> - <select - 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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - > - <option - class="text-gray-400" - disabled="" - value="" - > - Select a Group - </option> - - <option - class="text-gray-900 text-sm" - > - 4040 - </option> - <option - class="text-gray-900 text-sm" - > - 4041 - </option> - - </select> - <!-- error message for select box --> - - - </div> - <!-- price --> - <div - class="mb-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" - id="priceLabel" - > - Pris - </label> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="price" - required="" - type="number" - /> - <!-- error message for price --> - - - </div> - <!-- Description --> - <div - class="mb-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400" - id="descriptionLabel" - > - Beskrivelse - </label> - <textarea - 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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="description" - required="" - rows="4" - /> - <!-- error message for description --> - - - </div> - <!-- Address --> - <div - class="mb-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" - > - Adresse - </label> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="adress" - required="" - type="text" - /> - <!-- error message for address--> - - - </div> - <!-- Images --> - <div> - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400" - id="imageLabel" - > - Bilder - </label> - <input - accept="image/png, image/jpeg" - multiple="" - style="display: none;" - type="file" - /> - <button - class="block text-white bg-primary-medium hover:bg-primary-dark focus:ring-4 focus:outline-none focus:ring-primary-light font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-medium dark:hover:bg-primary-dark dark:focus:ring-primary-light" - > - Velg bilde - </button> - - - </div> - <!-- Save item button --> - <div - class="flex justify-center" - > - <button - class="block text-white bg-primary-medium hover:bg-primary-dark focus:ring-4 focus:outline-none focus:ring-primary-light font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-medium dark:hover:bg-primary-dark dark:focus:ring-primary-light" - id="saveButton" - > - Lagre - </button> - </div> -</div> -`; diff --git a/tests/unit/component-tests/community-component-tests/add-new-item.spec.js b/tests/unit/component-tests/community-component-tests/add-new-item.spec.js index 417812b108f62b53c5762732a59d4e969b8e4c3c..9026411b4cfe97a22636a8eb1d54fa12a224bc0c 100644 --- a/tests/unit/component-tests/community-component-tests/add-new-item.spec.js +++ b/tests/unit/component-tests/community-component-tests/add-new-item.spec.js @@ -1,5 +1,5 @@ import { shallowMount } from "@vue/test-utils"; -import AddNewItem from "@/components/CommunityComponents/NewItemForm.vue"; +import AddNewItem from "@/components/ItemComponents/NewItemForm.vue"; describe("addNewItem elements rendering", () => { it("renders all labels", () => { diff --git a/tests/unit/component-tests/community-component-tests/item-card.spec.js b/tests/unit/component-tests/community-component-tests/item-card.spec.js index a03b348b8070bd4b572f33ec33d2aa641253458c..998c8d4f7d4c90b9407b6cea2d0db8cfa3ea242e 100644 --- a/tests/unit/component-tests/community-component-tests/item-card.spec.js +++ b/tests/unit/component-tests/community-component-tests/item-card.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import ItemCard from "@/components/CommunityComponents/ItemCard.vue"; +import ItemCard from "@/components/ItemComponents/ItemCard.vue"; describe("ItemCard component", () => { let wrapper; diff --git a/tests/unit/component-tests/community-component-tests/new-item-form.spec.js b/tests/unit/component-tests/community-component-tests/new-item-form.spec.js index 8271342651aaae430c68cbac6f3a924b482384e1..03406c0a54a73cedc2be643c3741015749183312 100644 --- a/tests/unit/component-tests/community-component-tests/new-item-form.spec.js +++ b/tests/unit/component-tests/community-component-tests/new-item-form.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import NewItemForm from "@/components/CommunityComponents/NewItemForm.vue"; +import NewItemForm from "@/components/ItemComponents/NewItemForm.vue"; describe("NewItemForm component", () => { let wrapper; diff --git a/tests/unit/component-tests/community-component-tests/search-item-list.spec.js b/tests/unit/component-tests/community-component-tests/search-item-list.spec.js index 145a56a66093be7fb062785bafbd11fa6c116f7a..691b8c4bce2d2057528870f628ce99d116cd3e8e 100644 --- a/tests/unit/component-tests/community-component-tests/search-item-list.spec.js +++ b/tests/unit/component-tests/community-component-tests/search-item-list.spec.js @@ -1,5 +1,5 @@ import { shallowMount } from "@vue/test-utils"; -import SearchItemListComponent from "@/components/CommunityComponents/SearchItemList.vue"; +import SearchItemListComponent from "@/components/ItemComponents/SearchItemList.vue"; describe("SearchItemListComponent elements rendering", () => { let wrapper; diff --git a/tests/unit/component-tests/user-component-tests/__snapshots__/login-form.spec.js.snap b/tests/unit/component-tests/user-component-tests/__snapshots__/login-form.spec.js.snap deleted file mode 100644 index 1dfad6aab396d689114b6198552a606c7bd4692d..0000000000000000000000000000000000000000 --- a/tests/unit/component-tests/user-component-tests/__snapshots__/login-form.spec.js.snap +++ /dev/null @@ -1,77 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`LoginForm component renders correctly 1`] = ` -<div - class="w-full max-w-md m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl mt-[10%]" -> - <div - class="px-6 py-4 mt-4" - > - <h3 - class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8" - > - Logg på - </h3> - <div> - <div - class="w-full mt-6" - > - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - placeholder="Skriv inn din e-postadresse *" - required="" - type="email" - /> - <!-- error message --> - - - </div> - <div - class="w-full mt-6" - > - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - placeholder="Vennligst oppgi passordet ditt *" - required="" - type="password" - /> - <!-- error message --> - - - </div> - <div - class="flex items-center justify-between mt-8" - > - <router-link - class="text-primary-medium" - to="/resetPassword" - > - Glemt passord? - </router-link> - <button - class="block text-white bg-primary-medium hover:bg-primary-dark focus:ring-4 focus:outline-none focus:ring-primary-light font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-medium dark:hover:bg-primary-dark dark:focus:ring-primary-light" - > - Logg på - </button> - </div> - </div> - </div> - <div - class="flex items-center justify-center py-4 text-center bg-gray-50 dark:bg-gray-700" - > - <router-link - class="mx-2 text-sm font-bold text-primary-medium dark:text-primary-light hover:underline" - to="/register" - > - Opprette ny konto - </router-link> - </div> - <div - class="flex items-center justify-center text-center bg-gray-50" - > - <label - class="mx-2 text-sm font-bold text-red-500 dark:text-primary-light hover:underline" - /> - </div> -</div> -`; diff --git a/tests/unit/component-tests/user-component-tests/__snapshots__/new-password-form.spec.js.snap b/tests/unit/component-tests/user-component-tests/__snapshots__/new-password-form.spec.js.snap deleted file mode 100644 index ca5a4de5c26fd7c68fd656ae6e704a74dfdd42d3..0000000000000000000000000000000000000000 --- a/tests/unit/component-tests/user-component-tests/__snapshots__/new-password-form.spec.js.snap +++ /dev/null @@ -1,58 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`NewPasswordForm component renders correctly 1`] = ` -<div - class="w-full max-w-sm p-6 m-auto bg-white rounded-md shadow-md dark:bg-gray-800 mt-8" -> - <div - class="" - id="firstPasswordField" - > - <label - class="block text-sm text-gray-800 dark:text-gray-200" - for="password" - > - Nytt passord - </label> - <input - class="block w-full px-4 py-2 mt-2 text-gray-700 bg-white border rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-primary-light dark:focus:border-primary-light focus:ring-primary-light focus:outline-none focus:ring focus:ring-opacity-40" - type="password" - /> - <!-- error message --> - - - </div> - <div - class="mt-4" - id="secondPasswordField" - > - <div - class="flex items-center justify-between" - > - <label - class="block text-sm text-gray-800 dark:text-gray-200" - for="rePassword" - > - Gjenta nytt passord - </label> - </div> - <input - class="block w-full px-4 py-2 mt-2 text-gray-700 bg-white border rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-primary-light dark:focus:border-primary-light focus:ring-primary-light focus:outline-none focus:ring focus:ring-opacity-40" - type="password" - /> - <!-- error message --> - - - </div> - <div - class="mt-6" - id="buttonsField" - > - <button - class="w-full px-4 py-2 tracking-wide text-white transition-colors duration-200 transform bg-gray-700 rounded-md hover:bg-gray-600 focus:outline-none focus:bg-gray-600" - > - Endre passord - </button> - </div> -</div> -`; diff --git a/tests/unit/component-tests/user-component-tests/__snapshots__/register-user-component.spec.js.snap b/tests/unit/component-tests/user-component-tests/__snapshots__/register-user-component.spec.js.snap deleted file mode 100644 index 5dc934f34616017376f52244bdce820b86ad7d07..0000000000000000000000000000000000000000 --- a/tests/unit/component-tests/user-component-tests/__snapshots__/register-user-component.spec.js.snap +++ /dev/null @@ -1,95 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`RegisterFormComponent renders correctly 1`] = ` -<div - class="w-full max-w-md m-auto md:ring-1 ring-gray-300 overflow-hidden rounded-xl mt-[10%] p-4" -> - <h3 - class="text-xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-8" - > - Opprett ny bruker - </h3> - <form> - <div - class="grid grid-cols-1 gap-6 mt-4" - > - <div> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="email" - placeholder="E-post adresse" - type="email" - /> - <!-- error message --> - - - </div> - <div> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="password" - placeholder="Passord" - type="password" - /> - <!-- error message --> - - - </div> - <div> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="confirmPassword" - placeholder="Bekreft passord" - type="password" - /> - <!-- error message --> - - - </div> - <div> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - data-test="firstNameTest" - id="firstName" - placeholder="Fornavn" - type="text" - /> - <!-- error message --> - - - </div> - <div> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="lastName" - placeholder="Etternavn" - type="text" - /> - <!-- error message --> - - - </div> - <div> - <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-primary-light dark:focus:border-primary-light focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-primary-light" - id="address" - placeholder="Adresse" - type="text" - /> - <!-- error message --> - - - </div> - </div> - <div - class="flex justify-end mt-6" - > - <button - class="block text-white bg-primary-medium hover:bg-primary-dark focus:ring-4 focus:outline-none focus:ring-primary-light font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-medium dark:hover:bg-primary-dark dark:focus:ring-primary-light" - > - Lagre - </button> - </div> - </form> -</div> -`; diff --git a/tests/unit/component-tests/user-component-tests/__snapshots__/reset-password-form.spec.js.snap b/tests/unit/component-tests/user-component-tests/__snapshots__/reset-password-form.spec.js.snap deleted file mode 100644 index 7b673ca96522a31d724f0d34ffa6998763ac92e2..0000000000000000000000000000000000000000 --- a/tests/unit/component-tests/user-component-tests/__snapshots__/reset-password-form.spec.js.snap +++ /dev/null @@ -1,38 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ResetPasswordForm component renders correctly 1`] = ` -<div - class="resetPassword" -> - <div - class="m-6" - id="emailField" - > - <div - class="mb-6" - > - <label - class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" - for="email" - > - E-post - </label> - <input - class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-medium focus:border-primary-medium block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-medium dark:focus:border-primary-medium" - id="email" - placeholder="eksempel@eksempel.no" - required="" - type="email" - /> - <!-- error message --> - - - </div> - </div> - <button - class="flex justify-center align-items: flex-end; text-white bg-primary-medium hover:bg-primary-dark focus:ring-4 focus:outline-none focus:ring-primary-light font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-primary-medium dark:hover:bg-primary-dark dark:focus:ring-primary-dark" - > - Send e-post - </button> -</div> -`; diff --git a/vue.config.js b/vue.config.js index 3ec0170c3cb07b201b38bd62b0da6f140b0713a9..e77733af29c6ce1ad2798aee7bb9f3b932f7635f 100644 --- a/vue.config.js +++ b/vue.config.js @@ -4,7 +4,7 @@ module.exports = defineConfig({ transpileDependencies: true, chainWebpack: (config) => { config.plugin("html").tap((args) => { - args[0].title = "Borrow Company"; + args[0].title = "Borrow Community"; return args; }); },