From 9354e284e3aa478d8228e95ecae15d48a2c31721 Mon Sep 17 00:00:00 2001 From: djhonantanparreira Date: Sat, 3 Aug 2024 16:15:08 -0300 Subject: [PATCH 01/22] Create dashboard vue and sidebar component --- src/components/dashboard/Sidebar.vue | 167 ++++++++++++++++++++++++++ src/components/icons/DiscordIcon.vue | 8 ++ src/components/icons/Rectangle.png | Bin 0 -> 1048 bytes src/components/icons/SearchIcon.vue | 34 ++++++ src/router/index.js | 126 ++++++++++--------- src/views/dashboard/DashboardView.vue | 58 +++++++++ 6 files changed, 334 insertions(+), 59 deletions(-) create mode 100644 src/components/dashboard/Sidebar.vue create mode 100644 src/components/icons/DiscordIcon.vue create mode 100644 src/components/icons/Rectangle.png create mode 100644 src/components/icons/SearchIcon.vue create mode 100644 src/views/dashboard/DashboardView.vue diff --git a/src/components/dashboard/Sidebar.vue b/src/components/dashboard/Sidebar.vue new file mode 100644 index 0000000..7bf1acd --- /dev/null +++ b/src/components/dashboard/Sidebar.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/icons/DiscordIcon.vue b/src/components/icons/DiscordIcon.vue new file mode 100644 index 0000000..bd23da3 --- /dev/null +++ b/src/components/icons/DiscordIcon.vue @@ -0,0 +1,8 @@ + diff --git a/src/components/icons/Rectangle.png b/src/components/icons/Rectangle.png new file mode 100644 index 0000000000000000000000000000000000000000..1e12fd242a2f9b64f10675d8657cc8c45b241e2f GIT binary patch literal 1048 zcmV+z1n2vSP)ktMV9QcVZ)|B0n{C0QwflQ zK(W+9X&qH@A&HwbA+{6Z`kApEKj+20fWxcst&=wDEkhi5PH3x97iJD3F`qeshtyBtr?+>Db#dMqQZA0&06D)QvhE zUlixwyaH9#KnU^nxUMUo26dh5!j*oz9WM36>pAHzZKSz4aoNk-D_VMjRh zP_6unR!5ZDWyn6t!D!dL$i%flogwPwonw&kpwB=gRZY{dv$qQtPC)GsF{K2BRvbMc zdwXblRW(fqokr>S$VkA+K^UVGPv|L);MVP55J-j)n+-vatN1lnM6o%7U!@2r4jQE` zxQ_iIkayfAby!e>2`FTMYWqM4T*6_$jng46iXfPqBg{mnk&OFb_B)b-=g&{}jpK+i zGLFRAE6_uEgd?+XUt!Sv0qh!CBu+8(Mb*x~ni4g$F|vgCaL4^S25`nhl)KucSlh_s zw|_*nD8t;D*N}SoEKWy4(1?r36h}mlLz~jEzV;C7kMpoZ3-O~4M&|x97BhD|oj!Oy ziF&JxOl})YQ4qHZNY2ENoK1)vd|uF6*TGLqe?nEV_~Ns#z&^Zj-Mndz)GO{>LWD1CFvWzW7`MV`KBlr~LCT=X3f@ z`Vt}RBYC$-+O}hfNG$=R$s;PX6PKAtf46dgt(u8_i@QPeZRcCZ2S-PLz9QY StE8O(0000 + + + + + + + diff --git a/src/router/index.js b/src/router/index.js index 55a3350..bee5698 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -17,6 +17,9 @@ import SquadCreateView from '../views/squad/CreateView.vue' import { useAuthStore } from '@/stores/auth'; +// dashboard +import DashboardView from '@/views/dashboard/DashboardView.vue' + const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -39,89 +42,89 @@ const router = createRouter({ { path: '/profile', name: 'profile', - component: ProfileView, - meta : { - auth: true - } - }, - { - path: '/products', - name: 'products', - component: ProductsView, - meta : { - auth: false - } - }, + component: ProfileView, + meta: { + auth: true + } + }, + { + path: '/products', + name: 'products', + component: ProductsView, + meta: { + auth: false + } + }, { path: '/product/:uuid', name: 'product-by-id', component: ProductView, - meta : { - auth: true - } + meta: { + auth: true + } }, { - path: '/product/create', - name: 'product-create', - component: ProductRegistryView, - meta : { - auth: true, - update: false - } + path: '/product/create', + name: 'product-create', + component: ProductRegistryView, + meta: { + auth: true, + update: false + } }, { - path: '/product/:uuid/update', - name: 'product-update', - component: ProductRegistryView, - meta : { - auth: true, - update: true - } + path: '/product/:uuid/update', + name: 'product-update', + component: ProductRegistryView, + meta: { + auth: true, + update: true + } }, { path: '/squads/:uuid', name: 'squads', - component: SquadsView, - meta : { - auth: true - } + component: SquadsView, + meta: { + auth: true + } }, { path: '/squad/:uuid', name: 'squad-by-id', component: SquadView, - props: true, - meta : { - auth: true - } + props: true, + meta: { + auth: true + } }, { path: '/squad/create/:productUuid', name: 'squad-create', component: SquadCreateView, - meta : { - auth: true, - type: 'create' - } + meta: { + auth: true, + type: 'create' + } }, { path: '/squad/:uuid/update', name: 'squad-update', component: SquadCreateView, - meta : { - auth: true, - type: 'update' - } + meta: { + auth: true, + type: 'update' + } }, { path: '/onboarding', name: 'onboarding', component: () => import('../views/OnboardingView.vue'), - meta : { - auth: true - } + meta: { + auth: true + } }, { path: '/about', @@ -132,24 +135,29 @@ const router = createRouter({ path: '/404', name: 'not-found', component: () => import('../views/NotFoundView.vue') - } + }, + { + path: '/dashboard', + name: 'dashboard', + component: DashboardView + }, ] }) router.beforeEach((to, from, next) => { - const token = localStorage.getItem('token') + const token = localStorage.getItem('token') - const auth = useAuthStore(); + const auth = useAuthStore(); - if (to.meta.auth === true && (token === '' || token === null)) { - router.push({ name: 'login' }) - } + if (to.meta.auth === true && (token === '' || token === null)) { + router.push({ name: 'login' }) + } - if (auth.auth.name === '') { - auth.loginByToken() - } + if (auth.auth.name === '') { + auth.loginByToken() + } - return next() + return next() }); export default router diff --git a/src/views/dashboard/DashboardView.vue b/src/views/dashboard/DashboardView.vue new file mode 100644 index 0000000..bfa707e --- /dev/null +++ b/src/views/dashboard/DashboardView.vue @@ -0,0 +1,58 @@ + + + + + From c6ed4d8a6f0b70a9256cf99cd23d90c6363afef1 Mon Sep 17 00:00:00 2001 From: djhonantanparreira Date: Sun, 25 Aug 2024 14:50:21 -0300 Subject: [PATCH 02/22] Refactor App.vue: add sidebar component for dashboard navigation --- .env | 1 - src/App.vue | 31 ++- src/assets/default-avatar.png | Bin 0 -> 294267 bytes src/components/dashboard/Sidebar.vue | 388 ++++++++++++++++++++------- 4 files changed, 317 insertions(+), 103 deletions(-) delete mode 100644 .env create mode 100644 src/assets/default-avatar.png diff --git a/.env b/.env deleted file mode 100644 index 48b9d90..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -VITE_API_URL=https://h57es3eyha.us-east-1.awsapprunner.com \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 83906be..7e7900e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,15 +1,17 @@