mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
parent
242b3dc96e
commit
b600d736b8
@ -147,21 +147,18 @@
|
||||
const result = getBaseConfig(viewlet)
|
||||
|
||||
const allAttributes = hierarchy.getAllAttributes(viewlet.attachTo)
|
||||
|
||||
for (const [, attribute] of allAttributes) {
|
||||
processAttribute(attribute, result)
|
||||
}
|
||||
|
||||
hierarchy
|
||||
.getDescendants(viewlet.attachTo)
|
||||
.filter((it) => hierarchy.isMixin(it))
|
||||
.forEach((it) =>
|
||||
hierarchy.getAllAttributes(it, viewlet.attachTo).forEach((attr) => {
|
||||
hierarchy.getDescendants(viewlet.attachTo).forEach((it) => {
|
||||
const ancestor = hierarchy.getAncestors(it)[1]
|
||||
hierarchy.getAllAttributes(it, ancestor).forEach((attr) => {
|
||||
if (attr.isCustom === true) {
|
||||
processAttribute(attr, result, true)
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
return preference === undefined ? result : setStatus(result, preference)
|
||||
}
|
||||
|
@ -53,8 +53,9 @@
|
||||
}
|
||||
: {}
|
||||
let prefix = ''
|
||||
const attr = client.getHierarchy().getAttribute(filter.key._class, filter.key.key)
|
||||
if (client.getHierarchy().isMixin(attr.attributeOf)) {
|
||||
const hieararchy = client.getHierarchy()
|
||||
const attr = hieararchy.getAttribute(filter.key._class, filter.key.key)
|
||||
if (hieararchy.isMixin(attr.attributeOf)) {
|
||||
prefix = attr.attributeOf + '.'
|
||||
console.log('prefix', prefix)
|
||||
}
|
||||
@ -66,8 +67,8 @@
|
||||
|
||||
for (const object of res) {
|
||||
let asDoc = object
|
||||
if (client.getHierarchy().isMixin(filter.key._class)) {
|
||||
asDoc = client.getHierarchy().as(object, filter.key._class)
|
||||
if (hieararchy.isMixin(filter.key._class)) {
|
||||
asDoc = hieararchy.as(object, filter.key._class)
|
||||
}
|
||||
const realValue = getObjectValue(filter.key.key, asDoc)
|
||||
const value = getValue(realValue)
|
||||
|
@ -240,7 +240,7 @@ export async function buildModel (options: BuildModelOptions): Promise<Attribute
|
||||
const pos = key.key.lastIndexOf('.')
|
||||
if (pos !== -1) {
|
||||
const mixinName = key.key.substring(0, pos) as Ref<Class<Doc>>
|
||||
if (options.client.getHierarchy().isMixin(mixinName)) {
|
||||
if (!mixinName.includes('$lookup')) {
|
||||
const realKey = key.key.substring(pos + 1)
|
||||
const rkey = { ...key, key: realKey }
|
||||
return {
|
||||
@ -251,7 +251,6 @@ export async function buildModel (options: BuildModelOptions): Promise<Attribute
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return await getPresenter(options.client, options._class, key, key, options.lookup)
|
||||
} catch (err: any) {
|
||||
if (options.ignoreMissing ?? false) {
|
||||
|
Loading…
Reference in New Issue
Block a user