From fcb3251ff65ba302bd22e131a11f36f74b2e08c6 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 6 Mar 2012 18:32:33 +0000 Subject: [PATCH] [MRM-1577] rewrite legacy path admin page ask confirmation before remove entry. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1297641 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/webapp/js/archiva/general-admin.js | 40 ++++++++++++------- .../js/archiva/templates/general-admin.html | 6 +++ 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js index 55428825d..1160a0bea 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js @@ -203,21 +203,31 @@ $(function() { } removeLegacyArtifactPath=function(legacyArtifactPath){ - $.ajax("restServices/archivaServices/archivaAdministrationService/deleteLegacyArtifactPath?path="+encodeURIComponent(legacyArtifactPath.path()), - { - type: "GET", - dataType: 'json', - success: function(data) { - self.legacyArtifactPaths.remove(legacyArtifactPath); - displaySuccessMessage($.i18n.prop('legacy-artifact-path.removed',legacyArtifactPath.path())); - activateLegacyArtifactPathsGridTab(); - }, - error: function(data) { - var res = $.parseJSON(data.responseText); - displayRestError(res); - } - } - ); + + openDialogConfirm( + function(){ + + $.ajax("restServices/archivaServices/archivaAdministrationService/deleteLegacyArtifactPath?path="+encodeURIComponent(legacyArtifactPath.path()), + { + type: "GET", + dataType: 'json', + success: function(data) { + self.legacyArtifactPaths.remove(legacyArtifactPath); + displaySuccessMessage($.i18n.prop('legacy-artifact-path.removed',legacyArtifactPath.path())); + activateLegacyArtifactPathsGridTab(); + }, + error: function(data) { + var res = $.parseJSON(data.responseText); + displayRestError(res); + }, + complete: function(){ + closeDialogConfirm(); + } + } + ); + }, $.i18n.prop('ok'), $.i18n.prop('cancel'), $.i18n.prop('legacy-artifact-path.delete.confirm',legacyArtifactPath.path()), + $("#legacy-artifact-path-delete-warning-tmpl" ).tmpl(legacyArtifactPath)); + } updateLegacyArtifactPath=function(legacyArtifactPath){ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html index 9a39acc8d..50330b4d1 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html @@ -146,3 +146,9 @@ + + -- 2.39.5