add more channels

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-09-01 19:24:43 +02:00
parent 2af1b2aad3
commit 0f6fde311c
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
7 changed files with 457 additions and 375 deletions

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,7 @@ export const DOMAIN_CONTACT = 'contact' as Domain
export class TChannelProvider extends TDoc implements ChannelProvider {
label!: IntlString
icon?: Asset
placeholder!: string
}
@Model(contact.class.TypeChannels, core.class.Type)
@ -85,9 +86,22 @@ export function createModel (builder: Builder): void {
builder.createDoc(contact.class.ChannelProvider, core.space.Model, {
label: 'Email' as IntlString,
icon: contact.icon.Email
icon: contact.icon.Email,
placeholder: 'john.appleseed@apple.com'
}, contact.channelProvider.Email)
builder.createDoc(contact.class.ChannelProvider, core.space.Model, {
label: 'Phone' as IntlString,
icon: contact.icon.Email,
placeholder: '+1 555 333 7777'
})
builder.createDoc(contact.class.ChannelProvider, core.space.Model, {
label: 'LinkedIn' as IntlString,
icon: contact.icon.Email,
placeholder: 'https://linkedin.com/in/jappleseed'
})
builder.createDoc(core.class.Space, core.space.Model, {
name: 'Employees',
description: 'Employees',

View File

@ -23,6 +23,11 @@ import {} from '@anticrm/core'
export const ids = mergeIds(contactId, contact, {
channelProvider: {
Email: '' as Ref<ChannelProvider>
// Phone: '' as Ref<ChannelProvider>,
// LinkedIn: '' as Ref<ChannelProvider>,
// Twitter: '' as Ref<ChannelProvider>,
// GitHub: '' as Ref<ChannelProvider>,
// Telegram: '' as Ref<ChannelProvider>,
},
component: {
PersonPresenter: '' as AnyComponent,

View File

@ -66,6 +66,6 @@ let displayItems: Item[] = []
</script>
{#each displayItems as item}
{item.value}<Icon icon={item.icon} size={'small'}/>
<Icon icon={item.icon} size={'medium'}/>
{/each}

View File

@ -21,6 +21,7 @@ import type { Doc, Ref, Class, UXObject } from '@anticrm/core'
* @public
*/
export interface ChannelProvider extends Doc, UXObject {
placeholder: string
}
/**

View File

@ -56,7 +56,7 @@
<div class="popup-block">
<span>Contact</span>
{#each providers as provider, i}
<EditBox label={provider.label} placeholder={'+7 (000) 000-00-00'} bind:value={newValues[i].value} maxWidth={'12.5rem'}/>
<EditBox label={provider.label} placeholder={provider.placeholder} bind:value={newValues[i].value} maxWidth={'12.5rem'}/>
{/each}
</div>
<!-- <div class="popup-block">

File diff suppressed because it is too large Load Diff