Changed recipient wording in publish flow to be more specific

no issue

- highlight all/free/paid/specific in the recipient overview wording in the options and confirmation stages of the publish flow
- fix "change settings" button on confirm step closing instead of going back to the options stage
This commit is contained in:
Kevin Ansfield 2022-05-06 10:23:37 +01:00
parent 416976368b
commit b39fc7dba5
4 changed files with 54 additions and 8 deletions

View File

@ -9,6 +9,7 @@
{{#if this.isConfirming}}
<EditorLabs::Modals::PublishFlow::Confirm
@publishOptions={{@data.publishOptions}}
@recipientType={{this.recipientType}}
@saveTask={{this.saveTask}}
@cancel={{this.toggleConfirm}}
@close={{@close}}
@ -21,6 +22,7 @@
{{else}}
<EditorLabs::Modals::PublishFlow::Options
@publishOptions={{@data.publishOptions}}
@recipientType={{this.recipientType}}
@confirm={{this.toggleConfirm}}
@close={{@close}}
/>

View File

@ -13,6 +13,28 @@ export default class PublishModalComponent extends Component {
@tracked isConfirming = false;
@tracked isComplete = false;
get recipientType() {
const filter = this.args.data.publishOptions.recipientFilter;
if (!filter) {
return 'none';
}
if (filter === 'status:free') {
return 'free';
}
if (filter === 'status:-free') {
return 'paid';
}
if (filter.includes('status:free') && filter.includes('status:-free')) {
return 'all';
}
return 'specific';
}
@action
toggleConfirm() {
// TODO: validate?

View File

@ -21,7 +21,21 @@
will be delivered to
{{#let (members-count-fetcher query=(hash filter=@publishOptions.fullRecipientFilter)) as |countFetcher|}}
<strong>{{pluralize countFetcher.count "member"}}</strong>
<strong>
{{if (eq @recipientType "all") "all"}}
{{countFetcher.count}}
{{!-- @recipientType = none/free/paid/all/specific --}}
{{if (not-eq @recipientType "all") @recipientType}}
</strong>
{{#if @publishOptions.onlyDefaultNewsletter}}
<strong>{{gh-pluralize countFetcher.count "member" without-count=true}}</strong>
{{else}}
<strong>{{gh-pluralize countFetcher.count "subscriber" without-count=true}}</strong>
of <strong>{{@publishOptions.newsletter.name}}</strong>
{{/if}}
{{/let}}
{{#if @publishOptions.willPublish}}
@ -47,7 +61,7 @@
@class="gh-btn gh-btn-gradient gh-btn-large"
/>
<div class="gh-publish-cta-secondary">
Or
<button type="button" class="gh-btn gh-btn-link gh-btn-large" {{on "click" @close}}>change settings</button>
Or
<button type="button" class="gh-btn gh-btn-link gh-btn-large" {{on "click" @cancel}}>change settings</button>
</div>
</div>

View File

@ -32,12 +32,20 @@
{{svg-jar "member"}}
<div class="gh-publish-setting-trigger">
{{#let (members-count-fetcher query=(hash filter=@publishOptions.fullRecipientFilter)) as |countFetcher|}}
{{if (eq @recipientType "all") "All"}}
{{countFetcher.count}}
{{!-- @recipientType = none/free/paid/all/specific --}}
{{if (not-eq @recipientType "all") @recipientType}}
{{#if @publishOptions.onlyDefaultNewsletter}}
{{gh-pluralize countFetcher.count "member" without-count=true}}
{{else}}
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
of <span class="gh-selected-newsletter">{{@publishOptions.newsletter.name}}</span>
{{/if}}
{{/let}}
{{#unless @publishOptions.onlyDefaultNewsletter}}
<span class="gh-selected-newsletter">{{@publishOptions.newsletter.name}}</span>
{{/unless}}
subscribers
</div>
<span class="{{if (eq this.openSection "emailRecipients") "expanded"}}">
{{svg-jar "arrow-down" class="icon-expand"}}
@ -99,7 +107,7 @@
<div class="gh-publish-cta">
<button type="button" class="gh-btn gh-btn-black gh-btn-large" {{on "click" @confirm}}><span>Looks good, next &rarr;</span></button>
<div class="gh-publish-cta-secondary">
Or
Or
<button type="button" class="gh-btn gh-btn-link gh-btn-large" {{on "click" @close}}>continue editing</button>
</div>
</div>