Ghost/ghost/admin/app/components/dashboard/charts/engagement.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

50 lines
2.0 KiB
Handlebars

<section class="gh-dashboard-section gh-dashboard-engagement">
<article {{did-insert this.loadCharts}} class="gh-dashboard-box">
<Dashboard::Parts::Metric
@label="Engagement" />
<div class="gh-dashboard-columns">
<div class="gh-dashboard-column gh-dashboard-engagement-30days">
<Dashboard::Parts::Metric
@label="Engaged in the last 30 days"
@value={{this.data30Days}}
@secondary={{true}}
/>
</div>
<div class="gh-dashboard-column gh-dashboard-engagement-7days">
<Dashboard::Parts::Metric
@label="Engaged in the last 7 days"
@value={{this.data7Days}}
@secondary={{true}}
/>
</div>
<div class="gh-dashboard-column gh-dashboard-engagement-subscribers">
<Dashboard::Parts::Metric
@label="Newsletter subscribers"
@value={{this.dataSubscribers}}
@secondary={{true}}
/>
</div>
</div>
</article>
{{#if this.hasPaidTiers}}
<div class="gh-dashboard-select">
<PowerSelect
@selected={{this.selectedStatusOption}}
@options={{this.statusOptions}}
@searchEnabled={{false}}
@onChange={{this.onSwitchStatus}}
@triggerComponent={{component "gh-power-select/trigger"}}
@triggerClass="gh-contentfilter-menu-trigger"
@dropdownClass="gh-contentfilter-menu-dropdown is-narrow"
@matchTriggerWidth={{false}}
@horizontalPosition="right"
as |option|
>
{{#if option.name}}{{option.name}}{{else}}<span class="red">Unknown option</span>{{/if}}
</PowerSelect>
</div>
{{/if}}
</section>