mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-28 09:24:24 +01:00
Fix a bug: hide project categories filter if there is no project categories, Improvement : dialog confirm to remove a project category
This commit is contained in:
parent
a4d6723413
commit
f466826e8b
@ -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
|
||||
|
||||
|
@ -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) {
|
||||
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]);
|
||||
return $scope.projectCategories.splice(index, 1);
|
||||
$scope.projectCategories.splice(index, 1);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -15,7 +15,6 @@
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<!-- form -->
|
||||
<form editable-form name="rowform" onbeforesave="saveProjectCategory($data, projectCategory.id)" ng-show="rowform.$visible" class="form-buttons form-inline" shown="inserted == projectCategory">
|
||||
<button type="submit" ng-disabled="rowform.$waiting" class="btn btn-warning">
|
||||
<i class="fa fa-check"></i>
|
||||
|
@ -61,7 +61,7 @@
|
||||
<option value="" translate>{{ 'app.public.projects_list.all_themes' }}</option>
|
||||
</select>
|
||||
|
||||
<select ng-model="search.project_category_id" ng-change="setUrlQueryParams(search) && triggerSearch()" class="form-control" ng-options="pc.id as pc.name for pc in projectCategories">
|
||||
<select ng-show="projectCategories.length" ng-model="search.project_category_id" ng-change="setUrlQueryParams(search) && triggerSearch()" class="form-control" ng-options="pc.id as pc.name for pc in projectCategories">
|
||||
<option value="" translate>{{ projectCategoriesFilterPlaceholder }}</option>
|
||||
</select>
|
||||
|
||||
|
@ -451,6 +451,8 @@ en:
|
||||
project_categories: Categories
|
||||
project_categories:
|
||||
name: "Name"
|
||||
delete_dialog_title: "Confirmation required"
|
||||
delete_dialog_info: "The associations between this category and the projects will me deleted."
|
||||
projects_setting:
|
||||
add: "Add"
|
||||
actions_controls: "Actions"
|
||||
|
@ -451,6 +451,8 @@ fr:
|
||||
project_categories: Personnalisation du filtre Catégories
|
||||
project_categories:
|
||||
name: "Nom"
|
||||
delete_dialog_title: "Confirmation requise"
|
||||
delete_dialog_info: "Les associations de cette catégorie avec des projets seront supprimées."
|
||||
projects_setting:
|
||||
add: "Ajouter"
|
||||
actions_controls: "Actions"
|
||||
|
Loading…
Reference in New Issue
Block a user