diff --git a/src/components/BaseComponents/NavBar.vue b/src/components/BaseComponents/NavBar.vue index 80dc7942f0d84a5b16b4fea9f89b4ea8a3082562..251c1fec23ac86ed9a7c627be290df0efdcfc253 100644 --- a/src/components/BaseComponents/NavBar.vue +++ b/src/components/BaseComponents/NavBar.vue @@ -38,12 +38,12 @@ <script> import { parseUserFromToken } from "@/utils/token-utils"; -import {PlusIcon, ChatAlt2Icon, UserCircleIcon} from "@heroicons/vue/outline"; +import { PlusIcon, ChatAlt2Icon, UserCircleIcon } from "@heroicons/vue/outline"; export default { name: "NavBar.vue", - components:{ + components: { PlusIcon, ChatAlt2Icon, UserCircleIcon, diff --git a/src/components/CommunityComponents/NewCommunityForm.vue b/src/components/CommunityComponents/NewCommunityForm.vue index d9bf923296a42c70521274ba6dcc5e275b75bb22..8edbda1072907b4fa6b5c976f95e7a550ce6b0f4 100644 --- a/src/components/CommunityComponents/NewCommunityForm.vue +++ b/src/components/CommunityComponents/NewCommunityForm.vue @@ -1,5 +1,7 @@ <template> - <div class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full 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" @@ -170,12 +172,7 @@ <!-- Save item button --> <div class="flex justify-center mt-10 float-right"> - <Button - @click="saveClicked" - id="saveButton" - :text="'Lagre'" - > - </Button> + <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 ea6abb83500cae80226ad71f2816b129cce4fb85..0d26eb64cd7af607ba61930339cf2a3bfddd5a93 100644 --- a/src/components/CommunityComponents/NewItemForm.vue +++ b/src/components/CommunityComponents/NewItemForm.vue @@ -1,7 +1,13 @@ <template> - <div class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full 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">Opprett ny 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 a3c4dd2f9e049ec7b1fe18c68427659223bbd9d7..58f1d672bc5daad7ba43ab4e11b85a065203be38 100644 --- a/src/components/FormComponents/LoginForm.vue +++ b/src/components/FormComponents/LoginForm.vue @@ -1,5 +1,7 @@ <template> - <div class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full"> + <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 667da928ac0430fea928a78723f73af715622209..d13c08349360250ff4f0cf96b5f3faab00d7a841 100644 --- a/src/components/FormComponents/NewPasswordForm.vue +++ b/src/components/FormComponents/NewPasswordForm.vue @@ -1,9 +1,12 @@ <template> <div - class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4" + 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> + <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" @@ -63,7 +66,7 @@ <div id="buttonsField" class="mt-6"> <Button - class="float-right" + class="float-right" @click="setNewPassword" :text="'Sett ny passord'" /> @@ -81,8 +84,9 @@ import Button from "@/components/BaseComponents/ColoredButton"; export default { name: "NewPasswordForm.vue", - components:{ - Button,}, + components: { + Button, + }, setup() { return { v$: useVuelidate() }; }, @@ -91,10 +95,16 @@ export default { user: { password: { required: helpers.withMessage(`Feltet må være utfylt`, required), - minLength: helpers.withMessage('Passordet må være minst 8 karakterer lang', minLength(8)), + minLength: helpers.withMessage( + "Passordet må være minst 8 karakterer lang", + minLength(8) + ), }, rePassword: { - sameAs: helpers.withMessage('Passordene må være like', 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), }, }, diff --git a/src/components/FormComponents/ResetPasswordForm.vue b/src/components/FormComponents/ResetPasswordForm.vue index a3232e339f78a7ce82eee0a3199b966d9bc90178..a4c2d80e1533e2c7be82804041bd49208b4ab6be 100644 --- a/src/components/FormComponents/ResetPasswordForm.vue +++ b/src/components/FormComponents/ResetPasswordForm.vue @@ -1,7 +1,12 @@ <template> - <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 + 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" @@ -35,12 +40,11 @@ </div> </div> <Button - class="float-right" - @click="sendHome" - :text="'Tilbakestill passord'" + class="float-right" + @click="sendHome" + :text="'Tilbakestill passord'" /> </div> - </div> </template> @@ -52,7 +56,7 @@ import Button from "@/components/BaseComponents/ColoredButton"; export default { name: "ResetPassword.vue", - components:{ + components: { Button, }, data() { @@ -67,7 +71,7 @@ export default { validations() { return { email: { - required: helpers.withMessage('Feltet må være utfylt', 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 4b88012ec203c64c4f59a250b80a3fa780255d00..10eeba756a018cca14fe476c8ed3a6638496406e 100644 --- a/src/components/UserProfileComponents/LargeProfileCard.vue +++ b/src/components/UserProfileComponents/LargeProfileCard.vue @@ -27,7 +27,10 @@ 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 ring-1 ring-gray-300 rounded-xl" 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/utils/apiutil.js b/src/utils/apiutil.js index 07fb78b2f4d0f3cad940ab0d65a22c8cdd6d7f56..cb8d309196adad2d43b6edc56e6f5b8348f40c4d 100644 --- a/src/utils/apiutil.js +++ b/src/utils/apiutil.js @@ -188,38 +188,37 @@ export async function GetMembersOfCommunity(communityID) { } export function JoinOpenCommunity(communityId) { + if (tokenHeader().Authorization == "Bearer " + null) { + console.log("ikke logget på!"); + return "Login to join any community"; + } - if(tokenHeader().Authorization == "Bearer " + null){ - console.log("ikke logget på!"); - return "Login to join any community"; - } - - return axios - .post(API_URL + "communities/" + communityId + "/join", communityId, { - headers: tokenHeader(), - }) - .then((response) => { - return response; - }) - .catch((error) => { - console.log(error.response); - return error; - }); + return axios + .post(API_URL + "communities/" + communityId + "/join", communityId, { + headers: tokenHeader(), + }) + .then((response) => { + return response; + }) + .catch((error) => { + console.log(error.response); + return error; + }); } export async function GetIfUserAlreadyInCommunity(communityID) { - if(tokenHeader().Authorization == "Bearer " + null){ - return false; - } - - return axios - .get(API_URL + "communities/" + communityID + "/user/status", { - headers: tokenHeader(), - }) - .then((response) => { - return response.data; - }) - .catch((error) => { - return error; - }); + if (tokenHeader().Authorization == "Bearer " + null) { + return false; + } + + return axios + .get(API_URL + "communities/" + communityID + "/user/status", { + headers: tokenHeader(), + }) + .then((response) => { + return response.data; + }) + .catch((error) => { + return error; + }); } diff --git a/src/views/CommunityViews/NewCommunityView.vue b/src/views/CommunityViews/NewCommunityView.vue index f78ccde49e36551c8f47530ef8ed51bd944ce1a1..e8274f2d13b0f049b6ce56e0f005431e9ee1efe4 100644 --- a/src/views/CommunityViews/NewCommunityView.vue +++ b/src/views/CommunityViews/NewCommunityView.vue @@ -2,7 +2,6 @@ <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 172ba809e4d552ba05319941ed1921b859e7ac28..54978730632a5bf82595624b63bcb29c9f5b9c53 100644 --- a/src/views/CommunityViews/NewItemView.vue +++ b/src/views/CommunityViews/NewItemView.vue @@ -1,8 +1,7 @@ <template> <div class="h-screen grid md:mt-8"> - <AddNewItem/> + <AddNewItem /> </div> - </template> <script>