From 37af58a27c93688e93f30054239e7d2847afe9d0 Mon Sep 17 00:00:00 2001 From: Aaron Gundel Date: Fri, 20 Dec 2024 14:10:55 -0700 Subject: [PATCH] standardizes passing a tile id to the editor instead of a whole object from the viewer --- .../arches_lingo/components/scheme/editor/SchemeEditor.vue | 4 ++-- .../arches_lingo/components/scheme/report/SchemeLabel.vue | 6 +++--- arches_lingo/src/arches_lingo/pages/SchemePage.vue | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue b/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue index c2208d31..4ccfc286 100644 --- a/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue +++ b/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue @@ -18,7 +18,7 @@ const EDIT = "edit"; const props = defineProps<{ editorMax: boolean; activeTab: string; - activeArgs: Array; + tileId?: string; }>(); const childRefs = ref>([]); const schemeComponents = [ @@ -118,7 +118,7 @@ async function updateScheme() { diff --git a/arches_lingo/src/arches_lingo/components/scheme/report/SchemeLabel.vue b/arches_lingo/src/arches_lingo/components/scheme/report/SchemeLabel.vue index e4167e8f..dfa3e463 100644 --- a/arches_lingo/src/arches_lingo/components/scheme/report/SchemeLabel.vue +++ b/arches_lingo/src/arches_lingo/components/scheme/report/SchemeLabel.vue @@ -21,11 +21,11 @@ const route = useRoute(); withDefaults( defineProps<{ mode?: DataComponentMode; - args?: Array; + tileId?: string | null; }>(), { mode: VIEW, - args: () => [], + tileId: null, // editor arg specifying what tile to operate on. }, ); @@ -56,7 +56,7 @@ function editSectionValue(tileId: string) { (tile) => tile.tileid === tileId, ); if (appellativeStatus && appellativeStatus.tileid === tileId) { - emits(OPEN_EDITOR, appellativeStatus); + emits(OPEN_EDITOR, appellativeStatus.tileid); } else { toast.add({ summary: $gettext("Error"), diff --git a/arches_lingo/src/arches_lingo/pages/SchemePage.vue b/arches_lingo/src/arches_lingo/pages/SchemePage.vue index 8bdc3122..5c852ecf 100644 --- a/arches_lingo/src/arches_lingo/pages/SchemePage.vue +++ b/arches_lingo/src/arches_lingo/pages/SchemePage.vue @@ -79,10 +79,7 @@ const getRef = (el: object | null, index: number) => { :is="component.component" :ref="(el) => getRef(el, index)" v-bind="component.props" - @open-editor=" - (...args: object[]) => - onOpenEditor(component.id, ...args) - " + @open-editor="onOpenEditor" />