mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
69a8122ca6
closes https://github.com/TryGhost/Team/issues/1320 - added `@allowEdit` argument to `<GhMemberLabelInput>` and changed the dropdown to only show the edit label when `@allowEdit` is truthy - updated usage in the filter UI and members detail screens to allow editing
33 lines
1.1 KiB
Handlebars
33 lines
1.1 KiB
Handlebars
<GhTokenInput
|
|
@extra={{hash
|
|
tokenComponent="gh-token-input/label-token"
|
|
}}
|
|
@class="gh-member-label-input"
|
|
@onChange={{this.updateLabels}}
|
|
@onCreate={{this.createLabel}}
|
|
@options={{this.availableLabels}}
|
|
@renderInPlace={{true}}
|
|
@selected={{this.selectedLabels}}
|
|
@showCreateWhen={{this.hideCreateOptionOnMatchingLabel}}
|
|
@triggerId={{this.triggerId}}
|
|
@selectedItemComponent="gh-token-input/label-selected-item"
|
|
@disabled={{@disabled}}
|
|
@allowCreation={{@allowCreation}}
|
|
as |label|
|
|
>
|
|
<div style="display: flex">
|
|
<span
|
|
class="dropdown-label"
|
|
style="flex-grow: 1"
|
|
title="{{label.name}}"
|
|
data-test-label-filter={{label.name}}>
|
|
{{label.name}}
|
|
</span>
|
|
{{#if (and @allowEdit label.slug)}}
|
|
<button type="button" class="dropdown-action-icon" {{on "mouseup" (fn this.editLabel label)}} aria-label="Edit label {{label.name}}" data-test-edit-label={{label.name}}>
|
|
{{svg-jar "pen"}}
|
|
</button>
|
|
{{/if}}
|
|
</div>
|
|
</GhTokenInput>
|