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));
});
}
- ArtifactDetailsDownloadViewModel=function(artifacts){
+ ArtifactDetailsDownloadViewModel=function(artifacts, artifactVersionDetailViewModel){
this.artifacts=ko.observableArray(artifacts);
+ this.artifactVersionDetailViewModel=artifactVersionDetailViewModel;
var self=this;
deleteArtifact=function(artifact){
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");