diff --git a/CHANGELOG.md b/CHANGELOG.md index ae1660c85..2ab78ffee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Fix a bug: subscription page shows the groups without any active plans - Fix a bug: cart price inconsistently updated after a subscription - Fix a bug: background image of the profile is not shown and wrong menu hover color +- Fix a bug: do not show disabled groups and plans during availability creation - Fix a security issue: updated jquery to fix [CVE-2020-11023](https://nvd.nist.gov/vuln/detail/CVE-2020-11023) ## v4.3.4 2020 April 14 diff --git a/app/assets/javascripts/controllers/admin/calendar.js.erb b/app/assets/javascripts/controllers/admin/calendar.js.erb index 78c3f1ef5..287ae138b 100644 --- a/app/assets/javascripts/controllers/admin/calendar.js.erb +++ b/app/assets/javascripts/controllers/admin/calendar.js.erb @@ -757,9 +757,9 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui }); // group plans by Group - for (let group of Array.from(groupsPromise)) { + for (let group of groupsPromise.filter(g => !g.disabled)) { const groupObj = { id: group.id, name: group.name, plans: [] }; - for (let plan of Array.from(plansPromise)) { + for (let plan of plansPromise.filter(g => !g.disabled)) { if (plan.group_id === group.id) { groupObj.plans.push(plan); } } if (groupObj.plans.length > 0) { diff --git a/app/assets/javascripts/controllers/plans.js.erb b/app/assets/javascripts/controllers/plans.js.erb index 7f4fa4386..c19adf5fd 100644 --- a/app/assets/javascripts/controllers/plans.js.erb +++ b/app/assets/javascripts/controllers/plans.js.erb @@ -183,7 +183,7 @@ Application.Controllers.controller('PlansIndexController', ['$scope', '$rootScop for (let plan of plansPromise) { if (plan.group_id === group.id) { groupObj.plans.push(plan); - if (!plan.disabled) { groupObj.actives++; } + if (!plan.disabled) { groupplansClassifiedByGroupObj.actives++; } } } $scope.plansClassifiedByGroup.push(groupObj);