ezqms-241: account for parent classes configurations in list view (#3537)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2023-08-01 11:40:47 +04:00 committed by GitHub
parent 2781082f81
commit 6e44e556f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
@ -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)}