From 2ceb4f1119a0e22b0374c63c4f8b68a51c6f3da8 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Tue, 18 Jul 2023 11:56:51 -0400 Subject: [PATCH 1/7] (bug) incorrect date range in statistics --- .../src/javascript/controllers/admin/statistics.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/frontend/src/javascript/controllers/admin/statistics.js b/app/frontend/src/javascript/controllers/admin/statistics.js index ca545b2e1..12c80ca72 100644 --- a/app/frontend/src/javascript/controllers/admin/statistics.js +++ b/app/frontend/src/javascript/controllers/admin/statistics.js @@ -502,8 +502,8 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', scroll: ES_SCROLL_TIME + 'm', 'stat-type': type, 'custom-query': custom ? JSON.stringify(Object.assign({ exclude: custom.exclude }, buildElasticCustomCriterion(custom))) : '', - 'start-date': moment($scope.datePickerStart.selected).format(), - 'end-date': moment($scope.datePickerEnd.selected).format(), + 'start-date': moment($scope.datePickerStart.selected).format('YYYY-MM-DD'), + 'end-date': moment($scope.datePickerEnd.selected).format('YYYY-MM-DD'), body: buildElasticDataQuery(type, custom, $scope.agePicker.start, $scope.agePicker.end, moment($scope.datePickerStart.selected), moment($scope.datePickerEnd.selected), $scope.sorting) } , function (error, response) { @@ -537,8 +537,8 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', { range: { date: { - gte: intervalBegin.format(), - lte: intervalEnd.format() + gte: intervalBegin.format('YYYY-MM-DD'), + lte: intervalEnd.format('YYYY-MM-DD') } } } @@ -767,8 +767,8 @@ Application.Controllers.controller('ExportStatisticsController', ['$scope', '$ui { range: { date: { - gte: moment($scope.dates.start).format(), - lte: moment($scope.dates.end).format() + gte: moment($scope.dates.start).format('YYYY-MM-DD'), + lte: moment($scope.dates.end).format('YYYY-MM-DD') } } } From 8f237ff4ecb4943fb109555715816490799f16c3 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Wed, 19 Jul 2023 08:53:59 +0200 Subject: [PATCH 2/7] (doc) update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70af09fab..97eff6139 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog Fab-manager +- Fix a bug: incorrect date range in statistics + ## v6.0.10 2023 July 13 - Fix a bug: unable to confirm payment of store for admin From a4d6723413d77feaf4c4ee8d5c995bf97abad22c Mon Sep 17 00:00:00 2001 From: Vincent Date: Thu, 20 Jul 2023 09:35:58 +0200 Subject: [PATCH 3/7] (ui) Fix machines padding --- app/frontend/templates/machines/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/frontend/templates/machines/index.html b/app/frontend/templates/machines/index.html index 2bb53d553..5c597ef40 100644 --- a/app/frontend/templates/machines/index.html +++ b/app/frontend/templates/machines/index.html @@ -13,7 +13,7 @@ -
Date: Fri, 21 Jul 2023 10:21:08 +0200 Subject: [PATCH 4/7] Fix a bug: hide project categories filter if there is no project categories, Improvement : dialog confirm to remove a project category --- CHANGELOG.md | 2 ++ .../javascript/controllers/admin/projects.js | 20 +++++++++++++++---- .../admin/projects/project_categories.html | 7 +++---- app/frontend/templates/projects/index.html | 2 +- config/locales/app.admin.en.yml | 2 ++ config/locales/app.admin.fr.yml | 2 ++ 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97eff6139..731a9d425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog Fab-manager - Fix a bug: incorrect date range in statistics +- Fix a bug: hide project categories filter if there is no project categories +- Improvement : dialog confirm to remove a project category ## v6.0.10 2023 July 13 diff --git a/app/frontend/src/javascript/controllers/admin/projects.js b/app/frontend/src/javascript/controllers/admin/projects.js index 4f25dd2ae..710585d8d 100644 --- a/app/frontend/src/javascript/controllers/admin/projects.js +++ b/app/frontend/src/javascript/controllers/admin/projects.js @@ -12,8 +12,8 @@ */ 'use strict'; -Application.Controllers.controller('AdminProjectsController', ['$scope', '$state', 'Component', 'Licence', 'Theme', 'ProjectCategory', 'componentsPromise', 'licencesPromise', 'themesPromise', 'projectCategoriesPromise', '_t', 'Member', 'uiTourService', 'settingsPromise', 'growl', - function ($scope, $state, Component, Licence, Theme, ProjectCategory, componentsPromise, licencesPromise, themesPromise, projectCategoriesPromise, _t, Member, uiTourService, settingsPromise, growl) { +Application.Controllers.controller('AdminProjectsController', ['$scope', '$state', 'Component', 'Licence', 'Theme', 'ProjectCategory', 'componentsPromise', 'licencesPromise', 'themesPromise', 'projectCategoriesPromise', '_t', 'Member', 'uiTourService', 'settingsPromise', 'growl', 'dialogs', + function ($scope, $state, Component, Licence, Theme, ProjectCategory, componentsPromise, licencesPromise, themesPromise, projectCategoriesPromise, _t, Member, uiTourService, settingsPromise, growl, dialogs) { // Materials list (plastic, wood ...) $scope.components = componentsPromise; @@ -136,8 +136,20 @@ Application.Controllers.controller('AdminProjectsController', ['$scope', '$state * @param index {number} project category index in the $scope.projectCategories array */ $scope.removeProjectCategory = function (index) { - ProjectCategory.delete($scope.projectCategories[index]); - return $scope.projectCategories.splice(index, 1); + return dialogs.confirm({ + resolve: { + object () { + return { + title: _t('app.admin.project_categories.delete_dialog_title'), + msg: _t('app.admin.project_categories.delete_dialog_info') + }; + } + } + } + , function () { // cancel confirmed + ProjectCategory.delete($scope.projectCategories[index]); + $scope.projectCategories.splice(index, 1); + }); }; /** diff --git a/app/frontend/templates/admin/projects/project_categories.html b/app/frontend/templates/admin/projects/project_categories.html index 36667205b..37881502e 100644 --- a/app/frontend/templates/admin/projects/project_categories.html +++ b/app/frontend/templates/admin/projects/project_categories.html @@ -10,12 +10,11 @@ - - {{ projectCategory.name }} - + + {{ projectCategory.name }} + -