mirror of
https://github.com/sismics/docs.git
synced 2025-12-22 06:01:42 +00:00
Closes #306: Prevent deleting/renaming users/groups used in route models
This commit is contained in:
@@ -46,12 +46,17 @@ angular.module('docs').controller('SettingsGroupEdit', function($scope, $dialog,
|
||||
$state.go('settings.group.edit', { name: group.name });
|
||||
}
|
||||
}, function (e) {
|
||||
if (e.data.type === 'GroupAlreadyExists') {
|
||||
var title = $translate.instant('settings.group.edit.edit_group_failed_title');
|
||||
var msg = $translate.instant('settings.group.edit.edit_group_failed_message');
|
||||
var btns = [{result: 'ok', label: $translate.instant('ok'), cssClass: 'btn-primary'}];
|
||||
$dialog.messageBox(title, msg, btns);
|
||||
}
|
||||
if (e.data.type === 'GroupAlreadyExists') {
|
||||
var title = $translate.instant('settings.group.edit.edit_group_failed_title');
|
||||
var msg = $translate.instant('settings.group.edit.edit_group_failed_message');
|
||||
var btns = [{result: 'ok', label: $translate.instant('ok'), cssClass: 'btn-primary'}];
|
||||
$dialog.messageBox(title, msg, btns);
|
||||
} else if (e.data.type === 'GroupUsedInRouteModel') {
|
||||
var title = $translate.instant('settings.group.edit.group_used_title');
|
||||
var msg = $translate.instant('settings.group.edit.group_used_message', { name: e.data.message });
|
||||
var btns = [{result: 'ok', label: $translate.instant('ok'), cssClass: 'btn-primary'}];
|
||||
$dialog.messageBox(title, msg, btns);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -71,8 +76,13 @@ angular.module('docs').controller('SettingsGroupEdit', function($scope, $dialog,
|
||||
Restangular.one('group', $stateParams.name).remove().then(function() {
|
||||
$scope.loadGroups();
|
||||
$state.go('settings.group');
|
||||
}, function() {
|
||||
$state.go('settings.group');
|
||||
}, function(e) {
|
||||
if (e.data.type === 'GroupUsedInRouteModel') {
|
||||
var title = $translate.instant('settings.group.edit.group_used_title');
|
||||
var msg = $translate.instant('settings.group.edit.group_used_message', { name: e.data.message });
|
||||
var btns = [{result: 'ok', label: $translate.instant('ok'), cssClass: 'btn-primary'}];
|
||||
$dialog.messageBox(title, msg, btns);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -70,8 +70,13 @@ angular.module('docs').controller('SettingsUserEdit', function($scope, $dialog,
|
||||
Restangular.one('user', $stateParams.username).remove().then(function () {
|
||||
$scope.loadUsers();
|
||||
$state.go('settings.user');
|
||||
}, function() {
|
||||
$state.go('settings.user');
|
||||
}, function(e) {
|
||||
if (e.data.type === 'UserUsedInRouteModel') {
|
||||
var title = $translate.instant('settings.user.edit.user_used_title');
|
||||
var msg = $translate.instant('settings.user.edit.user_used_message', { name: e.data.message });
|
||||
var btns = [{result: 'ok', label: $translate.instant('ok'), cssClass: 'btn-primary'}];
|
||||
$dialog.messageBox(title, msg, btns);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -288,6 +288,8 @@
|
||||
"edit": {
|
||||
"delete_user_title": "Delete user",
|
||||
"delete_user_message": "Do you really want to delete this user? All associated documents, files and tags will be deleted",
|
||||
"user_used_title": "User in use",
|
||||
"user_used_message": "This user is used in the workflow \"{{ name }}\"",
|
||||
"edit_user_failed_title": "User already exists",
|
||||
"edit_user_failed_message": "This username is already taken by another user",
|
||||
"edit_user_title": "Edit \"{{ username }}\"",
|
||||
@@ -363,6 +365,8 @@
|
||||
"delete_group_message": "Do you really want to delete this group?",
|
||||
"edit_group_failed_title": "Group already exists",
|
||||
"edit_group_failed_message": "This group name is already taken by another group",
|
||||
"group_used_title": "Group in use",
|
||||
"group_used_message": "This group is used in the workflow \"{{ name }}\"",
|
||||
"edit_group_title": "Edit \"{{ name }}\"",
|
||||
"add_group_title": "Add a group",
|
||||
"name": "Name",
|
||||
|
||||
@@ -325,7 +325,7 @@
|
||||
"type_approve": "Approbation",
|
||||
"type_validate": "Validation",
|
||||
"target": "Assigné à",
|
||||
"target_help": "<strong>Approbation :</strong> Accepter ou rejeter l'étape de workflow<br/><strong>Validation :</strong> Examiner et poursuivre le workflow",
|
||||
"target_help": "<strong>Approbation :</strong> Accepter ou rejeter l\\'étape de workflow<br/><strong>Validation :</strong> Examiner et poursuivre le workflow",
|
||||
"add_step": "Ajouter une étape de workflow",
|
||||
"actions": "Qu'est-ce qui se passe après?",
|
||||
"remove_action": "Supprimer l'action",
|
||||
|
||||
Reference in New Issue
Block a user