mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Disabled non-functional edit buttons in labels dropdown when importing members (#2258)
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
This commit is contained in:
parent
489c4b90c3
commit
69a8122ca6
5 changed files with 9 additions and 3 deletions
|
@ -1823,3 +1823,4 @@ remove|ember-template-lint|no-duplicate-landmark-elements|9|8|9|8|09aee7e3475b80
|
||||||
remove|ember-template-lint|no-duplicate-landmark-elements|15|8|15|8|027a945914f8d962353d049ba76df782815eb777|1643760000000|1646352000000|1648940400000|app/components/modal-import-members.hbs
|
remove|ember-template-lint|no-duplicate-landmark-elements|15|8|15|8|027a945914f8d962353d049ba76df782815eb777|1643760000000|1646352000000|1648940400000|app/components/modal-import-members.hbs
|
||||||
remove|ember-template-lint|no-duplicate-landmark-elements|22|8|22|8|b46a5eafbe20704195c70caef63feb2a42467e5e|1643760000000|1646352000000|1648940400000|app/components/modal-import-members.hbs
|
remove|ember-template-lint|no-duplicate-landmark-elements|22|8|22|8|b46a5eafbe20704195c70caef63feb2a42467e5e|1643760000000|1646352000000|1648940400000|app/components/modal-import-members.hbs
|
||||||
remove|ember-template-lint|no-duplicate-landmark-elements|37|8|37|8|54b2819b311941c35c0cc1d64e431ee9d9145b82|1643760000000|1646352000000|1648940400000|app/components/modal-import-members.hbs
|
remove|ember-template-lint|no-duplicate-landmark-elements|37|8|37|8|54b2819b311941c35c0cc1d64e431ee9d9145b82|1643760000000|1646352000000|1648940400000|app/components/modal-import-members.hbs
|
||||||
|
remove|ember-template-lint|no-invalid-interactive|27|47|27|47|17660ddd048981e3ae59c14abced1e1966c8baa4|1644278400000|1646870400000|1649458800000|app/components/gh-member-label-input.hbs
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
data-test-label-filter={{label.name}}>
|
data-test-label-filter={{label.name}}>
|
||||||
{{label.name}}
|
{{label.name}}
|
||||||
</span>
|
</span>
|
||||||
{{#if label.slug}}
|
{{#if (and @allowEdit label.slug)}}
|
||||||
<span class="dropdown-action-icon" {{on "mouseup" (fn this.editLabel label)}}>
|
<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"}}
|
{{svg-jar "pen"}}
|
||||||
</span>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</GhTokenInput>
|
</GhTokenInput>
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
<label for="label-input">Labels</label>
|
<label for="label-input">Labels</label>
|
||||||
<GhMemberLabelInput
|
<GhMemberLabelInput
|
||||||
@onChange={{action "setLabels"}}
|
@onChange={{action "setLabels"}}
|
||||||
|
@allowEdit={{true}}
|
||||||
@onLabelEdit={{@onLabelEdit}}
|
@onLabelEdit={{@onLabelEdit}}
|
||||||
@labels={{this.member.labels}}
|
@labels={{this.member.labels}}
|
||||||
@triggerId="label-input"
|
@triggerId="label-input"
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
@triggerId="label-input"
|
@triggerId="label-input"
|
||||||
@labels={{@filter.value}}
|
@labels={{@filter.value}}
|
||||||
@allowCreation={{false}}
|
@allowCreation={{false}}
|
||||||
|
@allowEdit={{true}}
|
||||||
data-test-input=""
|
data-test-input=""
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,9 @@ testemail@example.com,Test Email,This is a test template for importing your memb
|
||||||
|
|
||||||
expect(findAll(`#${dropdownContentId} li.ember-power-select-option`).length, '# of label options').to.equal(1);
|
expect(findAll(`#${dropdownContentId} li.ember-power-select-option`).length, '# of label options').to.equal(1);
|
||||||
|
|
||||||
|
// label input doesn't allow editing from the import modal
|
||||||
|
expect(findAll(`#${dropdownContentId} [data-test-edit-label]`).length, '# of label edit buttons').to.equal(0);
|
||||||
|
|
||||||
await click(find(`#${dropdownContentId} li.ember-power-select-option`));
|
await click(find(`#${dropdownContentId} li.ember-power-select-option`));
|
||||||
|
|
||||||
expect(findAll(`${labelInput} .ember-power-select-multiple-options li`).length, '# of selected labels').to.equal(1);
|
expect(findAll(`${labelInput} .ember-power-select-multiple-options li`).length, '# of selected labels').to.equal(1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue