From 69a8122ca68111cce353bf77ed8489690fef1df1 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 11 Feb 2022 15:20:28 +0000 Subject: [PATCH] Disabled non-functional edit buttons in labels dropdown when importing members (#2258) closes https://github.com/TryGhost/Team/issues/1320 - added `@allowEdit` argument to `` 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 --- ghost/admin/.lint-todo | 1 + ghost/admin/app/components/gh-member-label-input.hbs | 6 +++--- ghost/admin/app/components/gh-member-settings-form.hbs | 1 + ghost/admin/app/components/members/filter-value.hbs | 1 + ghost/admin/tests/acceptance/members/import-test.js | 3 +++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ghost/admin/.lint-todo b/ghost/admin/.lint-todo index 74084a13ef..a770036f82 100644 --- a/ghost/admin/.lint-todo +++ b/ghost/admin/.lint-todo @@ -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|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-invalid-interactive|27|47|27|47|17660ddd048981e3ae59c14abced1e1966c8baa4|1644278400000|1646870400000|1649458800000|app/components/gh-member-label-input.hbs diff --git a/ghost/admin/app/components/gh-member-label-input.hbs b/ghost/admin/app/components/gh-member-label-input.hbs index c89acd5ce8..8d436b7f19 100644 --- a/ghost/admin/app/components/gh-member-label-input.hbs +++ b/ghost/admin/app/components/gh-member-label-input.hbs @@ -23,10 +23,10 @@ data-test-label-filter={{label.name}}> {{label.name}} - {{#if label.slug}} - + {{#if (and @allowEdit label.slug)}} + {{/if}} diff --git a/ghost/admin/app/components/gh-member-settings-form.hbs b/ghost/admin/app/components/gh-member-settings-form.hbs index fda45ae9cd..ebb37fe0ca 100644 --- a/ghost/admin/app/components/gh-member-settings-form.hbs +++ b/ghost/admin/app/components/gh-member-settings-form.hbs @@ -27,6 +27,7 @@ diff --git a/ghost/admin/tests/acceptance/members/import-test.js b/ghost/admin/tests/acceptance/members/import-test.js index f621e11101..1d171fdb06 100644 --- a/ghost/admin/tests/acceptance/members/import-test.js +++ b/ghost/admin/tests/acceptance/members/import-test.js @@ -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); + // 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`)); expect(findAll(`${labelInput} .ember-power-select-multiple-options li`).length, '# of selected labels').to.equal(1);