From 9b144cbe6597dd41d81516a387a7989d9cafcfce Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 23 Mar 2012 08:33:16 +0000 Subject: [PATCH] [MRM-1615] Artifact detail view implements dependees tab. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1304228 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/search.js | 22 +++++++++++++-- .../webapp/js/archiva/templates/search.html | 27 ++++++++++++++++--- 2 files changed, 44 insertions(+), 5 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 ceedeb10c..1632acd12 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 @@ -217,13 +217,31 @@ $(function() { dataType: 'json', success: function(data) { var treeEntries = mapTreeEntries(data); - treeContentDiv.html($("#dependency_tree_tmpl" ).tmpl({treeEntries: treeEntries}));//[data[0]] + treeContentDiv.html($("#dependency_tree_tmpl" ).tmpl({treeEntries: treeEntries})); } }); //} } if ($(e.target).attr("href")=="#artifact-details-used-by-content") { - $.log("#artifact-details-used-by-content"); + var dependeesContentDiv=mainContent.find("#artifact-details-used-by-content" ); + //if( $.trim(dependeesContentDiv.html()).length<1){ + dependeesContentDiv.html(mediumSpinnerImg()); + var dependeesUrl="restServices/archivaServices/browseService/dependees/"+encodeURIComponent(groupId); + dependeesUrl+="/"+encodeURIComponent(artifactId); + dependeesUrl+="/"+encodeURIComponent(version); + var selectedRepo=getSelectedBrowsingRepository(); + if (selectedRepo){ + dependeesUrl+="?repositoryId="+encodeURIComponent(selectedRepo); + } + $.ajax(dependeesUrl, { + type: "GET", + dataType: 'json', + success: function(data) { + var artifacts=mapArtifacts(data); + dependeesContentDiv.html($("#dependees_tmpl" ).tmpl({artifacts: artifacts})); + } + }); + //} } }); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html index 09bcde81c..558a5e60d 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html @@ -610,9 +610,7 @@
-
- used by -
+
{{if projectVersionMetadata.mailingLists && projectVersionMetadata.mailingLists.length>0}} @@ -699,4 +697,27 @@ {{/if}} {{/each}} + + + \ No newline at end of file -- 2.39.5