diff --git a/CHANGELOG.md b/CHANGELOG.md index 999a75be2..1ec25a4b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## next deploy - Fix a bug: admins are shown in select member for reservation by admin +- Fix a bug: unable to show tours in machines and spaces page ## v5.4.2 2022 June 1 diff --git a/app/frontend/src/javascript/controllers/machines.js.erb b/app/frontend/src/javascript/controllers/machines.js.erb index ef0e6fb83..68ba37ae7 100644 --- a/app/frontend/src/javascript/controllers/machines.js.erb +++ b/app/frontend/src/javascript/controllers/machines.js.erb @@ -213,14 +213,14 @@ Application.Controllers.controller('MachinesController', ['$scope', '$state', '_ }); // on tour end, save the status in database uitour.on('ended', function () { - if (uitour.getStatus() === uitour.Status.ON && $scope.currentUser.profile.tours.indexOf('machines') < 0) { + if (uitour.getStatus() === uitour.Status.ON && $scope.currentUser.profile_attributes.tours.indexOf('machines') < 0) { Member.completeTour({ id: $scope.currentUser.id }, { tour: 'machines' }, function (res) { - $scope.currentUser.profile.tours = res.tours; + $scope.currentUser.profile_attributes.tours = res.tours; }); } }); // if the user has never seen the tour, show him now - if (settingsPromise.feature_tour_display !== 'manual' && $scope.currentUser.profile.tours.indexOf('machines') < 0) { + if (settingsPromise.feature_tour_display !== 'manual' && $scope.currentUser.profile_attributes.tours.indexOf('machines') < 0) { uitour.start(); } } diff --git a/app/frontend/src/javascript/controllers/spaces.js.erb b/app/frontend/src/javascript/controllers/spaces.js.erb index eafae63fe..d3be7749c 100644 --- a/app/frontend/src/javascript/controllers/spaces.js.erb +++ b/app/frontend/src/javascript/controllers/spaces.js.erb @@ -186,14 +186,14 @@ Application.Controllers.controller('SpacesController', ['$scope', '$state', 'spa }); // on tour end, save the status in database uitour.on('ended', function () { - if (uitour.getStatus() === uitour.Status.ON && $scope.currentUser.profile.tours.indexOf('spaces') < 0) { + if (uitour.getStatus() === uitour.Status.ON && $scope.currentUser.profile_attributes.tours.indexOf('spaces') < 0) { Member.completeTour({ id: $scope.currentUser.id }, { tour: 'spaces' }, function (res) { - $scope.currentUser.profile.tours = res.tours; + $scope.currentUser.profile_attributes.tours = res.tours; }); } }); // if the user has never seen the tour, show him now - if (settingsPromise.feature_tour_display !== 'manual' && $scope.currentUser.profile.tours.indexOf('spaces') < 0) { + if (settingsPromise.feature_tour_display !== 'manual' && $scope.currentUser.profile_attributes.tours.indexOf('spaces') < 0) { uitour.start(); } }