Skip to content

Commit

Permalink
ezqms-241: account for parent classes configurations in list view (#3537
Browse files Browse the repository at this point in the history
)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
  • Loading branch information
lexiv0re authored Aug 1, 2023
1 parent 2781082 commit 6e44e55
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion plugins/view-resources/src/components/list/ListCategory.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,27 @@
}
const listItems: ListItem[] = []
function getDocItemModel (docClass: Ref<Class<Doc>>): AttributeModel[] {
let res = itemModels.get(docClass)
if (res) {
return res
}
try {
for (const ac of client.getHierarchy().getAncestors(docClass)) {
res = itemModels.get(ac)
if (res) {
return res
}
}
} catch (e) {
// suppress
}
return []
}
</script>

<div
Expand Down Expand Up @@ -429,7 +450,7 @@
<ListItem
bind:this={listItems[i]}
{docObject}
model={itemModels.get(docObject._class) ?? []}
model={getDocItemModel(docObject._class)}
{groupByKey}
selected={isSelected(docObject, $focusStore)}
checked={selectedObjectIdsSet.has(docObject._id)}
Expand Down

0 comments on commit 6e44e55

Please sign in to comment.