diff --git a/changelog.md b/changelog.md index 06b84ffc39..0d834e9eb5 100644 --- a/changelog.md +++ b/changelog.md @@ -14,6 +14,10 @@ HR: - Allow to configure vacancy table +Leads: + +- Fix customer table leads column + ## 0.6.22 Platform: diff --git a/models/lead/src/index.ts b/models/lead/src/index.ts index 63e192995f..f201ee50ed 100644 --- a/models/lead/src/index.ts +++ b/models/lead/src/index.ts @@ -127,13 +127,7 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: lead.mixin.Customer, descriptor: view.viewlet.Table, - config: [ - '', - '$lookup._class', - { key: 'leads', presenter: lead.component.LeadsPresenter, label: lead.string.Leads }, - 'modifiedOn', - '$lookup.channels' - ], + config: ['', '$lookup._class', 'leads', 'modifiedOn', '$lookup.channels'], hiddenKeys: ['name'] }) @@ -176,6 +170,10 @@ export function createModel (builder: Builder): void { presenter: lead.component.LeadPresenter }) + builder.mixin(lead.class.Lead, core.class.Class, view.mixin.CollectionPresenter, { + presenter: lead.component.LeadsPresenter + }) + builder.mixin(lead.class.Lead, core.class.Class, view.mixin.CollectionEditor, { editor: lead.component.Leads }) diff --git a/plugins/lead-resources/src/components/LeadsPresenter.svelte b/plugins/lead-resources/src/components/LeadsPresenter.svelte index a520283504..29232ba166 100644 --- a/plugins/lead-resources/src/components/LeadsPresenter.svelte +++ b/plugins/lead-resources/src/components/LeadsPresenter.svelte @@ -19,13 +19,14 @@ import LeadsPopup from './LeadsPopup.svelte' import leads from '../plugin' - export let value: Customer + export let value: number + export let object: Customer -{#if value.leads && value.leads > 0} - +{#if value && value > 0} +
-  {value.leads} +  {value}
{/if}