1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

(bug) canceled trainings are still shown on the public profile page

This commit is contained in:
Sylvain 2022-07-26 17:55:45 +02:00
parent 56b254dffc
commit df0b5628b3
3 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,7 @@
- Display bookers names to connected users now apply to all resources
- Updated rails locales files
- Usage of the rails logger instead of printing to standard output
- Fix a bug: canceled trainings are still shown on the public profile page
- Fix a bug: prevent same slot booking feature ignores canceled reservations
- Fix a bug: wrong currency on invoices files
- Fix a bug: unable to reserve if user's subscription plan is disabled

View File

@ -191,6 +191,14 @@ Application.Filters.filter('humanReadablePlanName', ['$filter', function ($filte
};
}]);
Application.Filters.filter('canceledReservationsFilter', [function () {
return function (elements) {
if (!angular.isUndefined(elements) && (elements != null)) {
return elements.filter(e => e.canceled_at === null);
}
};
}]);
Application.Filters.filter('trainingReservationsFilter', [function () {
return function (elements, selectedScope) {
if (!angular.isUndefined(elements) && !angular.isUndefined(selectedScope) && (elements != null) && (selectedScope != null)) {

View File

@ -74,7 +74,7 @@
<h1 class="red text-u-c" translate>{{ 'app.shared.public_profile.trainings' }}</h1>
<!-- <h3 class="text-u-c">Formations</h3> -->
<ul class="list-unstyled" ng-if="user.training_reservations.length > 0 || user.trainings.length > 0">
<li ng-repeat="r in user.training_reservations | trainingReservationsFilter:'future'">
<li ng-repeat="r in user.training_reservations | trainingReservationsFilter:'future' | canceledReservationsFilter">
{{r.reservable.name}} - <span class="label label-info text-white" translate>{{ 'app.shared.public_profile.to_come' }}</span>
</li>
<li ng-repeat="t in user.trainings">