diff --git a/arches_lingo/src/arches_lingo/components/generic/LabelEditor.vue b/arches_lingo/src/arches_lingo/components/generic/LabelEditor.vue index 427134e7..407fe901 100644 --- a/arches_lingo/src/arches_lingo/components/generic/LabelEditor.vue +++ b/arches_lingo/src/arches_lingo/components/generic/LabelEditor.vue @@ -76,6 +76,7 @@ const groupAndPersonOptions = ref(); const textualWorkOptions = ref(); function onUpdateString(node: keyof AppellativeStatus, val: string) { + console.log(formValue.value[node]); (formValue.value[node] as unknown) = toRaw(val); } @@ -83,6 +84,7 @@ function onUpdateReferenceDatatype( node: keyof AppellativeStatus, val: ControlledListItem[], ) { + console.log(formValue.value[node]); (formValue.value[node] as unknown) = val.map((item) => toRaw(item)); } @@ -91,6 +93,7 @@ function onUpdateResourceInstance( val: string[], options: ResourceInstanceReference[], ) { + console.log(formValue.value[node]); if (val.length > 0) { const selectedOptions = options.filter((option) => val.includes(option.resourceId), @@ -111,7 +114,12 @@ async function save() { params: { id: updated.resourceinstanceid }, }); } else if (!formValue.value.tileid) { - await createSchemeLabel(route.params.id as string, formValue.value); + const schemeLabel: AppellativeStatus = await createSchemeLabel( + route.params.id as string, + formValue.value, + ); + valueRef.value = schemeLabel; + emit("update", schemeLabel.tileid); } else { await updateSchemeLabel( route.params.id as string, 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 b07b4196..09d20812 100644 --- a/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue +++ b/arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.vue @@ -7,9 +7,16 @@ import SchemeStandard from "@/arches_lingo/components/scheme/report/SchemeStanda import SchemeLabel from "@/arches_lingo/components/scheme/report/SchemeLabel.vue"; import SchemeNote from "@/arches_lingo/components/scheme/report/SchemeNote.vue"; import type { SectionTypes } from "@/arches_lingo/types.ts"; +import { + OPEN_EDITOR, + EDIT, + UPDATED, + MAXIMIZE, + SIDE, + CLOSE, +} from "@/arches_lingo/constants.ts"; const { $gettext } = useGettext(); -const EDIT = "edit"; const props = defineProps<{ editorMax: boolean; editorForm: string; @@ -59,7 +66,7 @@ watch( { immediate: true }, ); -const emit = defineEmits(["maximize", "side", "close", "updated"]); +const emit = defineEmits([MAXIMIZE, SIDE, CLOSE, UPDATED, OPEN_EDITOR]); onBeforeUpdate(() => { childRefs.value = []; @@ -67,14 +74,14 @@ onBeforeUpdate(() => { function toggleSize() { if (props.editorMax) { - emit("maximize"); + emit(MAXIMIZE); } else { - emit("side"); + emit(SIDE); } } function onSectionUpdate() { - emit("updated"); + emit(UPDATED); } @@ -98,7 +105,7 @@ function onSectionUpdate() {