diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index d9f1c464b4..9f3dba091d 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -149,10 +149,11 @@ export function createModel (builder: Builder): void { descriptor: view.viewlet.Table, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { - lookup: { _id: { channels: contact.class.Channel } } + lookup: { _id: { channels: contact.class.Channel }, _class: core.class.Class } }, config: [ '', + '$lookup._class.label', 'city', { presenter: attachment.component.AttachmentsPresenter, diff --git a/models/lead/src/index.ts b/models/lead/src/index.ts index 77e4f4a94e..1f34f4a481 100644 --- a/models/lead/src/index.ts +++ b/models/lead/src/index.ts @@ -20,7 +20,7 @@ import type { Customer, Funnel, Lead } from '@anticrm/lead' import { Builder, Collection, Index, Mixin, Model, Prop, TypeRef, TypeString, UX } from '@anticrm/model' import attachment from '@anticrm/model-attachment' import chunter from '@anticrm/model-chunter' -import contact, { TPerson } from '@anticrm/model-contact' +import contact, { TContact } from '@anticrm/model-contact' import core from '@anticrm/model-core' import task, { TSpaceWithStates, TTask } from '@anticrm/model-task' import view, { createAction } from '@anticrm/model-view' @@ -53,7 +53,7 @@ export class TLead extends TTask implements Lead { @Mixin(lead.mixin.Customer, contact.class.Contact) @UX(lead.string.Customer, lead.icon.LeadApplication) -export class TCustomer extends TPerson implements Customer { +export class TCustomer extends TContact implements Customer { @Prop(Collection(lead.class.Lead), lead.string.Leads) leads?: number @@ -112,7 +112,8 @@ export function createModel (builder: Builder): void { createComponent: lead.component.CreateFunnel } ] - } + }, + navHeaderComponent: lead.component.NewItemsHeader }, lead.app.Lead ) @@ -122,10 +123,11 @@ export function createModel (builder: Builder): void { descriptor: view.viewlet.Table, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { - lookup: { _id: { channels: contact.class.Channel } } as any + lookup: { _id: { channels: contact.class.Channel }, _class: core.class.Class } } as FindOptions, // TODO: fix config: [ '', + '$lookup._class.label', { key: 'leads', presenter: lead.component.LeadsPresenter, label: lead.string.Leads }, 'modifiedOn', '$lookup.channels' diff --git a/models/lead/src/plugin.ts b/models/lead/src/plugin.ts index 3c133d4764..048429df8e 100644 --- a/models/lead/src/plugin.ts +++ b/models/lead/src/plugin.ts @@ -42,7 +42,8 @@ export default mergeIds(leadId, lead, { LeadPresenter: '' as AnyComponent, TemplatesIcon: '' as AnyComponent, Customers: '' as AnyComponent, - Leads: '' as AnyComponent + Leads: '' as AnyComponent, + NewItemsHeader: '' as AnyComponent }, space: { DefaultFunnel: '' as Ref diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index 2bf78fe2da..399dcc1925 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -41,10 +41,10 @@
{}}>
- {#if spaceClass && spaceLabel && spacePlaceholder} + {#if (spaceClass && spaceLabel && spacePlaceholder) || $$slots.space} {#if $$slots.space} - {:else} + {:else if spaceClass && spaceLabel && spacePlaceholder} {/if} @@ -78,7 +78,9 @@ kind={'primary'} on:click={() => { okAction() - dispatch('close') + if (!createMore) { + dispatch('close') + } }} />
diff --git a/packages/theme/styles/common.scss b/packages/theme/styles/common.scss index 6e19fe46ce..4890d42a08 100644 --- a/packages/theme/styles/common.scss +++ b/packages/theme/styles/common.scss @@ -77,7 +77,7 @@ display: flex; justify-content: stretch; align-items: stretch; - margin: .5rem .75rem .75rem; + margin: .5rem 0.5rem .75rem 1rem; } .antiNav-element { flex-shrink: 0; diff --git a/plugins/lead-assets/assets/icons.svg b/plugins/lead-assets/assets/icons.svg index 8b66f111a3..8db72bc3f0 100644 --- a/plugins/lead-assets/assets/icons.svg +++ b/plugins/lead-assets/assets/icons.svg @@ -9,4 +9,10 @@ + + + + + + diff --git a/plugins/lead-assets/src/index.ts b/plugins/lead-assets/src/index.ts index 5af0e98356..4043282244 100644 --- a/plugins/lead-assets/src/index.ts +++ b/plugins/lead-assets/src/index.ts @@ -21,7 +21,8 @@ const icons = require('../assets/icons.svg') as string // eslint-disable-line loadMetadata(lead.icon, { Funnel: `${icons}#funnel`, Lead: `${icons}#lead`, - LeadApplication: `${icons}#leadapplication` + LeadApplication: `${icons}#leadapplication`, + CreateCustomer: `${icons}#new-customer` }) addStringsLoader(leadId, async (lang: string) => await import(`../lang/${lang}.json`)) diff --git a/plugins/lead-resources/src/components/CreateCustomer.svelte b/plugins/lead-resources/src/components/CreateCustomer.svelte index 856c3c4114..822affb315 100644 --- a/plugins/lead-resources/src/components/CreateCustomer.svelte +++ b/plugins/lead-resources/src/components/CreateCustomer.svelte @@ -14,53 +14,58 @@ --> 0 && lastName.length > 0 && matches.length === 0} + {canSave} space={contact.space.Contacts} on:close={() => { dispatch('close') }} + bind:createMore > -
-
- - -
+ +
-
- -
-
+ {/if} diff --git a/plugins/lead-resources/src/components/Customers.svelte b/plugins/lead-resources/src/components/Customers.svelte index b6a88f1a92..49c59b6ff6 100644 --- a/plugins/lead-resources/src/components/Customers.svelte +++ b/plugins/lead-resources/src/components/Customers.svelte @@ -16,11 +16,10 @@
@@ -52,13 +47,6 @@ updateResultQuery(search) }} /> - -
diff --git a/plugins/lead-resources/src/components/NewItemsHeader.svelte b/plugins/lead-resources/src/components/NewItemsHeader.svelte new file mode 100644 index 0000000000..bcd2dd7647 --- /dev/null +++ b/plugins/lead-resources/src/components/NewItemsHeader.svelte @@ -0,0 +1,36 @@ + + + +
+
+
+ +
diff --git a/plugins/lead-resources/src/index.ts b/plugins/lead-resources/src/index.ts index 6e1515196f..0c11ced50b 100644 --- a/plugins/lead-resources/src/index.ts +++ b/plugins/lead-resources/src/index.ts @@ -25,6 +25,7 @@ import Leads from './components/Leads.svelte' import LeadsPresenter from './components/LeadsPresenter.svelte' import TemplatesIcon from './components/TemplatesIcon.svelte' import CreateCustomer from './components/CreateCustomer.svelte' +import NewItemsHeader from './components/NewItemsHeader.svelte' export default async (): Promise => ({ component: { @@ -37,6 +38,7 @@ export default async (): Promise => ({ Customers, LeadsPresenter, Leads, - CreateCustomer + CreateCustomer, + NewItemsHeader } }) diff --git a/plugins/lead/src/index.ts b/plugins/lead/src/index.ts index 22f5a2bb45..61cc1b75d2 100644 --- a/plugins/lead/src/index.ts +++ b/plugins/lead/src/index.ts @@ -70,7 +70,8 @@ const lead = plugin(leadId, { icon: { Funnel: '' as Asset, Lead: '' as Asset, - LeadApplication: '' as Asset + LeadApplication: '' as Asset, + CreateCustomer: '' as Asset }, space: { FunnelTemplates: '' as Ref