Skip to content

Commit

Permalink
UBER-48: custom fields for organization in leads (#3203)
Browse files Browse the repository at this point in the history
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
  • Loading branch information
ThetaDR authored May 19, 2023
1 parent 8fa4932 commit 88d62bc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
32 changes: 15 additions & 17 deletions plugins/contact-resources/src/components/CreateOrganization.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,22 @@
/>
</div>
<svelte:fragment slot="pool">
<div class="flex-row-center flex-wrap">
<ChannelsDropdown
bind:value={channels}
focusIndex={10}
kind={'secondary'}
size={'large'}
editable
highlighted={matchedChannels.map((it) => it.provider)}
/>
<ChannelsDropdown
bind:value={channels}
focusIndex={10}
kind={'secondary'}
size={'large'}
editable
highlighted={matchedChannels.map((it) => it.provider)}
/>

<InlineAttributeBar
_class={contact.class.Organization}
{object}
toClass={contact.class.Contact}
on:update
extraProps={{ showNavigate: false }}
/>
</div>
<InlineAttributeBar
_class={contact.class.Organization}
{object}
toClass={contact.class.Contact}
on:update
extraProps={{ showNavigate: false }}
/>
</svelte:fragment>
<svelte:fragment slot="footer">
{#if matches.length > 0}
Expand Down
13 changes: 11 additions & 2 deletions plugins/lead-resources/src/components/CreateCustomer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import contact from '@hcengineering/contact-resources/src/plugin'
import { AttachedData, Class, Data, Doc, generateId, MixinData, Ref, WithLookup } from '@hcengineering/core'
import type { Customer } from '@hcengineering/lead'
import { Card, getClient } from '@hcengineering/presentation'
import { Card, getClient, InlineAttributeBar } from '@hcengineering/presentation'
import {
Button,
createFocusManager,
Expand Down Expand Up @@ -71,7 +71,7 @@
description: object.description
}
const id = await client.createDoc(targetClass._id, contact.space.Contacts, candidate, customerId)
const id = await client.createDoc(targetClass._id, contact.space.Contacts, { ...candidate, ...object }, customerId)
await client.createMixin(
id as Ref<Contact>,
targetClass._id,
Expand Down Expand Up @@ -234,6 +234,15 @@
editable
highlighted={matchedChannels.map((it) => it.provider)}
/>
{#if targetClass._id === contact.class.Organization}
<InlineAttributeBar
_class={contact.class.Organization}
{object}
toClass={contact.class.Contact}
on:update
extraProps={{ showNavigate: false }}
/>
{/if}
</svelte:fragment>
<svelte:fragment slot="footer">
{#if matches.length > 0}
Expand Down

0 comments on commit 88d62bc

Please sign in to comment.