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 9c56825a5..718482076 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 @@ -270,6 +270,7 @@ artifact.delete.confirm.title=Artifact deletion artifact.delete.confirm.save=Are you sure to delete this artifact ? groupId.delete.confirm.title=GroupId deletion groupId.delete.confirm.save=Are you sure to delete groupId: {0} ? +groupdId.deleted=groupId {0} deleted. groupId.delete.missing.repoId= You must select a repository to delete a groupId. browse.artifact.version=Version browse.artifact.pom.snippet=POM Snippet diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index ae02c3a6f..eddc9867c 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -86,6 +86,8 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno } deleteGroupId=function(groupId){ + var previousHash=getUrlHash(); + $.log("previousHash:"+previousHash); var repoId=getSelectedBrowsingRepository(); if(!repoId){ displayErrorMessage($.i18n.prop('groupId.delete.missing.repoId')); @@ -97,8 +99,8 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno type:"GET", dataType:"json", success:function(data){ - - + window.sammyArchivaApplication.setLocation(previousHash); + displaySuccessMessage( $.i18n.prop("groupdId.deleted", groupId)); }, error:function(data){ displayRestError(data,"user-messages"); @@ -110,7 +112,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno }, $.i18n.prop('ok'), $.i18n.prop('cancel'), $.i18n.prop('groupId.delete.confirm.title'), - $.i18n.prop('groupId.delete.confirm.save')); + $.i18n.prop('groupId.delete.confirm.save',groupId)); } } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js index 629ad7866..cfb60c885 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js @@ -109,6 +109,11 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) { $(textId).focus(); } + getUrlHash=function(){ + var matches = window.location.toString().match(/^[^#]*(#.+)$/); + return matches ? matches[1] : null; + } + /** * clear #main-content and call clearUserMessages */ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html index 271aefdad..7dd83709e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html @@ -50,9 +50,16 @@ {{/if}} {{each(i,browseResultEntry) browseResultEntries}} {{if browseResultEntry.project}} -