Skip to content
Snippets Groups Projects
Commit a8609a3a authored by Titus Netland's avatar Titus Netland
Browse files

Merge branch 'refactoring' into 'main'

Refactoring

See merge request !74
parents 9d049414 684ae061
Branches
No related tags found
1 merge request!74Refactoring
Pipeline #179158 passed
Showing
with 30 additions and 34 deletions
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<PlusIcon <PlusIcon
class="m-6 cursor-pointer h-7" class="m-6 cursor-pointer h-7"
alt="Legg til" alt="Legg til"
@click="$router.push('/addNewItem')" @click="$router.push('/newItem')"
/> />
</li> </li>
<li> <li>
......
...@@ -6,21 +6,21 @@ ...@@ -6,21 +6,21 @@
<ul class="py-1"> <ul class="py-1">
<li id="newItem"> <li id="newItem">
<router-link <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" 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 >Opprett Utleie</router-link
> >
</li> </li>
<li id="getMembers"> <li id="getMembers">
<router-link <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" 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 >Se Medlemmer
</router-link> </router-link>
</li> </li>
<li id="adminGroup"> <li id="adminGroup">
<router-link <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" 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 >Administrer Gruppe</router-link
> >
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</template> </template>
<script> <script>
import ItemCard from "@/components/CommunityComponents/ItemCard"; import ItemCard from "@/components/ItemComponents/ItemCard";
import CommunityHeader from "@/components/BaseComponents/CommunityHeader"; import CommunityHeader from "@/components/BaseComponents/CommunityHeader";
import { GetCommunity, GetListingsInCommunity } from "@/utils/apiutil"; import { GetCommunity, GetListingsInCommunity } from "@/utils/apiutil";
export default { export default {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</template> </template>
<script> <script>
import ItemCard from "@/components/CommunityComponents/ItemCard"; import ItemCard from "@/components/ItemComponents/ItemCard";
export default { export default {
name: "SearchItemListComponent", name: "SearchItemListComponent",
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</li> </li>
<li> <li>
<router-link <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" 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 >Mine grupper
</router-link> </router-link>
......
import store from "@/store"; import store from "@/store";
import { createRouter, createWebHistory } from "vue-router"; 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 * Guards routes. If token is null, no user is logged in and only the
...@@ -21,7 +18,7 @@ const routes = [ ...@@ -21,7 +18,7 @@ const routes = [
{ {
path: "/", path: "/",
name: "home", name: "home",
component: HomeView, component: () => import("../views/CommunityViews/CommunityView.vue"),
}, },
{ {
path: "/profile/:id", path: "/profile/:id",
...@@ -37,27 +34,24 @@ const routes = [ ...@@ -37,27 +34,24 @@ const routes = [
{ {
path: "/messages", path: "/messages",
name: "messages", name: "messages",
component: () => component: () => import("../views/ChatViews/ChatView.vue"),
import(
/* webpackChunkName: "register" */ "../views/ChatViews/ChatView.vue"
),
beforeEnter: guardRoute, beforeEnter: guardRoute,
}, },
{ {
path: "/login", path: "/login",
name: "login", name: "login",
component: LoginView, component: () => import("../views/FormViews/LoginView.vue"),
}, },
{ {
path: "/newPassword", path: "/newPassword",
name: "newPassword", name: "newPassword",
component: NewPasswordView, component: () => import("../views/FormViews/NewPasswordView"),
beforeEnter: guardRoute, beforeEnter: guardRoute,
}, },
{ {
path: "/searchItemList", path: "/searchItemList",
name: "searchItemList", name: "searchItemList",
component: () => import("../views/CommunityViews/SearchItemListView.vue"), component: () => import("../views/ItemViews/SearchItemListView.vue"),
}, },
{ {
path: "/resetPassword", path: "/resetPassword",
...@@ -65,20 +59,21 @@ const routes = [ ...@@ -65,20 +59,21 @@ const routes = [
component: () => import("../views/FormViews/ResetPasswordView.vue"), component: () => import("../views/FormViews/ResetPasswordView.vue"),
}, },
{ {
path: "/createNewGroup", path: "/newCommunity",
name: "createNewGroup", name: "newCommunity",
component: () => import("../views/CommunityViews/NewCommunityView.vue"), component: () => import("../views/CommunityViews/NewCommunityView.vue"),
beforeEnter: guardRoute,
}, },
{ {
path: "/group/:id/memberlist", path: "/community/:id/memberlist",
name: "memberlist", name: "memberlist",
component: () => import("../views/CommunityViews/MemberListView.vue"), component: () => import("../views/CommunityViews/MemberListView.vue"),
beforeEnter: guardRoute, beforeEnter: guardRoute,
}, },
{ {
path: "/addNewItem", path: "/newItem",
name: "addNewItem", name: "newItem",
component: () => import("../views/CommunityViews/NewItemView.vue"), component: () => import("../views/ItemViews/NewItemView.vue"),
beforeEnter: guardRoute, beforeEnter: guardRoute,
}, },
{ {
...@@ -88,13 +83,14 @@ const routes = [ ...@@ -88,13 +83,14 @@ const routes = [
beforeEnter: guardRoute, beforeEnter: guardRoute,
}, },
{ {
path: "/user/:id/groups", path: "/user/:id/communities",
name: "myGroups", name: "myCommunities",
component: () => import("../views/CommunityViews/MyCommunitiesView.vue"), component: () => import("../views/CommunityViews/MyCommunitiesView.vue"),
beforeEnter: guardRoute,
}, },
{ {
path: "/community/:communityID", path: "/community/:communityID",
name: "GroupHome", name: "communityHome",
component: () => import("../views/CommunityViews/CommunityHomeView.vue"), component: () => import("../views/CommunityViews/CommunityHomeView.vue"),
}, },
{ {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<p class="capitalize font-bold w-full">Mine felleskap</p> <p class="capitalize font-bold w-full">Mine felleskap</p>
<PlusIcon <PlusIcon
class="cursor-pointer max-h-6 max-w-6 float-right grow" class="cursor-pointer max-h-6 max-w-6 float-right grow"
@click="$router.push('/createNewGroup')" @click="$router.push('/newCommunity')"
v-if="loggedIn" v-if="loggedIn"
alt="Lag ett nytt felleskap" alt="Lag ett nytt felleskap"
/> />
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</template> </template>
<script> <script>
import AddNewItem from "@/components/CommunityComponents/NewItemForm"; import AddNewItem from "@/components/ItemComponents/NewItemForm";
export default { export default {
name: "AddNewItemView.vue", name: "AddNewItemView.vue",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
</template> </template>
<script> <script>
import SearchItemListComponent from "@/components/CommunityComponents/SearchItemList"; import SearchItemListComponent from "@/components/ItemComponents/SearchItemList";
export default { export default {
name: "SearchItemListView", name: "SearchItemListView",
components: { components: {
......
import { shallowMount } from "@vue/test-utils"; import { shallowMount } from "@vue/test-utils";
import AddNewItem from "@/components/CommunityComponents/NewItemForm.vue"; import AddNewItem from "@/components/ItemComponents/NewItemForm.vue";
describe("addNewItem elements rendering", () => { describe("addNewItem elements rendering", () => {
it("renders all labels", () => { it("renders all labels", () => {
......
import { mount } from "@vue/test-utils"; import { mount } from "@vue/test-utils";
import ItemCard from "@/components/CommunityComponents/ItemCard.vue"; import ItemCard from "@/components/ItemComponents/ItemCard.vue";
describe("ItemCard component", () => { describe("ItemCard component", () => {
let wrapper; let wrapper;
......
import { mount } from "@vue/test-utils"; import { mount } from "@vue/test-utils";
import NewItemForm from "@/components/CommunityComponents/NewItemForm.vue"; import NewItemForm from "@/components/ItemComponents/NewItemForm.vue";
describe("NewItemForm component", () => { describe("NewItemForm component", () => {
let wrapper; let wrapper;
......
import { shallowMount } from "@vue/test-utils"; import { shallowMount } from "@vue/test-utils";
import SearchItemListComponent from "@/components/CommunityComponents/SearchItemList.vue"; import SearchItemListComponent from "@/components/ItemComponents/SearchItemList.vue";
describe("SearchItemListComponent elements rendering", () => { describe("SearchItemListComponent elements rendering", () => {
let wrapper; let wrapper;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment