You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/03/06 19:32:33 UTC

svn commit: r1297641 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva: general-admin.js templates/general-admin.html

Author: olamy
Date: Tue Mar  6 18:32:33 2012
New Revision: 1297641

URL: http://svn.apache.org/viewvc?rev=1297641&view=rev
Log:
[MRM-1577] rewrite legacy path admin page
ask confirmation before remove entry.

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js?rev=1297641&r1=1297640&r2=1297641&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js Tue Mar  6 18:32:33 2012
@@ -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){

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html?rev=1297641&r1=1297640&r2=1297641&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html Tue Mar  6 18:32:33 2012
@@ -146,3 +146,9 @@
     </form>
 </script>
 
+<script id="legacy-artifact-path-delete-warning-tmpl" type="text/html">
+    <div>
+      <span class="label label-warning">${$.i18n.prop('warning.not.undone.operation')}</span>
+    </div>
+</script>
+