Ghost/ghost/admin/app/components/gh-member-label-input.hbs
Sodbileg Gansukh 7d42d1473e
Improved long label handling (#20029)
ref DES-205

- label name is now used as the title on label pills instead of static
text
- label names will now be truncated when it takes more than 2 lines
instead of 1
2024-04-17 05:02:21 +00:00

36 lines
1.3 KiB
Handlebars

<GhTokenInput
@extra={{hash
tokenComponent=(component "gh-token-input/label-token")
}}
@class="gh-member-label-input"
@onChange={{this.updateLabels}}
@onCreate={{this.createLabel}}
@options={{this.availableLabels}}
@renderInPlace={{@renderInPlace}}
@selected={{this.selectedLabels}}
@showCreateWhen={{this.hideCreateOptionOnMatchingLabel}}
@triggerId={{this.triggerId}}
@selectedItemComponent={{component "gh-token-input/label-selected-item"}}
@disabled={{@disabled}}
@allowCreation={{@allowCreation}}
@placeholder={{@placeholder}}
as |label|
>
<div style="display: flex; width: 100%;">
<span
class="dropdown-label"
style="display: -webkit-box; flex-grow: 1; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;"
title="{{label.name}}"
data-test-label-filter={{label.name}}>
{{label.name}}
</span>
{{#if (and @allowEdit label.slug)}}
<button type="button" class="gh-btn-icon dropdown-action-icon" {{on "mouseup" (fn this.editLabel label)}} aria-label="Edit label {{label.name}}" data-test-edit-label={{label.name}}>
<span>
{{svg-jar "pen"}}
</span>
</button>
{{/if}}
</div>
</GhTokenInput>