mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Renamed member require payment setting
no issue Renames member setting `requirePaymentForsSignup` -> `allowSelfSignup` to match existing usage in members API
This commit is contained in:
parent
079f40611b
commit
e90b80822d
4 changed files with 10 additions and 30 deletions
|
@ -21,7 +21,7 @@ export default Component.extend({
|
||||||
yearly: yearlyPlan
|
yearly: yearlyPlan
|
||||||
};
|
};
|
||||||
subscriptionSettings.stripeConfig = stripeProcessor.config;
|
subscriptionSettings.stripeConfig = stripeProcessor.config;
|
||||||
subscriptionSettings.requirePaymentForSetup = !!subscriptionSettings.requirePaymentForSetup;
|
subscriptionSettings.allowSelfSignup = !!subscriptionSettings.allowSelfSignup;
|
||||||
subscriptionSettings.fromAddress = subscriptionSettings.fromAddress || 'noreply';
|
subscriptionSettings.fromAddress = subscriptionSettings.fromAddress || 'noreply';
|
||||||
|
|
||||||
return subscriptionSettings;
|
return subscriptionSettings;
|
||||||
|
@ -59,8 +59,8 @@ export default Component.extend({
|
||||||
return plan;
|
return plan;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (key === 'requirePaymentForSignup') {
|
if (key === 'allowSelfSignup') {
|
||||||
subscriptionSettings.requirePaymentForSignup = !subscriptionSettings.requirePaymentForSignup;
|
subscriptionSettings.allowSelfSignup = !subscriptionSettings.allowSelfSignup;
|
||||||
}
|
}
|
||||||
if (key === 'fromAddress') {
|
if (key === 'fromAddress') {
|
||||||
subscriptionSettings.fromAddress = event.target.value;
|
subscriptionSettings.fromAddress = event.target.value;
|
||||||
|
@ -75,7 +75,7 @@ export default Component.extend({
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return {
|
return {
|
||||||
isPaid: false,
|
isPaid: false,
|
||||||
requirePaymentForSignup: false,
|
allowSelfSignup: true,
|
||||||
fromAddress: 'noreply',
|
fromAddress: 'noreply',
|
||||||
paymentProcessors: [{
|
paymentProcessors: [{
|
||||||
adapter: 'stripe',
|
adapter: 'stripe',
|
||||||
|
|
|
@ -8,7 +8,6 @@ import {
|
||||||
isRequestEntityTooLargeError,
|
isRequestEntityTooLargeError,
|
||||||
isUnsupportedMediaTypeError
|
isUnsupportedMediaTypeError
|
||||||
} from 'ghost-admin/services/ajax';
|
} from 'ghost-admin/services/ajax';
|
||||||
import {computed} from '@ember/object';
|
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
@ -63,25 +62,6 @@ export default Controller.extend({
|
||||||
this.yamlMimeType = YAML_MIME_TYPE;
|
this.yamlMimeType = YAML_MIME_TYPE;
|
||||||
},
|
},
|
||||||
|
|
||||||
subscriptionSettings: computed('settings.membersSubscriptionSettings', function () {
|
|
||||||
let subscriptionSettings = this.parseSubscriptionSettings(this.get('settings.membersSubscriptionSettings'));
|
|
||||||
let stripeProcessor = subscriptionSettings.paymentProcessors.find((proc) => {
|
|
||||||
return (proc.adapter === 'stripe');
|
|
||||||
});
|
|
||||||
let monthlyPlan = stripeProcessor.config.plans.find(plan => plan.interval === 'month');
|
|
||||||
let yearlyPlan = stripeProcessor.config.plans.find(plan => plan.interval === 'year');
|
|
||||||
monthlyPlan.dollarAmount = parseInt(monthlyPlan.amount) ? (monthlyPlan.amount / 100) : 0;
|
|
||||||
yearlyPlan.dollarAmount = parseInt(yearlyPlan.amount) ? (yearlyPlan.amount / 100) : 0;
|
|
||||||
stripeProcessor.config.plans = {
|
|
||||||
monthly: monthlyPlan,
|
|
||||||
yearly: yearlyPlan
|
|
||||||
};
|
|
||||||
subscriptionSettings.stripeConfig = stripeProcessor.config;
|
|
||||||
subscriptionSettings.requirePaymentForSetup = !!subscriptionSettings.requirePaymentForSetup;
|
|
||||||
subscriptionSettings.fromAddress = subscriptionSettings.fromAddress || 'noreply';
|
|
||||||
return subscriptionSettings;
|
|
||||||
}),
|
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
onUpload(file) {
|
onUpload(file) {
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
|
|
|
@ -83,11 +83,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="for-switch">
|
<div class="for-switch">
|
||||||
<label class="switch" for="members-require-payment"
|
<label class="switch" for="members-allow-self-signup"
|
||||||
{{action "setSubscriptionSettings" "requirePaymentForSignup" bubbles="false"}}>
|
{{action "setSubscriptionSettings" "allowSelfSignup" bubbles="false"}}>
|
||||||
<input type="checkbox" checked={{subscriptionSettings.requirePaymentForSignup}} class="gh-input"
|
<input type="checkbox" checked={{subscriptionSettings.allowSelfSignup}} class="gh-input"
|
||||||
onclick={{action "setSubscriptionSettings" "requirePaymentForSignup"}}
|
onclick={{action "setSubscriptionSettings" "allowSelfSignup"}}
|
||||||
data-test-checkbox="members-require-payment">
|
data-test-checkbox="members-allow-self-signup">
|
||||||
<span class="input-toggle-component mt1"></span>
|
<span class="input-toggle-component mt1"></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -177,7 +177,7 @@ export default [
|
||||||
id: 23,
|
id: 23,
|
||||||
type: 'members',
|
type: 'members',
|
||||||
key: 'members_subscription_settings',
|
key: 'members_subscription_settings',
|
||||||
value: '{"isPaid":false,"requirePaymentForSignup":false,"fromAddress":"noreply","paymentProcessors":[{"adapter":"stripe","config":{"secret_token":"","public_token":"","product":{"name":"Ghost Subscription"},"plans":[{"name":"Monthly","currency":"usd","interval":"month","amount":""},{"name":"Yearly","currency":"usd","interval":"year","amount":""}]}}]}',
|
value: '{"isPaid":false,"allowSelfSignup":true,"fromAddress":"noreply","paymentProcessors":[{"adapter":"stripe","config":{"secret_token":"","public_token":"","product":{"name":"Ghost Subscription"},"plans":[{"name":"Monthly","currency":"usd","interval":"month","amount":""},{"name":"Yearly","currency":"usd","interval":"year","amount":""}]}}]}',
|
||||||
created_at: '2019-10-09T09:49:00.000Z',
|
created_at: '2019-10-09T09:49:00.000Z',
|
||||||
created_by: 1,
|
created_by: 1,
|
||||||
updated_at: '2019-10-09T09:49:00.000Z',
|
updated_at: '2019-10-09T09:49:00.000Z',
|
||||||
|
|
Loading…
Add table
Reference in a new issue