mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-23 18:15:03 +02:00
separate mention category for employees (#5095)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user