Customers doesn't show leads per customer (#1963)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-06-01 09:26:01 +06:00 committed by GitHub
parent c6ff5f19ec
commit 6470851b78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 11 deletions

View File

@ -14,6 +14,10 @@ HR:
- Allow to configure vacancy table
Leads:
- Fix customer table leads column
## 0.6.22
Platform:

View File

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

View File

@ -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
</script>
{#if value.leads && value.leads > 0}
<Tooltip label={leads.string.Leads} component={LeadsPopup} props={{ value }}>
{#if value && value > 0}
<Tooltip label={leads.string.Leads} component={LeadsPopup} props={{ value: object }}>
<div class="sm-tool-icon">
<span class="icon"><Icon icon={leads.icon.Lead} size={'small'} /></span>&nbsp;{value.leads}
<span class="icon"><Icon icon={leads.icon.Lead} size={'small'} /></span>&nbsp;{value}
</div>
</Tooltip>
{/if}