From 29520d8586669d0a53e78837e83f125f0588c725 Mon Sep 17 00:00:00 2001 From: Fledge Shiu Date: Wed, 16 Aug 2023 12:18:06 -0400 Subject: [PATCH 01/34] Add Sidebar Template. --- frontend/src/App.vue | 12 ++---- frontend/src/components/SideBarComponent.vue | 20 ++++++++++ frontend/src/router/index.ts | 6 +++ frontend/src/views/CollectionView.vue | 41 ++++++++++++++++++++ frontend/src/views/StartView.vue | 12 +++++- 5 files changed, 80 insertions(+), 11 deletions(-) create mode 100644 frontend/src/components/SideBarComponent.vue create mode 100644 frontend/src/views/CollectionView.vue diff --git a/frontend/src/App.vue b/frontend/src/App.vue index cea4a3a3..cf616d33 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,18 +1,12 @@ diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index f3327893..aac4af88 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -1,6 +1,7 @@ import PrivacyAndCookieStatement from '@/views/PrivacyAndCookieStatement.vue' import StartView from '@/views/StartView.vue' import TermsOfService from '@/views/TermsOfService.vue' +import CollectionView from '@/views/CollectionView.vue' import { createRouter, createWebHistory } from 'vue-router' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -10,6 +11,11 @@ const router = createRouter({ name: 'start', component: StartView }, + { + path: '/test', + name: 'test', + component: CollectionView + }, { path: '/privacy-and-cookie-statement', name: 'PrivacyCookieStatement', diff --git a/frontend/src/views/CollectionView.vue b/frontend/src/views/CollectionView.vue new file mode 100644 index 00000000..046c5c2a --- /dev/null +++ b/frontend/src/views/CollectionView.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/frontend/src/views/StartView.vue b/frontend/src/views/StartView.vue index cbf3331a..8ea851b5 100644 --- a/frontend/src/views/StartView.vue +++ b/frontend/src/views/StartView.vue @@ -1,9 +1,17 @@ + + diff --git a/frontend/src/components/SideBarComponent.vue b/frontend/src/components/SideBarComponent.vue index 6582a66f..f739e73d 100644 --- a/frontend/src/components/SideBarComponent.vue +++ b/frontend/src/components/SideBarComponent.vue @@ -2,12 +2,12 @@
Collection:
-
-
- Holder +
+

FAQ

@@ -17,4 +17,28 @@ diff --git a/frontend/src/constants.ts b/frontend/src/constants.ts index 8ed92106..00f40eeb 100644 --- a/frontend/src/constants.ts +++ b/frontend/src/constants.ts @@ -87,3 +87,4 @@ export type CompareFunctionType = ( a: [string, ClientVisibleFile], b: [string, ClientVisibleFile] ) => number + diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 51d33ebf..9fd579ec 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -15,11 +15,12 @@ import { faFilePen, faAngleDown, faCheck, - faSort + faSort, + faFile, } from '@fortawesome/free-solid-svg-icons' /* add icons to the library */ -library.add(faPlus, faMinus, faXmark, faTrash, faFilePen, faAngleDown, faCheck, faSort) +library.add(faPlus, faMinus, faXmark, faTrash, faFilePen, faAngleDown, faCheck, faSort, faFile) import App from './App.vue' import router from './router' diff --git a/frontend/src/utils.ts b/frontend/src/utils.ts index 9a42b041..f30f150d 100644 --- a/frontend/src/utils.ts +++ b/frontend/src/utils.ts @@ -29,3 +29,21 @@ export async function validateUser() { } return result } + +export async function createNewProject(name: string): Promise { + const storeApp = useAppStore() + const projectRequestData = { + name: name + } + try { + const createProjectResponse = await storeApp.axiosInstance.post( + '/projects', + projectRequestData + ) + return createProjectResponse.data + } catch (error: any) { + console.log('Unable to create a new project.', error) + storeApp.alertsError('Unable to create a new project.') + return null + } +} diff --git a/frontend/src/views/CollectionView.vue b/frontend/src/views/CollectionView.vue index 046c5c2a..33780903 100644 --- a/frontend/src/views/CollectionView.vue +++ b/frontend/src/views/CollectionView.vue @@ -1,10 +1,10 @@