diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ca497bdd..732dcac75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog Fab-manager +## v5.6.2 2023 January 9 + +- Improved fix_invoice_item task +- Improved test coverage +- Fix a bug: unable to set some dates for the events if user is in negative timezone +- Fix a bug: events are shown as over and unbookable, starting from midnight at the event end's day +- Fix a bug: updating a space/machine/event/training removes the image +- Fix a bug: cryptic error message when failed to create a manager +- Fix a bug: unable to restore accounting periods closed by a deleted admin +- Fix a bug: unable to build an accounting archive if the operator was deleted +- Fix a bug: unable to udpate an event category + ## v5.6.1 2023 January 6 - Fix a bug: allow decimal values for VAT rates diff --git a/app/controllers/api/events_controller.rb b/app/controllers/api/events_controller.rb index 12ccbf2c8..9937d63bc 100644 --- a/app/controllers/api/events_controller.rb +++ b/app/controllers/api/events_controller.rb @@ -95,7 +95,7 @@ class API::EventsController < API::ApiController :amount, :nb_total_places, :availability_id, :all_day, :recurrence, :recurrence_end_at, :category_id, :event_theme_ids, :age_range_id, event_theme_ids: [], - event_image_attributes: [:attachment], + event_image_attributes: %i[id attachment], event_files_attributes: %i[id attachment _destroy], event_price_categories_attributes: %i[id price_category_id amount _destroy], advanced_accounting_attributes: %i[code analytical_section]) diff --git a/app/controllers/api/machines_controller.rb b/app/controllers/api/machines_controller.rb index aabe63c92..4084bfab7 100644 --- a/app/controllers/api/machines_controller.rb +++ b/app/controllers/api/machines_controller.rb @@ -50,7 +50,7 @@ class API::MachinesController < API::ApiController def machine_params params.require(:machine).permit(:name, :description, :spec, :disabled, :machine_category_id, :plan_ids, :reservable, - plan_ids: [], machine_image_attributes: [:attachment], + plan_ids: [], machine_image_attributes: %i[id attachment], machine_files_attributes: %i[id attachment _destroy], advanced_accounting_attributes: %i[code analytical_section]) end diff --git a/app/controllers/api/spaces_controller.rb b/app/controllers/api/spaces_controller.rb index 4945ddb44..f155e1d81 100644 --- a/app/controllers/api/spaces_controller.rb +++ b/app/controllers/api/spaces_controller.rb @@ -50,7 +50,7 @@ class API::SpacesController < API::ApiController def space_params params.require(:space).permit(:name, :description, :characteristics, :default_places, :disabled, - space_image_attributes: [:attachment], + space_image_attributes: %i[id attachment], space_files_attributes: %i[id attachment _destroy], advanced_accounting_attributes: %i[code analytical_section]) end diff --git a/app/controllers/api/trainings_controller.rb b/app/controllers/api/trainings_controller.rb index ba7e78325..81b711ab3 100644 --- a/app/controllers/api/trainings_controller.rb +++ b/app/controllers/api/trainings_controller.rb @@ -76,7 +76,7 @@ class API::TrainingsController < API::ApiController def training_params params.require(:training) .permit(:id, :name, :description, :machine_ids, :plan_ids, :nb_total_places, :public_page, :disabled, - training_image_attributes: [:attachment], machine_ids: [], plan_ids: [], + training_image_attributes: %i[id attachment], machine_ids: [], plan_ids: [], advanced_accounting_attributes: %i[code analytical_section]) end end diff --git a/app/frontend/src/javascript/controllers/admin/members.js b/app/frontend/src/javascript/controllers/admin/members.js index 3123f74e5..6d6408f59 100644 --- a/app/frontend/src/javascript/controllers/admin/members.js +++ b/app/frontend/src/javascript/controllers/admin/members.js @@ -1262,7 +1262,7 @@ Application.Controllers.controller('NewManagerController', ['$state', '$scope', return $state.go('app.admin.members'); } , function (error) { - growl.error(_t('app.admin.admins_new.failed_to_create_manager') + JSON.stringify(error.data ? error.data : error)); + growl.error(_t('app.admin.manager_new.failed_to_create_manager') + JSON.stringify(error.data ? error.data : error)); console.error(error); } ); diff --git a/app/frontend/src/javascript/controllers/events.js.erb b/app/frontend/src/javascript/controllers/events.js.erb index 6969cb45a..48546ce18 100644 --- a/app/frontend/src/javascript/controllers/events.js.erb +++ b/app/frontend/src/javascript/controllers/events.js.erb @@ -162,6 +162,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' // Get the details for the current event (event's id is recovered from the current URL) $scope.event = eventPromise; + $scope.eventEndDateTime = moment(`${eventPromise.end_date}T${eventPromise.end_time}:00`); // the application global settings $scope.settings = settingsPromise; @@ -259,7 +260,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' $scope.isShowReserveEventButton = () => { return $scope.event.nb_free_places > 0 && !$scope.reserve.toReserve && - $scope.now.isBefore($scope.event.end_date) && + $scope.now.isBefore($scope.eventEndDateTime) && helpers.isUserValidatedByType($scope.ctrl.member, $scope.settings, 'event'); }; diff --git a/app/frontend/src/javascript/lib/api.ts b/app/frontend/src/javascript/lib/api.ts index 29c5374d6..b90cb27ce 100644 --- a/app/frontend/src/javascript/lib/api.ts +++ b/app/frontend/src/javascript/lib/api.ts @@ -18,7 +18,7 @@ export default class ApiLib { ...object, ...attachmentAttributes.reduce((a, name) => { return { ...a, [name]: null }; }, {}) } - }); + }, { dateWithTimezone: true }); attachmentAttributes.forEach((attr) => { data.delete(`${name}[${attr}]`); if (Array.isArray(object[attr])) { diff --git a/app/frontend/templates/events/show.html b/app/frontend/templates/events/show.html index dbfee4a87..ec362a3d5 100644 --- a/app/frontend/templates/events/show.html +++ b/app/frontend/templates/events/show.html @@ -173,7 +173,7 @@ -