Skip to content

Commit

Permalink
Add children to concept select, #151
Browse files Browse the repository at this point in the history
  • Loading branch information
njkim committed Jan 27, 2025
1 parent d31f731 commit 7502075
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,28 @@ async function getControlledLists() {
const matchingList = controlledLists.find(
(list: ControlledListResult) => list.name === node.listName,
);
const options = matchingList.items.map(
(item: ControlledListItemResult): ControlledListItem => ({
list_id: item.list_id,
uri: item.uri,
labels: item.values,
}),
const options: ControlledListItem[] = [];
matchingList.items.forEach(
(item: ControlledListItemResult) => {
options.push({
uri: item.uri,
list_id: item.list_id,
labels: item.values,
});
if (item.children) {
item.children.forEach((child) => {
const indentation = ' ';
child.values.map((value) => {
value.value = indentation.repeat(child.depth * 4) + value.value;
});
options.push({
uri: child.uri,
list_id: child.list_id,
labels: child.values,
});
});
}
},
);
node.listRef.value = options;
});
Expand Down
2 changes: 2 additions & 0 deletions arches_lingo/src/arches_lingo/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export interface ControlledListItemResult {
sortorder?: number;
guide?: boolean;
values: ControlledListItemLabelValue[];
children: ControlledListItemResult[];
depth: number;
}

export interface ResourceInstanceReference {
Expand Down

0 comments on commit 7502075

Please sign in to comment.