From 65ba3a686be7b3d4b41a4a32180c0b69fac8350e Mon Sep 17 00:00:00 2001 From: Du Peng Date: Fri, 10 Sep 2021 15:34:49 +0200 Subject: [PATCH] disable monthly payment for 1 month of subscription --- app/frontend/src/javascript/components/plans/plan-card.tsx | 2 +- app/frontend/src/javascript/directives/cart.js | 1 - app/frontend/templates/admin/plans/_form.html | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/frontend/src/javascript/components/plans/plan-card.tsx b/app/frontend/src/javascript/components/plans/plan-card.tsx index ba18b6d7e..509ec8709 100644 --- a/app/frontend/src/javascript/components/plans/plan-card.tsx +++ b/app/frontend/src/javascript/components/plans/plan-card.tsx @@ -84,7 +84,7 @@ const PlanCardComponent: React.FC = ({ plan, userId, subscribedPl * Check if the plan is allowing a monthly payment schedule */ const canBeScheduled = (): boolean => { - return plan.monthly_payment && plan.interval_count !== 1; + return plan.monthly_payment; }; /** * Callback triggered when the user select the plan diff --git a/app/frontend/src/javascript/directives/cart.js b/app/frontend/src/javascript/directives/cart.js index 26840385a..3a69039d9 100644 --- a/app/frontend/src/javascript/directives/cart.js +++ b/app/frontend/src/javascript/directives/cart.js @@ -630,7 +630,6 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs', if (Auth.isAuthenticated()) { if ($scope.selectedPlan !== $scope.plan) { $scope.selectedPlan = $scope.plan; - if ($scope.selectedPlan.monthly_payment && $scope.selectedPlan.interval_count === 1) { $scope.selectedPlan.monthly_payment = false; } $scope.schedule.requested_schedule = $scope.plan.monthly_payment; } else { $scope.selectedPlan = null; diff --git a/app/frontend/templates/admin/plans/_form.html b/app/frontend/templates/admin/plans/_form.html index efea509ca..152c6ae73 100644 --- a/app/frontend/templates/admin/plans/_form.html +++ b/app/frontend/templates/admin/plans/_form.html @@ -132,7 +132,7 @@
- + {{ (plan.monthly_payment ? 'app.shared.buttons.yes' : 'app.shared.buttons.no') | translate }} {{ 'app.shared.plan.monthly_payment_info' }}