From 859544565b6aaf46a6cb0d9ed14db2ae0a238389 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 8 Jan 2019 09:38:35 +0100 Subject: [PATCH 1/2] [bug] first day of week is ignored in statistics custom filter --- CHANGELOG.md | 1 + app/assets/javascripts/controllers/admin/statistics.js.erb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de7536cfe..23ab9d595 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Fix a bug: error handling on password recovery - Fix a bug: error handling on machine attachment upload +- Fix a bug: first day of week is ignored in statistics custom filter - Refactored frontend invoices translations ## v2.8.1 2019 January 02 diff --git a/app/assets/javascripts/controllers/admin/statistics.js.erb b/app/assets/javascripts/controllers/admin/statistics.js.erb index 61f7a436d..d72ff1fca 100644 --- a/app/assets/javascripts/controllers/admin/statistics.js.erb +++ b/app/assets/javascripts/controllers/admin/statistics.js.erb @@ -94,9 +94,9 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', minDate: null, maxDate: moment().toDate(), options: { - startingDay: 1 + startingDay: Fablab.weekStartingDay } - } // France: the week starts on monday + } }; // available custom filters From d4cddc92fb401472fc00c9d0c937fc5ec031dfb6 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 8 Jan 2019 09:56:07 +0100 Subject: [PATCH 2/2] code comments --- app/controllers/api/abuses_controller.rb | 4 ++++ app/controllers/api/admins_controller.rb | 3 +++ app/controllers/api/age_ranges_controller.rb | 9 ++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/abuses_controller.rb b/app/controllers/api/abuses_controller.rb index 7e6639eeb..4a7397b19 100644 --- a/app/controllers/api/abuses_controller.rb +++ b/app/controllers/api/abuses_controller.rb @@ -1,3 +1,7 @@ +# frozen_string_literal: true + +# API Controller for resources of type Abuse. +# Typical action is an user reporting an abuse on a project class API::AbusesController < API::ApiController before_action :authenticate_user!, except: :create diff --git a/app/controllers/api/admins_controller.rb b/app/controllers/api/admins_controller.rb index 2caad5661..50f1c0492 100644 --- a/app/controllers/api/admins_controller.rb +++ b/app/controllers/api/admins_controller.rb @@ -1,3 +1,6 @@ +# frozen_string_literal: true + +# API Controller for resources of type User with role 'admin'. class API::AdminsController < API::ApiController before_action :authenticate_user! diff --git a/app/controllers/api/age_ranges_controller.rb b/app/controllers/api/age_ranges_controller.rb index 03c3a5602..f8805e3f1 100644 --- a/app/controllers/api/age_ranges_controller.rb +++ b/app/controllers/api/age_ranges_controller.rb @@ -1,13 +1,16 @@ +# frozen_string_literal: true + +# API Controller for resources of type AgeRange +# AgeRange are used in Events class API::AgeRangesController < API::ApiController before_action :authenticate_user!, except: [:index] - before_action :set_age_range, only: [:show, :update, :destroy] + before_action :set_age_range, only: %i[show update destroy] def index @age_ranges = AgeRange.all end - def show - end + def show; end def create authorize AgeRange