separate mention category for employees (#5095)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov
2024-03-29 18:37:36 +05:00
committed by GitHub
parent 16204edaac
commit 72a93ad388
13 changed files with 56 additions and 52 deletions
+1 -1
View File
@@ -521,7 +521,7 @@ export interface DocIndexState extends Doc {
// Indexable attributes, including child ones.
attributes: Record<string, any>
mixins?: Ref<Class<Doc>>[]
// Full Summary
fullSummary?: Markup | null
shortSummary?: Markup | null
+15
View File
@@ -141,6 +141,21 @@ export class Hierarchy {
return result
}
findAllMixins<D extends Doc, M extends D>(doc: Doc): Ref<Class<M>>[] {
const _doc = _toDoc(doc)
const resultSet = new Set<Ref<Class<M>>>()
for (const [k, v] of Object.entries(_doc)) {
if (typeof v === 'object' && this.classifiers.has(k as Ref<Classifier>)) {
if (this.isMixin(k as Ref<Classifier>)) {
if (!resultSet.has(k as Ref<Classifier>)) {
resultSet.add(k as Ref<Classifier>)
}
}
}
}
return Array.from(resultSet)
}
isMixin (_class: Ref<Class<Doc>>): boolean {
const data = this.classifiers.get(_class)
return data !== undefined && this._isMixin(data)