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..80dc7942f0d84a5b16b4fea9f89b4ea8a3082562 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')" /> </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/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/CommunityComponents/NewItemForm.vue b/src/components/CommunityComponents/NewItemForm.vue index 05e46edf06e298d7e70a5731fc941c1a69900080..2e90ff1ce3b4d903a0e1faf80c77572a6bcc4f4f 100644 --- a/src/components/CommunityComponents/NewItemForm.vue +++ b/src/components/CommunityComponents/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 }"> 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/UserProfileComponents/LargeProfileCard.vue b/src/components/UserProfileComponents/LargeProfileCard.vue index 08bdebd48ed65c5753281d64535e04b89dbf2055..6ecef8fd976997039735390d95209e7313eee010 100644 --- a/src/components/UserProfileComponents/LargeProfileCard.vue +++ b/src/components/UserProfileComponents/LargeProfileCard.vue @@ -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="" 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/CommunityViews/NewItemView.vue b/src/views/CommunityViews/NewItemView.vue index 8bbca71dd407668fe3de9abd0720d41eeea1c508..172ba809e4d552ba05319941ed1921b859e7ac28 100644 --- a/src/views/CommunityViews/NewItemView.vue +++ b/src/views/CommunityViews/NewItemView.vue @@ -1,5 +1,8 @@ <template> - <AddNewItem></AddNewItem> + <div class="h-screen grid md:mt-8"> + <AddNewItem/> + </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/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/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; }); },