aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-06-28 08:29:49 +0000
committerOlivier Lamy <olamy@apache.org>2012-06-28 08:29:49 +0000
commit4abbc9105048f42f2bf8e6351272c1c8c7496f3c (patch)
tree723947e72d34dbb84b7494d95d66057b33c7db67
parent128399c7dd816ac69568f62e26576d4facc29b9c (diff)
downloadarchiva-4abbc9105048f42f2bf8e6351272c1c8c7496f3c.tar.gz
archiva-4abbc9105048f42f2bf8e6351272c1c8c7496f3c.zip
refresh artifacts view after deletion
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1354857 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js13
1 files changed, 11 insertions, 2 deletions
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 00159c2b9..8c0ccc4e2 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
@@ -278,7 +278,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
artifactDownloadInfosUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(self.version);
artifactDownloadInfosUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
$.get(artifactDownloadInfosUrl,function(data){
- var artifactDetailsDownloadViewModel = new ArtifactDetailsDownloadViewModel(mapArtifacts(data));
+ var artifactDetailsDownloadViewModel = new ArtifactDetailsDownloadViewModel(mapArtifacts(data),self);
mainContent.find("#artifact-details-download-content" ).attr("data-bind",'template:{name:"artifact-details-download-content_tmpl"}');
ko.applyBindings(artifactDetailsDownloadViewModel,mainContent.find("#artifact-details-download-content" ).get(0));
});
@@ -387,8 +387,9 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
}
- ArtifactDetailsDownloadViewModel=function(artifacts){
+ ArtifactDetailsDownloadViewModel=function(artifacts, artifactVersionDetailViewModel){
this.artifacts=ko.observableArray(artifacts);
+ this.artifactVersionDetailViewModel=artifactVersionDetailViewModel;
var self=this;
deleteArtifact=function(artifact){
@@ -404,6 +405,14 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
success:function(data){
self.artifacts.remove(artifact);
displaySuccessMessage( $.i18n.prop('artifact.deleted'));
+ // reload datas from server
+ var artifactDownloadInfosUrl = "restServices/archivaServices/browseService/artifactDownloadInfos/"+encodeURIComponent(self.artifactVersionDetailViewModel.groupId);
+ artifactDownloadInfosUrl+="/"+encodeURIComponent(self.artifactVersionDetailViewModel.artifactId)+"/"+encodeURIComponent(self.artifactVersionDetailViewModel.version);
+ artifactDownloadInfosUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
+ $.get(artifactDownloadInfosUrl,function(data){
+ self.artifacts(mapArtifacts(data));
+ });
+
},
error:function(data){
displayRestError(data,"user-messages");