Ghost/ghost/admin/app/components/editor/publish-options/email-recipients.hbs
Kevin Ansfield 63b1e4e8ad
Resolved power-select related deprecation warnings for loading components by string (#15466)
no issue

- in many places we were passing a string as an argument to a `<PowerSelect>` related component that referred to a component name, that was throwing deprecation warnings because those strings were used dynamically with `{{component}}` later on which isn't statically analyzable
- switched to passing a component explicitly with `{{component}}`
- https://github.com/embroider-build/embroider/blob/main/REPLACING-COMPONENT-HELPER.md#when-youre-passing-a-component-to-someone-else
2022-09-24 17:00:05 +02:00

30 lines
1.4 KiB
Handlebars

<div class="form-group max-width mb0">
<GhMembersRecipientSelect
@filter={{@publishOptions.recipientFilter}}
@newsletter={{@publishOptions.newsletter}}
@onChange={{@publishOptions.setRecipientFilter}}
@renderInPlace={{false}}
@dropdownClass="gh-publish-newsletter-dropdown"
/>
{{#if (gt @publishOptions.newsletters.length 1)}}
<div class="mt4" data-test-select="newsletter">
<label class="gh-main-section-header small bn">Newsletter</label>
<PowerSelect
@selected={{@publishOptions.newsletter}}
@options={{@publishOptions.newsletters}}
@onChange={{@publishOptions.setNewsletter}}
@triggerComponent={{component "gh-power-select/trigger"}}
@triggerClass="gh-publish-newsletter-trigger"
@dropdownClass="gh-publish-newsletter-dropdown"
as |newsletter|
>
<span data-test-select-option={{newsletter.name}}>{{newsletter.name}}</span>
{{!-- TODO: remove conditional when author/editor can fetch member counts --}}
{{#if @publishOptions.user.isAdmin}}
<span class="gh-newsletter-count">{{format-number newsletter.count.members}}</span>
{{/if}}
</PowerSelect>
</div>
{{/if}}
</div>