diff --git a/src/components/BaseComponents/InputField.vue b/src/components/BaseComponents/InputField.vue deleted file mode 100644 index a6cbb32e98ed5e1f94ec9b784ea492b9b138048e..0000000000000000000000000000000000000000 --- a/src/components/BaseComponents/InputField.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <input - class="block w-full px-4 py-2 mt-2 text-gray-700 placeholder-gray-500 bg-white border rounded-md dark:bg-gray-800 dark:border-gray-600 dark:placeholder-gray-400 focus:border-blue-400 dark:focus:border-blue-300 focus:ring-opacity-40 focus:outline-none focus:ring focus:ring-blue-300" - /> -</template> - -<script> -export default { - name: "InputField", -}; -</script> diff --git a/src/components/BaseComponents/NavBar.vue b/src/components/BaseComponents/NavBar.vue index 668bf3624030eef75c87b366ed0aeeef40bc7bdb..e6f2562c9e029366d0f973a997895c83b4d4b9a6 100644 --- a/src/components/BaseComponents/NavBar.vue +++ b/src/components/BaseComponents/NavBar.vue @@ -18,20 +18,14 @@ /> <a class="hidden md:block mt-7 text-sm float-right">Legg til</a> </li> - <li> + <li class="cursor-pointer" @click="loadMessages"> <div class="notification-container"> <ChatAlt2Icon - class="m-6 cursor-pointer h-7" + class="m-6 md:mr-2 h-7 text-primary-medium float-left" alt="Meldinger" - @click="loadMessages()" /> - <p - @click="loadMessages()" - class="notification" - v-if="newMessages > 0" - > - {{ notifications }} - </p> + <p class="notification" v-if="newMessages > 0">{{ notifications }}</p> + <a class="hidden md:block mt-7 text-sm float-right">Meldinger</a> </div> </li> <li class="cursor-pointer" @click="loadProfile"> diff --git a/src/components/BaseComponents/NotificationsForm.vue b/src/components/BaseComponents/NotificationsForm.vue deleted file mode 100644 index b142fb2a8e36ec57b52256194cc35de433f71d63..0000000000000000000000000000000000000000 --- a/src/components/BaseComponents/NotificationsForm.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <div>This is a notification page</div> -</template> - -<script> -export default { - name: "NotificationsForm", -}; -</script> - -<style scoped></style> diff --git a/src/components/BaseComponents/PaginationTemplate.vue b/src/components/BaseComponents/PaginationTemplate.vue index b6907f178de39c1dace54149174e972e8e764b4b..939d7350598667c7e2710346f3ba80bb83f96748 100644 --- a/src/components/BaseComponents/PaginationTemplate.vue +++ b/src/components/BaseComponents/PaginationTemplate.vue @@ -7,7 +7,9 @@ > Forrige </span> - <label class="mx-2">{{ currentPage + 1 }} av {{ totalPages() }}</label> + <label class="mx-2 text-primary-light" + >{{ currentPage + 1 }} av {{ totalPages() }}</label + > <span v-if="showNextLink()" class="cursor-pointer inline-flex items-center p-2 text-sm font-medium text-primary-light bg-white rounded-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700" diff --git a/src/components/ChatComponents/ChatsComponent.vue b/src/components/ChatComponents/ChatsComponent.vue index e1fbdaa41df47160ff6c335d019b67b754bf8830..f2cc2b00b788c5154aa5e137ae3ff1f9cc1482ab 100644 --- a/src/components/ChatComponents/ChatsComponent.vue +++ b/src/components/ChatComponents/ChatsComponent.vue @@ -1,7 +1,7 @@ <template> <div class="chat"> <div class="conversations"> - <h1>Samtaler:</h1> + <h1>Meldinger</h1> <hr /> <ChatProfile v-for="(conversation, i) in conversations" diff --git a/src/components/CommunityComponents/CommunityListItem.vue b/src/components/CommunityComponents/CommunityListItem.vue index 4116a893a97845095d11aa60b7735de685aac623..40d90645e430cd49f104c91c7def3e125b9721fb 100644 --- a/src/components/CommunityComponents/CommunityListItem.vue +++ b/src/components/CommunityComponents/CommunityListItem.vue @@ -54,7 +54,10 @@ v-if="!community.picture" class="h-10 w-10 flex flex-col justify-center items-center ml-2 mr-2" > - <UserGroupIcon alt="Felleskapets bilde" class="h-10 w-10" /> + <UserGroupIcon + alt="Felleskapets bilde" + class="h-10 w-10 text-primary-dark" + /> </div> <div v-else @@ -67,7 +70,7 @@ /> </div> <div class="flex-1 pl-1 overflow-hidden"> - <div class="font-medium dark:text-white truncate"> + <div class="font-medium text-gray-800 dark:text-white truncate"> {{ community.name }} </div> </div> diff --git a/src/components/CommunityComponents/CommunityRequestForm.vue b/src/components/CommunityComponents/CommunityRequestForm.vue index 7c5f430106fee65e8a424de790f41ec1df7c4fc5..0ea59b7ccf360f9745e9e87c7b407eeb61df68ed 100644 --- a/src/components/CommunityComponents/CommunityRequestForm.vue +++ b/src/components/CommunityComponents/CommunityRequestForm.vue @@ -41,6 +41,14 @@ <div class="flex justify-center mt-10 float-right"> <Button @click="saveClicked" id="saveButton" :text="'Send'"> </Button> </div> + + <notification-modal + @click="routeToHome" + :visible="sendRequestClicked" + :title="'Vellykket'" + :message="'Forespørsel sendt!'" + > + </notification-modal> </div> </template> @@ -51,12 +59,14 @@ import { required, helpers, maxLength } from "@vuelidate/validators"; import Button from "@/components/BaseComponents/ColoredButton"; import { tokenHeader } from "@/utils/token-utils"; import { GetCommunity } from "@/utils/apiutil"; +import NotificationModal from "@/components/BaseComponents/NotificationModal"; export default { name: "CommunityRequestForm.vue", components: { Button, + NotificationModal, }, setup() { return { v$: useVuelidate() }; @@ -81,10 +91,14 @@ export default { message: "", communityId: null, community: {}, + sendRequestClicked: false, }; }, computed: {}, methods: { + routeToHome() { + this.$router.push("/"); + }, //TODO fix so that community id is set (not null) async saveClicked() { this.communityID = await this.$router.currentRoute.value.params @@ -96,6 +110,8 @@ export default { { message: this.message }, { headers: tokenHeader() } ); + + this.sendRequestClicked = true; }, getCommunityFromAPI: async function () { this.communityID = await this.$router.currentRoute.value.params diff --git a/src/components/FormComponents/LoginForm.vue b/src/components/UserAuthComponents/LoginForm.vue similarity index 100% rename from src/components/FormComponents/LoginForm.vue rename to src/components/UserAuthComponents/LoginForm.vue diff --git a/src/components/FormComponents/NewPasswordForm.vue b/src/components/UserAuthComponents/NewPasswordForm.vue similarity index 100% rename from src/components/FormComponents/NewPasswordForm.vue rename to src/components/UserAuthComponents/NewPasswordForm.vue diff --git a/src/components/FormComponents/RegisterForm.vue b/src/components/UserAuthComponents/RegisterForm.vue similarity index 100% rename from src/components/FormComponents/RegisterForm.vue rename to src/components/UserAuthComponents/RegisterForm.vue diff --git a/src/components/FormComponents/ResetPasswordForm.vue b/src/components/UserAuthComponents/ResetPasswordForm.vue similarity index 100% rename from src/components/FormComponents/ResetPasswordForm.vue rename to src/components/UserAuthComponents/ResetPasswordForm.vue diff --git a/src/components/UserProfileComponents/UserItems.vue b/src/components/UserProfileComponents/UserItems.vue index 88bd3ce45ce066f67be1739aba37e39c219ca129..25038bd7e4c1af6223f5993f85cd72ef4328b299 100644 --- a/src/components/UserProfileComponents/UserItems.vue +++ b/src/components/UserProfileComponents/UserItems.vue @@ -268,12 +268,10 @@ export default { } }, goToDeleteItem(item) { - console.log("Halllllo: " + item); this.chosenItem = item; this.readyToDelete = true; }, async deleteItem() { - console.log("HEI " + this.chosenItem); await UserService.setListingToDeleted(this.chosenItem); this.$router.go(0); }, diff --git a/src/router/index.js b/src/router/index.js index b0a701a8e3e72570a55bb60873802b88f200adfd..3a6d7a8316d3c5d61ea2a1d614d65f15f74072c9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -47,7 +47,7 @@ const routes = [ { path: "/register", name: "register", - component: () => import("../views/FormViews/RegisterView.vue"), + component: () => import("../views/UserAuthViews/RegisterView.vue"), }, { path: "/messages", @@ -58,12 +58,12 @@ const routes = [ { path: "/login", name: "login", - component: () => import("../views/FormViews/LoginView.vue"), + component: () => import("../views/UserAuthViews/LoginView.vue"), }, { path: "/newPassword", name: "newPassword", - component: () => import("../views/FormViews/NewPasswordView"), + component: () => import("../views/UserAuthViews/NewPasswordView"), beforeEnter: guardRoute, }, { @@ -74,7 +74,7 @@ const routes = [ { path: "/resetPassword", name: "resetPassword", - component: () => import("../views/FormViews/ResetPasswordView.vue"), + component: () => import("../views/UserAuthViews/ResetPasswordView.vue"), }, { path: "/newCommunity", @@ -94,13 +94,6 @@ const routes = [ component: () => import("../views/ItemViews/NewItemView.vue"), beforeEnter: guardRoute, }, - { - path: "/notifications", - name: "notifications", - component: () => - import("../components/BaseComponents/NotificationsForm.vue"), - beforeEnter: guardRoute, - }, { path: "/community/:communityID", name: "communityHome", diff --git a/src/services/user.service.js b/src/services/user.service.js index 6a02815d7e842b2b1463c2566f52015d9cf865dd..aca4c5fe9ff0518868896e95d1c1f6124e592b7a 100644 --- a/src/services/user.service.js +++ b/src/services/user.service.js @@ -41,13 +41,15 @@ class UserService { async setListingToDeleted(listingId) { return await axios - .put(API_URL + "listing/" + listingId, { - headers: tokenHeader(), + .delete(API_URL + "listing/" + listingId, { + headers: tokenHeader() }) .then((res) => { return res.data; }) - .catch((err) => console.error(err)); + .catch((err) => { + console.error(err); + }) } async getRenterHistory() { diff --git a/src/views/CommunityViews/CommunityView.vue b/src/views/CommunityViews/CommunityView.vue index b15181fcaf9b8af58f74958ecbf6fc71c7b4ee38..329917065b0679060da6503891b05c932ebaf18a 100644 --- a/src/views/CommunityViews/CommunityView.vue +++ b/src/views/CommunityViews/CommunityView.vue @@ -8,7 +8,7 @@ <div v-if="loggedIn"> <div class="flex flex-row p-4 relative"> <div - class="text-xl md:text-2xl text-primary-light font-medium w-full" + class="text-xl md:text-2xl text-primary-medium font-medium w-full" > Mine grupper </div> @@ -33,7 +33,7 @@ </div> <!-- Public communities, with search and pagination --> - <p class="text-xl md:text-2xl text-primary-light font-medium w-full p-4"> + <p class="text-xl md:text-2xl text-primary-medium font-medium w-full p-4"> Offentlige grupper </p> <!-- Search field --> diff --git a/src/views/HelpView.vue b/src/views/HelpView.vue index 585749da03358203863f9f07e23a64c86fec264d..343f1f47c4d432352db1c3c670c293ef7c4a1fdf 100644 --- a/src/views/HelpView.vue +++ b/src/views/HelpView.vue @@ -1,16 +1,20 @@ <template> - <div class="mt-6 bg-white justify-center w-screen"> + <div class="mt-10 bg-white justify-center w-screen"> <div id="contact" class="grid place-items-center w-full"> <div class="lg:mb-0 text-gray-700 w-full"> <div class="mx-4"> - <h2 class="text-primary-dark mb-6 uppercase font-bold text-2xl"> + <h2 + class="flex justify-center text-primary-dark mb-6 uppercase font-bold text-2xl mt-4" + > Kontakt oss </h2> - <p class="text-gray-500 leading-relaxed mb-9"> + <p + class="flex justify-center mx-auto text-gray-500 leading-relaxed mb-12 max-w-md mt-8" + > {{ contact.description }} </p> </div> - <div class="flex mb-8 ml-2 w-full"> + <div class="flex justify-center mb-12 w-full"> <div class="max-w-14 max-h-14 min-h-14 min-w-14"> <LocationMarkerIcon class="w-14 h-14 text-primary-dark rounded mr-4" @@ -18,17 +22,17 @@ </div> <div class=""> <h4 class="font-bold text-gray-800 text-xl mb-1">Lokaler</h4> - <p>{{ contact.address }},</p> - <p>{{ contact.city }},</p> + <p>{{ contact.address }}</p> + <p>{{ contact.city }}</p> <p>{{ contact.country }}</p> </div> </div> - <div class="flex mb-8 ml-2 max-w-[370px] w-full"> + <div class="flex justify-center mb-10 w-full pr-11"> <div class="max-w-14 max-h-14 min-h-14 min-w-14"> <MailIcon class="w-14 h-14 text-primary-dark rounded mr-4" /> </div> <div class=""> - <h4 class="font-bold text-gray-800 text-xl mb-1">Epost Addresse</h4> + <h4 class="font-bold text-gray-800 text-xl mb-1">E-postadresse</h4> <p>{{ contact.email }}</p> </div> </div> @@ -36,9 +40,9 @@ </div> <div id="faq"> <div - class="mx-auto text-center px-4 text-2xl text-primary-dark font-semibold" + class="mx-auto text-center px-4 mt-8 text-2xl text-primary-dark font-semibold" > - Frequently Asked Questions + Ofte stilte spørsmål </div> <div class="mt-8 mx-auto max-w-screen-sm lg:max-w-screen-lg flex flex-col lg:grid lg:grid-cols-2" @@ -49,7 +53,7 @@ id="question-and-answer" class="select-none cursor-pointer border-2 mx-8 my-3 px-6 py-4 rounded-lg text-sm group" > - <dt id="question"> + <dt id="question" @click="toggle(faqItem)"> <div class="flex justify-between text-gray-800"> <div class="font-bold"> {{ faqItem.question }} @@ -93,7 +97,7 @@ export default { contact: { description: "BoCo (Borrow Community) er et norsk selskap som tilbyr en plattform for utlån av gjenstander for privatpersoner og bedrifter. BoCo streber for å bli den foretrukne plattformen for lån for privatpersoner og bedrifter i Norge.", - email: "BorrowCompany@BorrowCommunity.com", + email: "kontakt@boco.no", address: "O. S. Bragstads Plass 2G", city: "Trondheim", country: "Norge", diff --git a/src/views/FormViews/LoginView.vue b/src/views/UserAuthViews/LoginView.vue similarity index 74% rename from src/views/FormViews/LoginView.vue rename to src/views/UserAuthViews/LoginView.vue index ec6fa68a7c9b217e2d199d2bd8b9d8781556343a..6ab7e4ca537206fceb2a2b1628d374b6aee0e8fb 100644 --- a/src/views/FormViews/LoginView.vue +++ b/src/views/UserAuthViews/LoginView.vue @@ -5,7 +5,7 @@ </template> <script> -import LoginForm from "@/components/FormComponents/LoginForm"; +import LoginForm from "@/components/UserAuthComponents/LoginForm"; export default { name: "LoginView.vue", components: { diff --git a/src/views/FormViews/NewPasswordView.vue b/src/views/UserAuthViews/NewPasswordView.vue similarity index 73% rename from src/views/FormViews/NewPasswordView.vue rename to src/views/UserAuthViews/NewPasswordView.vue index 1c08586c58f04a984fa22a5af77219c79907c145..890a8f524b4490c03ba510c85c2dfc429b228143 100644 --- a/src/views/FormViews/NewPasswordView.vue +++ b/src/views/UserAuthViews/NewPasswordView.vue @@ -5,7 +5,7 @@ </template> <script> -import NewPasswordForm from "@/components/FormComponents/NewPasswordForm"; +import NewPasswordForm from "@/components/UserAuthComponents/NewPasswordForm"; export default { name: "NewPasswordView.vue", components: { diff --git a/src/views/FormViews/RegisterView.vue b/src/views/UserAuthViews/RegisterView.vue similarity index 67% rename from src/views/FormViews/RegisterView.vue rename to src/views/UserAuthViews/RegisterView.vue index 93013987e5e31384c4391768e5468a6bc77df35d..0bf15f1143c38c4bf7fd336ca82afb2a302b9073 100644 --- a/src/views/FormViews/RegisterView.vue +++ b/src/views/UserAuthViews/RegisterView.vue @@ -5,7 +5,7 @@ </template> <script> -import RegisterFormComponent from "../../components/FormComponents/RegisterForm.vue"; +import RegisterFormComponent from "../../components/UserAuthComponents/RegisterForm.vue"; export default { components: { diff --git a/src/views/FormViews/ResetPasswordView.vue b/src/views/UserAuthViews/ResetPasswordView.vue similarity index 73% rename from src/views/FormViews/ResetPasswordView.vue rename to src/views/UserAuthViews/ResetPasswordView.vue index 284c4fe3582728f817ad5fb7b6fbb98373dd38dc..3bb12c1738c08a4578fb2d381dd52cb86a7032a3 100644 --- a/src/views/FormViews/ResetPasswordView.vue +++ b/src/views/UserAuthViews/ResetPasswordView.vue @@ -5,7 +5,7 @@ </template> <script> -import ResetPassword from "@/components/FormComponents/ResetPasswordForm"; +import ResetPassword from "@/components/UserAuthComponents/ResetPasswordForm"; export default { name: "ResetPasswordView.vue", components: { diff --git a/tailwind.config.js b/tailwind.config.js index 65380e429009105b923a55266f6b301464b97a88..d8ef3f55c175f5952769a6b41dec929ef3533f4d 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -24,7 +24,7 @@ module.exports = { primary: { light: "#306EC1", medium: "#004aad", - dark: "#003884", + dark: "#002B66", }, secondary: { light: "#653273", diff --git a/tests/unit/component-tests/community-component-tests/__snapshots__/community-list-item.spec.js.snap b/tests/unit/component-tests/community-component-tests/__snapshots__/community-list-item.spec.js.snap index 6ea43db8f525841f2ff49a8c9a1d45066552348b..4edde89c2c743d9c2411aa4a1a5c1403b7077c70 100644 --- a/tests/unit/component-tests/community-component-tests/__snapshots__/community-list-item.spec.js.snap +++ b/tests/unit/component-tests/community-component-tests/__snapshots__/community-list-item.spec.js.snap @@ -22,7 +22,7 @@ exports[`CommunityListItem component renders correctly 1`] = ` class="flex-1 pl-1 overflow-hidden" > <div - class="font-medium dark:text-white truncate" + class="font-medium text-gray-800 dark:text-white truncate" > string </div> diff --git a/tests/unit/component-tests/community-component-tests/__snapshots__/community-list.spec.js.snap b/tests/unit/component-tests/community-component-tests/__snapshots__/community-list.spec.js.snap index 52d4de639d8683ee0b575f40d2290c6ad383d554..a385829acb32b11671e1d9788b5b401b95c4d892 100644 --- a/tests/unit/component-tests/community-component-tests/__snapshots__/community-list.spec.js.snap +++ b/tests/unit/component-tests/community-component-tests/__snapshots__/community-list.spec.js.snap @@ -27,7 +27,7 @@ exports[`CommunityList component renders correctly 1`] = ` class="flex-1 pl-1 overflow-hidden" > <div - class="font-medium dark:text-white truncate" + class="font-medium text-gray-800 dark:text-white truncate" > string </div> @@ -78,7 +78,7 @@ exports[`CommunityList component renders correctly 1`] = ` class="flex-1 pl-1 overflow-hidden" > <div - class="font-medium dark:text-white truncate" + class="font-medium text-gray-800 dark:text-white truncate" > string </div> diff --git a/tests/unit/component-tests/user-component-tests/login-form.spec.js b/tests/unit/component-tests/user-component-tests/login-form.spec.js index 40fa711393e969435a609474c0f550f179513135..bb0285db4c868fa9acc66080b46d0fa184cceb7e 100644 --- a/tests/unit/component-tests/user-component-tests/login-form.spec.js +++ b/tests/unit/component-tests/user-component-tests/login-form.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import LoginForm from "@/components/FormComponents/LoginForm.vue"; +import LoginForm from "@/components/UserAuthComponents/LoginForm.vue"; describe("LoginForm component", () => { let wrapper; diff --git a/tests/unit/component-tests/user-component-tests/new-password-form.spec.js b/tests/unit/component-tests/user-component-tests/new-password-form.spec.js index 638e597bd9b130a6b2a1c69a0b724b3414436648..3d52388c9b35a953ceca35a27a87c578f603135e 100644 --- a/tests/unit/component-tests/user-component-tests/new-password-form.spec.js +++ b/tests/unit/component-tests/user-component-tests/new-password-form.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import NewPasswordForm from "@/components/FormComponents/NewPasswordForm.vue"; +import NewPasswordForm from "@/components/UserAuthComponents/NewPasswordForm.vue"; describe("NewPasswordForm component", () => { let wrapper; diff --git a/tests/unit/component-tests/user-component-tests/register-user-component.spec.js b/tests/unit/component-tests/user-component-tests/register-user-component.spec.js index 9accd167543e4b2291397821c4aeaedf42804313..4c2ca3b84153c1a1f12b75765948b59a59dc6262 100644 --- a/tests/unit/component-tests/user-component-tests/register-user-component.spec.js +++ b/tests/unit/component-tests/user-component-tests/register-user-component.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import RegisterFormComponent from "@/components/FormComponents/RegisterForm"; +import RegisterFormComponent from "@/components/UserAuthComponents/RegisterForm"; describe("RegisterFormComponent", () => { let wrapper; diff --git a/tests/unit/component-tests/user-component-tests/reset-password-form.spec.js b/tests/unit/component-tests/user-component-tests/reset-password-form.spec.js index 1dc9f0a4f379129d888436a42d40bf354ae56f66..45f67cef373d59a5d51850d424378a3af218490c 100644 --- a/tests/unit/component-tests/user-component-tests/reset-password-form.spec.js +++ b/tests/unit/component-tests/user-component-tests/reset-password-form.spec.js @@ -1,5 +1,5 @@ import { mount } from "@vue/test-utils"; -import ResetPasswordForm from "@/components/FormComponents/ResetPasswordForm.vue"; +import ResetPasswordForm from "@/components/UserAuthComponents/ResetPasswordForm.vue"; describe("ResetPasswordForm component", () => { let wrapper;