FIX: Properly show information on saved plans

This commit is contained in:
Justin DiRose 2020-07-28 11:56:58 -05:00
parent 0a244111bc
commit 954beeb094
No known key found for this signature in database
GPG Key ID: 4B811FB264021800
3 changed files with 13 additions and 5 deletions

View File

@ -10,6 +10,6 @@ export default Component.extend({
actions: { actions: {
clickPlan(plan) { clickPlan(plan) {
this.set("selectedPlan", plan.id); this.set("selectedPlan", plan.id);
}, }
}, }
}); });

View File

@ -22,8 +22,11 @@ export default Route.extend({
product: product.get("id") product: product.get("id")
}); });
} else { } else {
plan = AdminPlan.find(id); plan = AdminPlan.find(id).then(result => {
plan.isRecurring = plan.type === "recurring"; result.isRecurring = result.type === "recurring";
return result;
});
} }
const groups = Group.findAll({ ignore_automatic: true }); const groups = Group.findAll({ ignore_automatic: true });

View File

@ -44,7 +44,12 @@
{{i18n 'discourse_subscriptions.admin.plans.plan.recurring'}} {{i18n 'discourse_subscriptions.admin.plans.plan.recurring'}}
</label> </label>
{{#if planFieldDisabled}} {{#if planFieldDisabled}}
{{input disabled=true value=model.plan.isRecurring}} {{input
type="checkbox"
name="recurring"
checked=model.plan.isRecurring
disabled=true
}}
{{else}} {{else}}
{{input {{input
type="checkbox" type="checkbox"