Skip to content

Commit

Permalink
standardizes passing a tile id to the editor instead of a whole objec…
Browse files Browse the repository at this point in the history
…t from the viewer
  • Loading branch information
aarongundel committed Dec 20, 2024
1 parent fa7a0f7 commit 37af58a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const EDIT = "edit";
const props = defineProps<{
editorMax: boolean;
activeTab: string;
activeArgs: Array<object>;
tileId?: string;
}>();
const childRefs = ref<Array<sectionTypes>>([]);
const schemeComponents = [
Expand Down Expand Up @@ -118,7 +118,7 @@ async function updateScheme() {
<TabPanel :value="component.id">
<component
:is="component.component"
v-bind="{ mode: EDIT, args: props.activeArgs }"
v-bind="{ mode: EDIT, tileId: props.tileId }"
:ref="(el) => getRef(el, index)"
v-on="{ updated: onUpdated }"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ const route = useRoute();
withDefaults(
defineProps<{
mode?: DataComponentMode;
args?: Array<object>;
tileId?: string | null;
}>(),
{
mode: VIEW,
args: () => [],
tileId: null, // editor arg specifying what tile to operate on.
},
);
Expand Down Expand Up @@ -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"),
Expand Down
5 changes: 1 addition & 4 deletions arches_lingo/src/arches_lingo/pages/SchemePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
</template>
</SplitterPanel>
Expand Down

0 comments on commit 37af58a

Please sign in to comment.