mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-19 23:00:13 +00:00
do not use lookup if RefPresenter is set (#6289)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
96b73dff9c
commit
c752b20321
@ -148,13 +148,14 @@
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
function getValue (name: string, type: Type<any>): string {
|
function getValue (name: string, type: Type<any>, attrClass: Ref<Class<Doc>>): string {
|
||||||
|
const presenter = hierarchy.classHierarchyMixin(attrClass, view.mixin.AttributePresenter)?.presenter
|
||||||
|
if (presenter !== undefined) {
|
||||||
|
return name
|
||||||
|
}
|
||||||
if (hierarchy.isDerived(type._class, core.class.RefTo)) {
|
if (hierarchy.isDerived(type._class, core.class.RefTo)) {
|
||||||
return '$lookup.' + name
|
return '$lookup.' + name
|
||||||
}
|
}
|
||||||
// if (hierarchy.isDerived(type._class, core.class.ArrOf)) {
|
|
||||||
// return getValue(name, (type as ArrOf<any>).of)
|
|
||||||
// }
|
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,14 +163,14 @@
|
|||||||
if (attribute.hidden === true || attribute.label === undefined) return
|
if (attribute.hidden === true || attribute.label === undefined) return
|
||||||
if (viewlet.configOptions?.hiddenKeys?.includes(attribute.name)) return
|
if (viewlet.configOptions?.hiddenKeys?.includes(attribute.name)) return
|
||||||
if (hierarchy.isDerived(attribute.type._class, core.class.Collection)) return
|
if (hierarchy.isDerived(attribute.type._class, core.class.Collection)) return
|
||||||
const value = getValue(attribute.name, attribute.type)
|
const { attrClass, category } = getAttributePresenterClass(hierarchy, attribute)
|
||||||
|
const value = getValue(attribute.name, attribute.type, attrClass)
|
||||||
for (const res of result) {
|
for (const res of result) {
|
||||||
const key = typeof res.value === 'string' ? res.value : res.value?.key
|
const key = typeof res.value === 'string' ? res.value : res.value?.key
|
||||||
if (key === undefined) return
|
if (key === undefined) return
|
||||||
if (key === attribute.name) return
|
if (key === attribute.name) return
|
||||||
if (key === value) return
|
if (key === value) return
|
||||||
}
|
}
|
||||||
const { attrClass, category } = getAttributePresenterClass(hierarchy, attribute)
|
|
||||||
const mixin =
|
const mixin =
|
||||||
category === 'object'
|
category === 'object'
|
||||||
? view.mixin.ObjectPresenter
|
? view.mixin.ObjectPresenter
|
||||||
|
Loading…
Reference in New Issue
Block a user