Skip to content
Snippets Groups Projects
Commit 32fcf88d authored by juanf's avatar juanf
Browse files

SSDM-12402: Bugfix, trascan to show wait feedback

parent ec15cc72
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -153,7 +153,7 @@ var Util = new function() { ...@@ -153,7 +153,7 @@ var Util = new function() {
Util.showError(errorMessage, function() {Util.unblockUI();}, undefined, isUserFailureException || isAuthorizationException); Util.showError(errorMessage, function() {Util.unblockUI();}, undefined, isUserFailureException || isAuthorizationException);
} }
this.showWarning = function(text, okCallback) { this.showWarning = function(text, okCallback, notUnblockOnAccept) {
var css = { var css = {
'text-align' : 'left', 'text-align' : 'left',
'top' : '15%', 'top' : '15%',
...@@ -169,7 +169,9 @@ var Util = new function() { ...@@ -169,7 +169,9 @@ var Util = new function() {
$("#warningAccept").on("click", function(event) { $("#warningAccept").on("click", function(event) {
okCallback(); okCallback();
Util.unblockUI(); if(!notUnblockOnAccept) {
Util.unblockUI();
}
}); });
$("#warningCancel").on("click", function(event) { $("#warningCancel").on("click", function(event) {
......
...@@ -20,27 +20,31 @@ function TrashManagerController(mainController) { ...@@ -20,27 +20,31 @@ function TrashManagerController(mainController) {
this._trashManagerView = new TrashManagerView(this, this._trashManagerModel); this._trashManagerView = new TrashManagerView(this, this._trashManagerModel);
this.revertDeletions = function(deletionIds) { this.revertDeletions = function(deletionIds) {
Util.blockUINoMessage(); Util.blockUI();
mainController.serverFacade.revertDeletions(deletionIds, function() { mainController.serverFacade.revertDeletions(deletionIds, function() {
Util.showSuccess("Deletions Reverted.", function() {}); Util.showSuccess("Deletions Reverted.", function() {
mainController.changeView('showTrashcanPage', null); Util.unblockUI();
mainController.changeView('showTrashcanPage', null);
});
}); });
} }
this.deletePermanently = function(deletionIds, forceDeletionOfDependentDeletions) { this.deletePermanently = function(deletionIds, forceDeletionOfDependentDeletions) {
Util.blockUINoMessage(); Util.blockUI();
mainController.serverFacade.deletePermanently(deletionIds, forceDeletionOfDependentDeletions, function(data) { mainController.serverFacade.deletePermanently(deletionIds, forceDeletionOfDependentDeletions, function(data) {
if(data.error) { if(data.error) {
Util.showError(data.error.message, null, true, true, false, true); Util.showError(data.error.message, null, true, true, false, true);
} else { } else {
Util.showSuccess("Permanently Deleted."); Util.showSuccess("Permanently Deleted.", function() {
mainController.changeView('showTrashcanPage', null); Util.unblockUI();
mainController.changeView('showTrashcanPage', null);
});
} }
}); });
} }
this.emptyTrash = function() { this.emptyTrash = function() {
Util.blockUINoMessage(); Util.blockUI();
var deleteIds = []; var deleteIds = [];
for(var delIdx = 0; delIdx < this._trashManagerModel.deletions.length; delIdx++) { for(var delIdx = 0; delIdx < this._trashManagerModel.deletions.length; delIdx++) {
...@@ -52,8 +56,10 @@ function TrashManagerController(mainController) { ...@@ -52,8 +56,10 @@ function TrashManagerController(mainController) {
if(data.error) { if(data.error) {
Util.showError(data.error.message, null, true, true, false, true); Util.showError(data.error.message, null, true, true, false, true);
} else { } else {
Util.showSuccess("Trashcan cleaned."); Util.showSuccess("Trashcan cleaned.", function() {
mainController.changeView('showTrashcanPage', null); Util.unblockUI();
mainController.changeView('showTrashcanPage', null);
});
} }
}); });
} }
......
...@@ -32,7 +32,7 @@ function TrashManagerView(trashManagerController, trashManagerModel) { ...@@ -32,7 +32,7 @@ function TrashManagerView(trashManagerController, trashManagerModel) {
deleteAllBtn.click(function() { deleteAllBtn.click(function() {
Util.showWarning(deleteMessageMany, function() { Util.showWarning(deleteMessageMany, function() {
_this._trashManagerController.emptyTrash(); _this._trashManagerController.emptyTrash();
}); }, true);
}); });
$header.append($("<h1>").append("Trashcan")); $header.append($("<h1>").append("Trashcan"));
...@@ -104,7 +104,7 @@ function TrashManagerView(trashManagerController, trashManagerModel) { ...@@ -104,7 +104,7 @@ function TrashManagerView(trashManagerController, trashManagerModel) {
$removeOption.click(function(e) { $removeOption.click(function(e) {
Util.showWarning(deleteMessageOne, function() { Util.showWarning(deleteMessageOne, function() {
_this._trashManagerController.deletePermanently([data.entity.id], false); _this._trashManagerController.deletePermanently([data.entity.id], false);
}); }, true);
}); });
$list.append($removeOption); $list.append($removeOption);
...@@ -113,7 +113,7 @@ function TrashManagerView(trashManagerController, trashManagerModel) { ...@@ -113,7 +113,7 @@ function TrashManagerView(trashManagerController, trashManagerModel) {
$removeIncludedOption.click(function(e) { $removeIncludedOption.click(function(e) {
Util.showWarning(deleteMessageOne, function() { Util.showWarning(deleteMessageOne, function() {
_this._trashManagerController.deletePermanently([data.entity.id], true); _this._trashManagerController.deletePermanently([data.entity.id], true);
}); }, true);
}); });
$list.append($removeIncludedOption); $list.append($removeIncludedOption);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment