Ignacio Bona Piedrabuena 89c78551cc
1604086049622-ui-sync (#1981)
Co-authored-by: Ignacio Bona <ibonapiedrabuena@linkedin.com>
2020-11-09 12:17:51 -08:00

54 lines
1.9 KiB
Handlebars

<div class="{{this.baseClass}}__tag-input">
{{#if (eq recipientType 'distributionList')}}
{{#each @distributionLists as |distributionList index|}}
<NachoPill::NachoPillInput
@class="{{this.baseClass}}__pill"
@value={{distributionList}}
@onDelete={{fn @removeRecipient this.recipientType index}}
/>
{{/each}}
{{else}}
{{#each @individualRecipients as |individualRecipient index|}}
<NachoPill::NachoPillInput
class="{{this.baseClass}}__pill"
@value={{individualRecipient}}
@onDelete={{fn @removeRecipient this.recipientType index}}
/>
{{/each}}
{{/if}}
<NachoPill::NachoPillInput
@class="{{this.baseClass}}__pill"
@isTypeahead={{true}}
@placeholder={{if (eq recipientType 'distributionList') "e.g.,datahub-dev" "e.g.,jweiner"}}
@onComplete={{fn this.onAddRecipient}}
@onSearch={{perform this.onSearchTask}}
as |result|
>
<div class="{{this.baseClass}}__suggestions-list-item">
<div class="{{this.baseClass}}__icon-container">
{{#if (eq recipientType 'distributionList')}}
<FaIcon
class="{{this.baseClass}}__icon"
@prefix="fas"
@icon="users"
/>
{{else}}
<NachoAvatar::NachoAvatarImage
class="{{this.baseClass}}__icon"
@img={{result.profilePictureUrl}}
/>
{{/if}}
</div>
<div class="{{this.baseClass}}__suggestions-list-item-detail">
<div class="{{this.baseClass}}__suggestions-list-item-detail-name">
<strong>
{{if (eq recipientType 'distributionList') result.entity.name result.name}}
</strong>
</div>
<div class="{{this.baseClass}}__suggestions-list-item-detail-email">
{{if (eq recipientType 'distributionList') result.entity.info.email result.username}}
</div>
</div>
</div>
</NachoPill::NachoPillInput>
</div>