Commit 86813110 authored by Sascha Pfeiffer's avatar Sascha Pfeiffer

Fix #114 Show affected entries in warning dialogs

Signed-off-by: 's avatarSascha Pfeiffer <sascha.pfeiffer@psono.com>
parent dc584944
......@@ -183,6 +183,12 @@
},
description: function () {
return 'LEAVE_GROUP_WARNING';
},
entries: function () {
return [group.name];
},
affected_entries_text: function () {
return 'AFFECTED_GROUPS';
}
}
});
......@@ -216,19 +222,27 @@
* @description
* Deletes a given group
*
* @param {uuid} group_id The id of the group to delete
* @param {object} group The group to delete
*/
function delete_group(group_id) {
function delete_group(group) {
var group_id = group['group_id'];
var modalInstance = $uibModal.open({
templateUrl: 'view/modal/verify.html',
controller: 'ModalVerifyCtrl',
resolve: {
title: function () {
return 'Delete Group';
return 'DELETE_GROUP';
},
description: function () {
return 'You are about to delete the group. All shares will be lost / become inaccessible. Are you sure?';
return 'DELETE_GROUP_WARNING';
},
entries: function () {
return [group.name];
},
affected_entries_text: function () {
return 'AFFECTED_GROUPS';
}
}
});
......@@ -443,7 +457,7 @@
* @description
* Declines a given membership request
*
* @param {uuid} group The group to decline
* @param {object} group The group to decline
*/
function decline_group(group) {
......
......@@ -139,6 +139,12 @@
},
description: function () {
return 'DELETE_API_KEY_WARNING';
},
entries: function () {
return [api_key.title];
},
affected_entries_text: function () {
return 'AFFECTED_API_KEYS';
}
}
});
......
......@@ -142,6 +142,12 @@
},
description: function () {
return 'DELETE_FILE_REPOSITORY_WARNING';
},
entries: function () {
return [file_repository.title];
},
affected_entries_text: function () {
return 'AFFECTED_FILE_REPOSITORIES';
}
}
});
......@@ -229,6 +235,12 @@
},
description: function () {
return 'DELETE_FILE_REPOSITORY_RIGHT_WARNING';
},
entries: function () {
return [file_repository.title];
},
affected_entries_text: function () {
return 'AFFECTED_FILE_REPOSITORIES';
}
}
});
......
......@@ -10,14 +10,16 @@
* @description
* Controller for the "delete verification" modal
*/
angular.module('psonocli').controller('ModalVerifyCtrl', ['$scope', '$uibModalInstance', 'title', 'description',
function ($scope, $uibModalInstance, title, description) {
angular.module('psonocli').controller('ModalVerifyCtrl', ['$scope', '$uibModalInstance', 'title', 'description', 'entries', 'affected_entries_text',
function ($scope, $uibModalInstance, title, description, entries, affected_entries_text) {
$scope.confirm = confirm;
$scope.cancel = cancel;
$scope.title = title;
$scope.description = description;
$scope.entries = entries;
$scope.affected_entries_text = affected_entries_text;
/**
* @ngdoc
......
......@@ -247,6 +247,12 @@
},
description: function () {
return 'DELETE_FOLDER_WARNING';
},
entries: function () {
return [node.name];
},
affected_entries_text: function () {
return 'AFFECTED_FOLDERS';
}
}
});
......@@ -363,6 +369,12 @@
},
description: function () {
return 'DELETE_ENTRY_WARNING';
},
entries: function () {
return [item.name];
},
affected_entries_text: function () {
return 'AFFECTED_ENTRIES';
}
}
});
......
{
"DELETE_GROUP": "Gruppe löschen",
"DELETE_GROUP_WARNING": "Sie sind dabei diese Grupep zu lösschen. Alle Shares der Gruppe gehen dabei verloren oder werden unzugänglich. Sind sie sicher?",
"AFFECTED_GROUPS": "Betroffene Gruppen",
"AFFECTED_FILE_REPOSITORIES": "Betroffene Daten Repositories",
"AFFECTED_API_KEYS": "Betroffene API Schlüssel",
"AFFECTED_FOLDERS": "Betroffene Ordner",
"AFFECTED_ENTRIES": "Betroffene Einträge",
"USER_NOT_PART_OF_REQUIRED_GROUP": "Ihr Nutzerkonto ist nicht in einer der dafür berechtigten Gruppen",
"NO_SAML_TOKEN_ID_PROVIDED": "Keine SAML token ID angegeben.",
"LOGIN_INFO_CANNOT_BE_DECRYPTED": "Login Informationen konnten vom Server nicht entschlüsselt werden.",
......
{
"DELETE_GROUP": "Delete Group",
"DELETE_GROUP_WARNING": "You are about to delete the group. All shares will be lost / become inaccessible. Are you sure?",
"AFFECTED_GROUPS": "Affected groups",
"AFFECTED_FILE_REPOSITORIES": "Affected file repositories",
"AFFECTED_API_KEYS": "Affected API keys",
"AFFECTED_FOLDERS": "Affected folders",
"AFFECTED_ENTRIES": "Affected entries",
"USER_NOT_PART_OF_REQUIRED_GROUP": "Your account is not part of one of the authorized groups.",
"NO_SAML_TOKEN_ID_PROVIDED": "No SAML token id provided.",
"LOGIN_INFO_CANNOT_BE_DECRYPTED": "Login information could not be decrypted by the server.",
......
......@@ -66,7 +66,7 @@
</button>
</td>
<td>
<button type="button" class="btn btn-default btn-sm" ng-click="delete_group(group.group_id)"
<button type="button" class="btn btn-default btn-sm" ng-click="delete_group(group)"
ng-disabled="!group.group_admin || (group.accepted !== false && group.accepted !== true)" >
<i class="fa fa-trash" aria-hidden="true"><span style="display: none">0</span></i>
</button>
......
......@@ -5,6 +5,13 @@
</div>
<div class="modal-body">
<div class="form-group" ng-if="entries">
<strong>{{ affected_entries_text | translate}}:</strong>
<ul style="margin-top:10px">
<li ng-repeat="entry in entries">{{ entry }}</li>
</ul>
</div>
<div class="form-group alert alert-danger">
<strong>{{'DANGER' | translate}}!</strong> {{ description | translate }}
</div>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment