diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index 9ad52abaa1..51257cfc3b 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -190,20 +190,25 @@ export function createModel (builder: Builder): void { editor: contact.component.EditMember }) - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: contact.class.Contact, - descriptor: view.viewlet.Table, - config: [ - '', - '$lookup._class', - 'city', - 'attachments', - 'modifiedOn', - { key: '', presenter: view.component.RolePresenter, label: view.string.Role }, - '$lookup.channels' - ], - hiddenKeys: ['name'] - }) + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: contact.class.Contact, + descriptor: view.viewlet.Table, + config: [ + '', + '$lookup._class', + 'city', + 'attachments', + 'modifiedOn', + { key: '', presenter: view.component.RolePresenter, label: view.string.Role }, + '$lookup.channels' + ], + hiddenKeys: ['name'] + }, + contact.viewlet.TableContact + ) builder.mixin(contact.class.Person, core.class.Class, view.mixin.ObjectEditor, { editor: contact.component.EditPerson diff --git a/models/inventory/src/index.ts b/models/inventory/src/index.ts index 9b10dbce43..e65167ac3d 100644 --- a/models/inventory/src/index.ts +++ b/models/inventory/src/index.ts @@ -96,11 +96,16 @@ export function createModel (builder: Builder): void { builder.mixin(inventory.class.Product, core.class.Class, setting.mixin.Editable, {}) - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: inventory.class.Product, - descriptor: view.viewlet.Table, - config: ['', '$lookup.attachedTo', 'modifiedOn'] - }) + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: inventory.class.Product, + descriptor: view.viewlet.Table, + config: ['', '$lookup.attachedTo', 'modifiedOn'] + }, + inventory.viewlet.TableProduct + ) builder.createDoc( workbench.class.Application, diff --git a/models/inventory/src/plugin.ts b/models/inventory/src/plugin.ts index 3e86c41cb6..c5cb02ae3f 100644 --- a/models/inventory/src/plugin.ts +++ b/models/inventory/src/plugin.ts @@ -19,7 +19,7 @@ import { inventoryId } from '@anticrm/inventory' import inventory from '@anticrm/inventory-resources/src/plugin' import { mergeIds } from '@anticrm/platform' import type { AnyComponent } from '@anticrm/ui' -import { Action, ActionCategory, ViewAction } from '@anticrm/view' +import { Action, ActionCategory, ViewAction, Viewlet } from '@anticrm/view' export default mergeIds(inventoryId, inventory, { action: { @@ -39,5 +39,8 @@ export default mergeIds(inventoryId, inventory, { Variants: '' as AnyComponent, ProductPresenter: '' as AnyComponent, VariantPresenter: '' as AnyComponent + }, + viewlet: { + TableProduct: '' as Ref } }) diff --git a/models/lead/src/index.ts b/models/lead/src/index.ts index 0b4e2e8afb..c9786211e1 100644 --- a/models/lead/src/index.ts +++ b/models/lead/src/index.ts @@ -129,27 +129,37 @@ export function createModel (builder: Builder): void { lead.app.Lead ) - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: lead.mixin.Customer, - descriptor: view.viewlet.Table, - config: ['', '$lookup._class', 'leads', 'modifiedOn', '$lookup.channels'], - hiddenKeys: ['name'] - }) + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: lead.mixin.Customer, + descriptor: view.viewlet.Table, + config: ['', '$lookup._class', 'leads', 'modifiedOn', '$lookup.channels'], + hiddenKeys: ['name'] + }, + lead.viewlet.TableCustomer + ) - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: lead.class.Lead, - descriptor: task.viewlet.StatusTable, - config: [ - '', - '$lookup.attachedTo', - '$lookup.state', - '$lookup.doneState', - 'attachments', - 'comments', - 'modifiedOn', - '$lookup.attachedTo.$lookup.channels' - ] - }) + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: lead.class.Lead, + descriptor: task.viewlet.StatusTable, + config: [ + '', + '$lookup.attachedTo', + '$lookup.state', + '$lookup.doneState', + 'attachments', + 'comments', + 'modifiedOn', + '$lookup.attachedTo.$lookup.channels' + ] + }, + lead.viewlet.TableLead + ) builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: lead.class.Lead, diff --git a/models/lead/src/plugin.ts b/models/lead/src/plugin.ts index 3f55cf5b7b..519a3a33dc 100644 --- a/models/lead/src/plugin.ts +++ b/models/lead/src/plugin.ts @@ -21,6 +21,7 @@ import type { IntlString } from '@anticrm/platform' import { mergeIds } from '@anticrm/platform' import { KanbanTemplate } from '@anticrm/task' import type { AnyComponent } from '@anticrm/ui' +import { Viewlet } from '@anticrm/view' export default mergeIds(leadId, lead, { string: { @@ -49,5 +50,9 @@ export default mergeIds(leadId, lead, { }, template: { DefaultFunnel: '' as Ref + }, + viewlet: { + TableCustomer: '' as Ref, + TableLead: '' as Ref } }) diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 223503aa1a..e76ac8cf2e 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -254,68 +254,83 @@ export function createModel (builder: Builder): void { recruit.app.Recruit ) - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: recruit.mixin.Candidate, - descriptor: view.viewlet.Table, - config: [ - '', - 'title', - 'city', - 'applications', - 'attachments', - 'comments', - { - // key: '$lookup.skills', // Required, since presenter require list of tag references or '' and TagsPopupPresenter - key: '', - presenter: tags.component.TagsPresenter, // tags.component.TagsPresenter, - label: recruit.string.SkillsLabel, - sortingKey: 'skills', - props: { - _class: recruit.mixin.Candidate, - key: 'skills' + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: recruit.mixin.Candidate, + descriptor: view.viewlet.Table, + config: [ + '', + 'title', + 'city', + 'applications', + 'attachments', + 'comments', + { + // key: '$lookup.skills', // Required, since presenter require list of tag references or '' and TagsPopupPresenter + key: '', + presenter: tags.component.TagsPresenter, // tags.component.TagsPresenter, + label: recruit.string.SkillsLabel, + sortingKey: 'skills', + props: { + _class: recruit.mixin.Candidate, + key: 'skills' + } + }, + 'modifiedOn', + '$lookup.channels' + ], + hiddenKeys: ['name'] + }, + recruit.viewlet.TableCandidate + ) + + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: recruit.class.Vacancy, + descriptor: view.viewlet.Table, + config: [ + '', + { + key: '@applications', + label: recruit.string.Applications + }, + '$lookup.company', + 'location', + 'description', + { + key: '@applications.modifiedOn', + label: core.string.Modified } - }, - 'modifiedOn', - '$lookup.channels' - ], - hiddenKeys: ['name'] - }) + ], + hiddenKeys: ['name', 'space', 'modifiedOn'] + }, + recruit.viewlet.TableVacancy + ) - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: recruit.class.Vacancy, - descriptor: view.viewlet.Table, - config: [ - '', - { - key: '@applications', - label: recruit.string.Applications - }, - '$lookup.company', - 'location', - 'description', - { - key: '@applications.modifiedOn', - label: core.string.Modified - } - ], - hiddenKeys: ['name', 'space', 'modifiedOn'] - }) - - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: recruit.class.Applicant, - descriptor: task.viewlet.StatusTable, - config: [ - '', - '$lookup.attachedTo', - '$lookup.assignee', - '$lookup.state', - '$lookup.doneState', - 'attachments', - 'comments', - 'modifiedOn', - '$lookup.attachedTo.$lookup.channels' - ] - }) + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: recruit.class.Applicant, + descriptor: task.viewlet.StatusTable, + config: [ + '', + '$lookup.attachedTo', + '$lookup.assignee', + '$lookup.state', + '$lookup.doneState', + 'attachments', + 'comments', + 'modifiedOn', + '$lookup.attachedTo.$lookup.channels' + ] + }, + recruit.viewlet.TableApplicant + ) const applicantKanbanLookup: Lookup = { attachedTo: recruit.mixin.Candidate, diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index 0519cbae3d..747a168e0e 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -21,7 +21,7 @@ import { recruitId } from '@anticrm/recruit' import recruit from '@anticrm/recruit-resources/src/plugin' import { KanbanTemplate } from '@anticrm/task' import type { AnyComponent } from '@anticrm/ui' -import type { Action, ActionCategory, ViewAction } from '@anticrm/view' +import type { Action, ActionCategory, ViewAction, Viewlet } from '@anticrm/view' export default mergeIds(recruitId, recruit, { action: { @@ -86,5 +86,10 @@ export default mergeIds(recruitId, recruit, { completion: { ApplicationQuery: '' as Resource, ApplicationCategory: '' as Ref + }, + viewlet: { + TableCandidate: '' as Ref, + TableVacancy: '' as Ref, + TableApplicant: '' as Ref } }) diff --git a/models/task/src/index.ts b/models/task/src/index.ts index 5df0e205e4..01b18801b6 100644 --- a/models/task/src/index.ts +++ b/models/task/src/index.ts @@ -340,20 +340,25 @@ export function createModel (builder: Builder): void { task.viewlet.StatusTable ) - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: task.class.Issue, - descriptor: task.viewlet.StatusTable, - config: [ - '', - 'name', - '$lookup.assignee', - '$lookup.state', - '$lookup.doneState', - 'attachments', - 'comments', - 'modifiedOn' - ] - }) + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: task.class.Issue, + descriptor: task.viewlet.StatusTable, + config: [ + '', + 'name', + '$lookup.assignee', + '$lookup.state', + '$lookup.doneState', + 'attachments', + 'comments', + 'modifiedOn' + ] + }, + task.viewlet.TableIssue + ) builder.mixin(task.class.Task, core.class.Class, view.mixin.AttributePresenter, { presenter: view.component.ObjectPresenter diff --git a/models/task/src/plugin.ts b/models/task/src/plugin.ts index ef73edb4b4..4348af0b20 100644 --- a/models/task/src/plugin.ts +++ b/models/task/src/plugin.ts @@ -22,7 +22,7 @@ import { TagCategory } from '@anticrm/tags' import { KanbanTemplate, taskId } from '@anticrm/task' import task from '@anticrm/task-resources/src/plugin' import type { AnyComponent } from '@anticrm/ui' -import type { Action, ActionCategory, ViewAction } from '@anticrm/view' +import type { Action, ActionCategory, ViewAction, Viewlet } from '@anticrm/view' export default mergeIds(taskId, task, { action: { @@ -69,5 +69,8 @@ export default mergeIds(taskId, task, { completion: { IssueQuery: '' as Resource, IssueCategory: '' as Ref + }, + viewlet: { + TableIssue: '' as Ref } }) diff --git a/plugins/contact/src/index.ts b/plugins/contact/src/index.ts index f00faed8c7..42843caa30 100644 --- a/plugins/contact/src/index.ts +++ b/plugins/contact/src/index.ts @@ -215,7 +215,8 @@ const contactPlugin = plugin(contactId, { CreateOrganization: '' as IntlString }, viewlet: { - TableMember: '' as Ref + TableMember: '' as Ref, + TableContact: '' as Ref } })