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

Refactoring and renaming to standard names

parent 9d049414
No related branches found
No related tags found
1 merge request!74Refactoring
Pipeline #179154 passed
Showing with 23 additions and 27 deletions
...@@ -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",
......
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,9 +59,10 @@ const routes = [ ...@@ -65,9 +59,10 @@ 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: "/group/:id/memberlist",
...@@ -76,9 +71,9 @@ const routes = [ ...@@ -76,9 +71,9 @@ const routes = [
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"),
}, },
{ {
......
...@@ -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.
Finish editing this message first!
Please register or to comment