diff --git a/controller/src/pod.ts b/controller/src/pod.ts index 99f1de2..d301ffa 100644 --- a/controller/src/pod.ts +++ b/controller/src/pod.ts @@ -16,8 +16,7 @@ import { getPublicAccess, } from "@inrupt/solid-client/universal"; import { Session } from "@inrupt/solid-client-authn-browser"; -// import { FOAF } from "@inrupt/vocab-common-rdf"; -import { Permission, url, Post, Appointment } from "./types"; +import { Permission, url, Post, Appointment, FormattedThing } from "./types"; import { Schema } from "./index"; /** @@ -44,13 +43,7 @@ export async function getPod(session: Session, url: url) { async function listThings( session: Session, url: url -): Promise< - { - url: url; - properties: url[]; - accessModes: Record; - }[] -> { +): Promise { const dataset = await getSolidDataset(url, { fetch: session.fetch }); return Promise.all( getThingAll(dataset).map(async (t) => ({ @@ -87,6 +80,9 @@ async function getAccessModes( function accessModesToPermissions( record: Record ): Record { + const result: { + [agent: string]: Permission[] + } = {}; // List -> Set -> List is done to filter out possible duplicate Permission.Control's const mapToPermission = (accessModes: [string, boolean][]) => [ ...new Set( @@ -110,11 +106,11 @@ function accessModesToPermissions( ), ]; - return Object.assign( - Object.entries(record).map(([agent, accessModes]) => ({ - [agent]: mapToPermission(Object.entries(accessModes)), - })) - ); + Object.entries(record).forEach(([agent, accessModes]) => { + result[agent] = mapToPermission(Object.entries(accessModes)); + }); + + return result; } /** diff --git a/controller/src/types.ts b/controller/src/types.ts index 7e053e4..acfb5d0 100644 --- a/controller/src/types.ts +++ b/controller/src/types.ts @@ -39,6 +39,13 @@ export enum Type { export type url = string; +export interface FormattedThing { + url: url; + properties: url[]; + accessModes: Record; +} +[]; + export interface Post { text: string; video?: string; diff --git a/loama/README.md b/loama/README.md index 665bc72..a1ece0e 100644 --- a/loama/README.md +++ b/loama/README.md @@ -1,6 +1,6 @@ # LOAMA -This is the actual Access Management App, written in Vue. +LOAMA is a Linked Open Access Management App, written in Vue. ## IDP Provider diff --git a/loama/src/assets/vault.svg b/loama/src/assets/vault.svg new file mode 100644 index 0000000..0f0efc5 --- /dev/null +++ b/loama/src/assets/vault.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/loama/src/components/LoginForm.vue b/loama/src/components/LoginForm.vue index e1e70d6..94c0fba 100644 --- a/loama/src/components/LoginForm.vue +++ b/loama/src/components/LoginForm.vue @@ -52,7 +52,7 @@ const login = () => { store.session.login({ oidcIssuer: issuer, - redirectUrl: new URL('/home', window.location.href).toString(), + redirectUrl: new URL('/home/', window.location.href).toString(), clientName: 'LOAMA', }) .then(() => { diff --git a/loama/src/components/SidePanel.vue b/loama/src/components/SidePanel.vue index 4c5693f..90ed06f 100644 --- a/loama/src/components/SidePanel.vue +++ b/loama/src/components/SidePanel.vue @@ -8,7 +8,9 @@ {{ pod.name }} - Close Panel + + Close Panel + @@ -41,6 +43,16 @@ const openPodUrl = (pod: { name: string; url: string }) => { width: 100%; margin-top: 10px; border-right: 0.25rem solid var(--solid-purple); + background-color: #f0f0f0; + width: 30%; + position: fixed; + top: 0; + left: 0; + bottom: 0; + z-index: 999; + overflow-y: auto; + padding: 20px; + margin: 0; } h2 { diff --git a/loama/src/components/explorer/ExplorerBreadcrumbs.vue b/loama/src/components/explorer/ExplorerBreadcrumbs.vue new file mode 100644 index 0000000..b6946dc --- /dev/null +++ b/loama/src/components/explorer/ExplorerBreadcrumbs.vue @@ -0,0 +1,26 @@ + + + + + \ No newline at end of file diff --git a/loama/src/components/explorer/ExplorerEntry.vue b/loama/src/components/explorer/ExplorerEntry.vue new file mode 100644 index 0000000..13c0a5b --- /dev/null +++ b/loama/src/components/explorer/ExplorerEntry.vue @@ -0,0 +1,65 @@ + + + + + \ No newline at end of file diff --git a/loama/src/components/explorer/FallbackExplorer.vue b/loama/src/components/explorer/FallbackExplorer.vue new file mode 100644 index 0000000..f17d73f --- /dev/null +++ b/loama/src/components/explorer/FallbackExplorer.vue @@ -0,0 +1,48 @@ + + + + + \ No newline at end of file diff --git a/loama/src/components/explorer/ResourceExplorer.vue b/loama/src/components/explorer/ResourceExplorer.vue new file mode 100644 index 0000000..2a9c42a --- /dev/null +++ b/loama/src/components/explorer/ResourceExplorer.vue @@ -0,0 +1,128 @@ + + + + + \ No newline at end of file diff --git a/loama/src/components/header/HeaderBase.vue b/loama/src/components/header/HeaderBase.vue index 4de316a..377aa29 100644 --- a/loama/src/components/header/HeaderBase.vue +++ b/loama/src/components/header/HeaderBase.vue @@ -61,6 +61,7 @@ header { border-radius: 0 0 var(--base-corner) var(--base-corner); border-bottom: 0.5rem solid var(--solid-purple); border-top: 0; + border-inline: 0; padding: calc(var(--base-unit)*3) calc(var(--base-unit)*6) 0 calc(var(--base-unit)*3); } @@ -94,6 +95,10 @@ img { width: calc(var(--base-unit)*8); } +img:hover { + cursor: pointer; +} + .hidden { display: none; } diff --git a/loama/src/components/header/HeaderContextMenu.vue b/loama/src/components/header/HeaderContextMenu.vue index b38818c..fa954e3 100644 --- a/loama/src/components/header/HeaderContextMenu.vue +++ b/loama/src/components/header/HeaderContextMenu.vue @@ -3,12 +3,12 @@ {{ store.usedPod }}
- +
- + Sign out @@ -24,30 +24,35 @@ const pods = await listPods(store.session as Session); async function logout() { store.session.logout(); - router.push('/'); + router.push('/'); }