update table configuration

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-09-26 13:05:17 +02:00
parent dd7c2d5c68
commit 1e21e8ebe3
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
5 changed files with 781 additions and 763 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -113,7 +113,7 @@ export function createModel (builder: Builder): void {
// resume: chunter.class.Attachment // resume: chunter.class.Attachment
// } // }
} as FindOptions<Doc>, // TODO: fix } as FindOptions<Doc>, // TODO: fix
config: ['', 'title', 'city', 'applications', '#' + chunter.component.AttachmentPresenter + '/Files', 'channels'] config: ['', 'title', 'city', 'applications', { presenter: chunter.component.AttachmentPresenter, label: 'Files' }, 'channels']
}) })
builder.createDoc(view.class.Viewlet, core.space.Model, { builder.createDoc(view.class.Viewlet, core.space.Model, {
@ -127,7 +127,7 @@ export function createModel (builder: Builder): void {
state: core.class.State state: core.class.State
} }
} as FindOptions<Doc>, // TODO: fix } as FindOptions<Doc>, // TODO: fix
config: ['$lookup.candidate', '#' + recruit.component.ApplicationPresenter + '/Application', '$lookup.state', '$lookup.candidate.city', '$lookup.candidate.channels'] config: ['$lookup.candidate', { presenter: recruit.component.ApplicationPresenter, label: 'Application' }, '$lookup.state', '$lookup.candidate.city', '$lookup.candidate.channels']
}) })
builder.createDoc(view.class.Viewlet, core.space.Model, { builder.createDoc(view.class.Viewlet, core.space.Model, {

View File

@ -62,17 +62,17 @@ async function getAttributePresenter(client: Client, _class: Ref<Class<Obj>>, ke
} }
async function getPresenter(client: Client, _class: Ref<Class<Obj>>, key: string, preserveKey: string, options?: FindOptions<Doc>): Promise<AttributeModel> { async function getPresenter(client: Client, _class: Ref<Class<Obj>>, key: string, preserveKey: string, options?: FindOptions<Doc>): Promise<AttributeModel> {
if (typeof key === 'object') {
const {presenter, label} = key
return {
key: '',
label: label as IntlString,
presenter: await getResource(presenter as AnyComponent)
}
}
if (key.length === 0) { if (key.length === 0) {
return getObjectPresenter(client, _class, preserveKey) return getObjectPresenter(client, _class, preserveKey)
} else { } else {
if (key.startsWith('#')) {
const [presenter, label] = key.substring(1).split('/')
return {
key: '',
label: label as IntlString,
presenter: await getResource(presenter as AnyComponent)
}
}
const split = key.split('.') const split = key.split('.')
if (split[0] === '$lookup') { if (split[0] === '$lookup') {
const lookupClass = (options?.lookup as any)[split[1]] as Ref<Class<Obj>> const lookupClass = (options?.lookup as any)[split[1]] as Ref<Class<Obj>>

File diff suppressed because it is too large Load Diff