From f571a2339520edf796f6c3674dad0ead2f17d4d1 Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Tue, 16 Jul 2024 14:58:17 +0200 Subject: [PATCH 1/7] Able to save podName into store --- loama/src/components/Header.vue | 43 ++++++++-------------- loama/src/components/HeaderContextMenu.vue | 40 ++++++++++++++++++++ loama/src/components/PodList.vue | 1 - loama/src/router/index.ts | 9 ++++- loama/src/store.ts | 7 +++- loama/src/views/HomeView.vue | 6 ++- 6 files changed, 72 insertions(+), 34 deletions(-) create mode 100644 loama/src/components/HeaderContextMenu.vue diff --git a/loama/src/components/Header.vue b/loama/src/components/Header.vue index 792dbac..ef85d83 100644 --- a/loama/src/components/Header.vue +++ b/loama/src/components/Header.vue @@ -1,26 +1,17 @@ \ No newline at end of file diff --git a/loama/src/components/HeaderContextMenu.vue b/loama/src/components/HeaderContextMenu.vue new file mode 100644 index 0000000..8ceb311 --- /dev/null +++ b/loama/src/components/HeaderContextMenu.vue @@ -0,0 +1,40 @@ + + + + + \ No newline at end of file diff --git a/loama/src/components/PodList.vue b/loama/src/components/PodList.vue index 25fd152..e6b3196 100644 --- a/loama/src/components/PodList.vue +++ b/loama/src/components/PodList.vue @@ -39,7 +39,6 @@ import { Permission } from "loama-controller/dist/types"; import { ref } from "vue"; const pods = await listPods(store.session as Session); - const indexFile = ref(await getOrCreateIndex(store.session as Session, pods[0])); // .then((index) => addPermissions(store.session, index, ["example.com"], true, [Permission.Read])) // const pods = [await listPod(store.session, "https://css12.onto-deside.ilabt.imec.be/osoc5/")] diff --git a/loama/src/router/index.ts b/loama/src/router/index.ts index f9fa8cd..ff80039 100644 --- a/loama/src/router/index.ts +++ b/loama/src/router/index.ts @@ -2,6 +2,8 @@ import { createRouter, createWebHistory } from 'vue-router' import HomeView from '@/views/HomeView.vue' import LandingView from '@/views/LandingView.vue' import { store } from '@/store' +import { listPods } from 'loama-controller' +import type { Session } from '@inrupt/solid-client-authn-browser' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -22,8 +24,11 @@ const router = createRouter({ router.beforeEach(async (to) => { console.log(store.session.info) if (!store.session.info.isLoggedIn) { - await store.session.handleIncomingRedirect() - + await store.session.handleIncomingRedirect(); + console.log(store.session.info) + if(store.session.info.isLoggedIn){ + store.setUsedPod((await listPods(store.session as Session))[0]) + } if (!store.session.info.isLoggedIn && to.name !== 'landing') { return { name: 'landing' } } diff --git a/loama/src/store.ts b/loama/src/store.ts index 32c865f..07ef5c3 100644 --- a/loama/src/store.ts +++ b/loama/src/store.ts @@ -1,4 +1,9 @@ import { getDefaultSession } from '@inrupt/solid-client-authn-browser' import { reactive } from 'vue' -export const store = reactive({ session: getDefaultSession(), usedPod: "" }) +export const store = reactive({ + session: getDefaultSession(), + usedPod: "", + setUsedPod(url:string) { + this.usedPod = url + }}) diff --git a/loama/src/views/HomeView.vue b/loama/src/views/HomeView.vue index 0689dd7..2318721 100644 --- a/loama/src/views/HomeView.vue +++ b/loama/src/views/HomeView.vue @@ -1,7 +1,9 @@ From 1737a97ae9ecc42f651b0e612f07ea50dccf522b Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Wed, 17 Jul 2024 11:26:24 +0200 Subject: [PATCH 4/7] Created share button & component 'IconButton' --- loama/src/components/IconButton.vue | 63 ++++++++++++++++++++++ loama/src/components/header/HeaderBase.vue | 20 +++---- 2 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 loama/src/components/IconButton.vue diff --git a/loama/src/components/IconButton.vue b/loama/src/components/IconButton.vue new file mode 100644 index 0000000..e7b7a60 --- /dev/null +++ b/loama/src/components/IconButton.vue @@ -0,0 +1,63 @@ + + + + + \ No newline at end of file diff --git a/loama/src/components/header/HeaderBase.vue b/loama/src/components/header/HeaderBase.vue index 6f8a4ad..3fe9449 100644 --- a/loama/src/components/header/HeaderBase.vue +++ b/loama/src/components/header/HeaderBase.vue @@ -6,8 +6,8 @@ - User profile picture @@ -21,19 +21,16 @@ \ No newline at end of file diff --git a/loama/src/router/index.ts b/loama/src/router/index.ts index 189695d..d3a38ea 100644 --- a/loama/src/router/index.ts +++ b/loama/src/router/index.ts @@ -22,10 +22,8 @@ const router = createRouter({ }) router.beforeEach(async (to) => { - console.log(store.session.info) if (!store.session.info.isLoggedIn) { await store.session.handleIncomingRedirect(); - console.log(store.session.info) if(store.session.info.isLoggedIn){ store.setUsedPod((await listPods(store.session as Session))[0]) } From 69f001df333cdc009fd2dac70cd3edc6bc7024a1 Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Wed, 17 Jul 2024 12:15:14 +0200 Subject: [PATCH 7/7] Applied semantic suggestion from PR --- loama/src/components/LoButton.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loama/src/components/LoButton.vue b/loama/src/components/LoButton.vue index e7b7a60..d678051 100644 --- a/loama/src/components/LoButton.vue +++ b/loama/src/components/LoButton.vue @@ -1,5 +1,5 @@