From 4b042a52df7e26fedb3923d019b73679079cc7fa Mon Sep 17 00:00:00 2001 From: Johnathan Clementi Date: Wed, 4 Dec 2024 15:49:13 -0500 Subject: [PATCH] make scheme card compoent more atomic re. pr feedback #16 --- .../components/scheme/SchemeCard.vue | 46 ++++++++++++++----- .../src/arches_lingo/pages/SchemeList.vue | 46 +++++++------------ arches_lingo/src/arches_lingo/types.ts | 7 ++- 3 files changed, 56 insertions(+), 43 deletions(-) diff --git a/arches_lingo/src/arches_lingo/components/scheme/SchemeCard.vue b/arches_lingo/src/arches_lingo/components/scheme/SchemeCard.vue index a221702b..75011e10 100644 --- a/arches_lingo/src/arches_lingo/components/scheme/SchemeCard.vue +++ b/arches_lingo/src/arches_lingo/components/scheme/SchemeCard.vue @@ -1,43 +1,65 @@ diff --git a/arches_lingo/src/arches_lingo/pages/SchemeList.vue b/arches_lingo/src/arches_lingo/pages/SchemeList.vue index 6a276267..d91fd843 100644 --- a/arches_lingo/src/arches_lingo/pages/SchemeList.vue +++ b/arches_lingo/src/arches_lingo/pages/SchemeList.vue @@ -3,34 +3,30 @@ import { onMounted, ref } from "vue"; import SchemeCard from "@/arches_lingo/components/scheme/SchemeCard.vue"; import { fetchSchemes } from "@/arches_lingo/api.ts"; -import type { SchemeDescriptor } from "@/arches_lingo/types"; +import type { SchemeResource } from "@/arches_lingo/types"; -const schemes = ref([]); +const schemes = ref([]); onMounted(async () => { schemes.value = await fetchSchemes(); + schemes.value.unshift({ + resourceinstanceid: "placeholder-id", + descriptors: { + en: { + name: "Create a new scheme", + description: "This is a placeholder to create a new scheme", + }, + }, + } as SchemeResource); }); diff --git a/arches_lingo/src/arches_lingo/types.ts b/arches_lingo/src/arches_lingo/types.ts index 0aaaf13f..cebeea20 100644 --- a/arches_lingo/src/arches_lingo/types.ts +++ b/arches_lingo/src/arches_lingo/types.ts @@ -66,7 +66,7 @@ export interface SchemeNamespace { export type DataComponentMode = "edit" | "view"; -export interface SchemeDescriptor { +export interface SchemeResource { resourceinstanceid: string; descriptors: { [key: string]: { @@ -76,6 +76,11 @@ export interface SchemeDescriptor { }; } +export interface ResourceDescriptor { + name: string; + description: string; +} + export interface NodeAndParentInstruction { node: TreeNode; shouldHideSiblings: boolean;