From 1fc76c88ad544ebfb6aec8f6fa41ec33c162c1ba Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 10 Feb 2012 17:25:04 +0000 Subject: [PATCH] [MRM-1576] rewrite proxies connector page add confirm dialog for proxy connector delete. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242866 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/archiva/i18n/default.properties | 1 + .../src/main/webapp/js/archiva/network-proxies.js | 3 ++- .../main/webapp/js/archiva/proxy-connectors.js | 15 +++++++++------ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties index 06156c7a5..cd8b3f94e 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties @@ -142,4 +142,5 @@ proxyconnector.updated=ProxyConnector updated. proxy-connectors.grid.remoterepo.settings.popover.title=Proxy Connector Settings proxy-connectors.remoterepo.settings.networkproxy=Network Proxy proxy.connector.bulk.save.confirm=Are you sure to update {0} Proxy Connector(s) +proxyconnector.delete.confirm=Are you sure to delete the Proxy Connector diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js index ac66d285b..409858316 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js @@ -175,7 +175,8 @@ $(function() { removeNetworkProxy=function(networkProxy){ openDialogConfirm( - function(){$.ajax("restServices/archivaServices/networkProxyService/deleteNetworkProxy/"+encodeURIComponent(networkProxy.id()), + function(){ + $.ajax("restServices/archivaServices/networkProxyService/deleteNetworkProxy/"+encodeURIComponent(networkProxy.id()), { type: "get", success: function(data) { diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js index 42ff63b80..7dcd1f6d9 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js @@ -311,12 +311,15 @@ $(function() { mainContent.find("#proxy-connectors-view-tabs-li-edit a").html($.i18n.prop("edit")); } deleteProxyConnector=function(proxyConnector){ - clearUserMessages(); - removeProxyConnector(proxyConnector,function(){ - displaySuccessMessage($.i18n.prop('proxyconnector.removed')); - self.proxyConnectors.remove(proxyConnector); - //self.displayGrid(); - }); + + openDialogConfirm( + function(){ + clearUserMessages(); + removeProxyConnector(proxyConnector,function(){ + displaySuccessMessage($.i18n.prop('proxyconnector.removed')); + self.proxyConnectors.remove(proxyConnector); + closeDialogConfirm(); + })}, $.i18n.prop('ok'), $.i18n.prop('cancel'), $.i18n.prop('proxyconnector.delete.confirm'),null); } -- 2.39.5