diff --git a/src/components/BaseComponents/NavBar.vue b/src/components/BaseComponents/NavBar.vue index 80dc7942f0d84a5b16b4fea9f89b4ea8a3082562..58020e292abccaa07ac2e7cfa6d66f30961e42fc 100644 --- a/src/components/BaseComponents/NavBar.vue +++ b/src/components/BaseComponents/NavBar.vue @@ -15,7 +15,7 @@ <PlusIcon class="m-6 cursor-pointer h-7" alt="Legg til" - @click="$router.push('/addNewItem')" + @click="$router.push('/newItem')" /> </li> <li> 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 ad731fac58a79886653e6e2e25334c31c1e7bb74..badc88b33e5961701c1f83fa004420df60af97f4 100644 --- a/src/components/CommunityComponents/CommunityHome.vue +++ b/src/components/CommunityComponents/CommunityHome.vue @@ -41,7 +41,7 @@ </template> <script> -import ItemCard from "@/components/CommunityComponents/ItemCard"; +import ItemCard from "@/components/ItemComponents/ItemCard"; import CommunityHeader from "@/components/BaseComponents/CommunityHeader"; import { GetCommunity, GetListingsInCommunity } from "@/utils/apiutil"; export default { 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 100% rename from src/components/CommunityComponents/NewItemForm.vue rename to src/components/ItemComponents/NewItemForm.vue 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/LargeProfileCard.vue b/src/components/UserProfileComponents/LargeProfileCard.vue index 4b88012ec203c64c4f59a250b80a3fa780255d00..7ee44e43946ce93d577ae888efc9923d71f7aacc 100644 --- a/src/components/UserProfileComponents/LargeProfileCard.vue +++ b/src/components/UserProfileComponents/LargeProfileCard.vue @@ -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..ec15f922c12aec8be23ae29104abc6be91972fb2 100644 --- a/src/views/CommunityViews/CommunityView.vue +++ b/src/views/CommunityViews/CommunityView.vue @@ -4,7 +4,7 @@ <p class="capitalize font-bold w-full">Mine felleskap</p> <PlusIcon 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" /> diff --git a/src/views/CommunityViews/NewItemView.vue b/src/views/ItemViews/NewItemView.vue similarity index 75% rename from src/views/CommunityViews/NewItemView.vue rename to src/views/ItemViews/NewItemView.vue index 172ba809e4d552ba05319941ed1921b859e7ac28..fa8ba75077b76aa1a1af647d9b54ea9bf599a7ac 100644 --- a/src/views/CommunityViews/NewItemView.vue +++ b/src/views/ItemViews/NewItemView.vue @@ -6,7 +6,7 @@ </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/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;