mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Added loading for assigning comped subscription to member
no refs Adds loading indicator when member is being saved with new complimentary price
This commit is contained in:
parent
f9f925d923
commit
d3023e8b52
@ -74,7 +74,7 @@
|
||||
<label for="label-input">Labels</label>
|
||||
<GhMemberLabelInput @onChange={{action "setLabels"}} @labels={{this.member.labels}} @triggerId="label-input" data-test-input="" />
|
||||
</GhFormGroup>
|
||||
|
||||
|
||||
<GhFormGroup @errors={{this.member.errors}} @hasValidated={{this.member.hasValidated}} @property="note" @classNames="mb0 gh-member-note">
|
||||
<label for="member-note">Note <span class="midgrey-l2 fw4">(not visible to member)</span></label>
|
||||
<GhTextarea @id="member-note" @name="note" @class="gh-member-details-textarea" @tabindex="3"
|
||||
@ -110,9 +110,13 @@
|
||||
<div class="mb2">This member doesn't have subscriptions.</div>
|
||||
{{#unless this.member.isNew}}
|
||||
{{#if this.isAddComplimentaryAllowed}}
|
||||
<button type="button" class="gh-btn gh-btn-text green gh-btn-icon gh-btn-addproduct" {{action "addCompedSubscription"}}>
|
||||
<span>{{svg-jar "add"}} Add complimentary subscription</span>
|
||||
</button>
|
||||
{{#if this.isCreatingComplimentary}}
|
||||
Loading...
|
||||
{{else}}
|
||||
<button type="button" class="gh-btn gh-btn-text green gh-btn-icon gh-btn-addproduct" {{action "addCompedSubscription"}}>
|
||||
<span>{{svg-jar "add"}} Add complimentary subscription</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
</div>
|
||||
@ -181,9 +185,13 @@
|
||||
{{/each}}
|
||||
{{#if this.isAddComplimentaryAllowed}}
|
||||
<div class="gh-memberproduct-list-footer">
|
||||
<button type="button" class="gh-btn gh-btn-text green gh-btn-icon gh-btn-addproduct" {{action "addCompedSubscription"}}>
|
||||
<span>{{svg-jar "add"}} Add complimentary subscription</span>
|
||||
</button>
|
||||
{{#if this.isCreatingComplimentary}}
|
||||
Loading...
|
||||
{{else}}
|
||||
<button type="button" class="gh-btn gh-btn-text green gh-btn-icon gh-btn-addproduct" {{action "addCompedSubscription"}}>
|
||||
<span>{{svg-jar "add"}} Add complimentary subscription</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -79,6 +79,11 @@ export default class extends Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
get isCreatingComplimentary() {
|
||||
const {comped} = this.member.changedAttributes() || {};
|
||||
return comped && comped[0] === false && comped[1] === true && this.args.isSaveRunning;
|
||||
}
|
||||
|
||||
@action
|
||||
setProperty(property, value) {
|
||||
this.args.setProperty(property, value);
|
||||
@ -103,6 +108,7 @@ export default class extends Component {
|
||||
continueSubscription(subscriptionId) {
|
||||
this.continueSubscriptionTask.perform(subscriptionId);
|
||||
}
|
||||
|
||||
@action
|
||||
addCompedSubscription() {
|
||||
this.args.setProperty('comped', true);
|
||||
|
@ -32,6 +32,7 @@
|
||||
@scratchMember={{this.scratchMember}}
|
||||
@setProperty={{this.setProperty}}
|
||||
@saveMember={{this.save}}
|
||||
@isSaveRunning={{this.saveTask.isRunning}}
|
||||
@isLoading={{this.isLoading}} />
|
||||
</form>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user