Viewlet config upgrade fix (#2026)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-06-07 18:21:09 +06:00 committed by GitHub
parent e9c7f7dea6
commit 49ab98fa41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 174 additions and 117 deletions

View File

@ -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

View File

@ -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,

View File

@ -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<Viewlet>
}
})

View File

@ -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,

View File

@ -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<KanbanTemplate>
},
viewlet: {
TableCustomer: '' as Ref<Viewlet>,
TableLead: '' as Ref<Viewlet>
}
})

View File

@ -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<Applicant> = {
attachedTo: recruit.mixin.Candidate,

View File

@ -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<ObjectSearchFactory>,
ApplicationCategory: '' as Ref<ObjectSearchCategory>
},
viewlet: {
TableCandidate: '' as Ref<Viewlet>,
TableVacancy: '' as Ref<Viewlet>,
TableApplicant: '' as Ref<Viewlet>
}
})

View File

@ -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

View File

@ -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<ObjectSearchFactory>,
IssueCategory: '' as Ref<ObjectSearchCategory>
},
viewlet: {
TableIssue: '' as Ref<Viewlet>
}
})

View File

@ -215,7 +215,8 @@ const contactPlugin = plugin(contactId, {
CreateOrganization: '' as IntlString
},
viewlet: {
TableMember: '' as Ref<Viewlet>
TableMember: '' as Ref<Viewlet>,
TableContact: '' as Ref<Viewlet>
}
})