From 60d764a635b2ef01b42bb695ef29ead8f6fe9063 Mon Sep 17 00:00:00 2001 From: Young Gyu Park Date: Tue, 2 Oct 2018 12:49:54 +0900 Subject: Popup function won't work on show_tree page. Test: go/vts-web-staging Bug: 117130291 Change-Id: I10bae8d0d04df4e44034136c097dc76a09c792e8 --- src/main/webapp/WEB-INF/jsp/show_tree.jsp | 97 +++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'src/main') diff --git a/src/main/webapp/WEB-INF/jsp/show_tree.jsp b/src/main/webapp/WEB-INF/jsp/show_tree.jsp index 8db45cc..aa9b311 100644 --- a/src/main/webapp/WEB-INF/jsp/show_tree.jsp +++ b/src/main/webapp/WEB-INF/jsp/show_tree.jsp @@ -68,8 +68,67 @@ $('#newer-button').click(prev); $('#older-button').click(next); $('#test-results-container').showTests(${testRuns}); + + $('#apiCoverageModal').modal({ + width: '75%', + dismissible: true, // Modal can be dismissed by clicking outside of the modal + opacity: .5, // Opacity of modal background + inDuration: 300, // Transition in duration + outDuration: 200, // Transition out duration + startingTop: '4%', // Starting top style attribute + endingTop: '10%', // Ending top style attribute + ready: function(modal, trigger) { // Callback for Modal open. Modal and trigger parameters available. + var urlSafeKeyList = modal.data('urlSafeKeyList'); + var halApiInfoList = []; + var getAjaxList = $.map( urlSafeKeyList, function( urlSafeKey ) { + return $.get( "/api/coverage/api/data?key=" + urlSafeKey, function(data) { + halApiInfoList.push(data); + }) + .fail(function() { + alert( "Error : can't bring API coverage data from the server" ); + }); + }); + + $.when.apply($, getAjaxList).then(function() { + $.each(halApiInfoList, function( index, data ) { + $("#halApiList").append(halApiListTemplate()); + var version = data.halMajorVersion + '.' + data.halMinorVersion; + var defaultInfo = data.halPackageName + '@' + version + '::' + data.halInterfaceName; + $("#halApiList > li:last > div.collapsible-header").html( + 'report HAL API Information : ' + defaultInfo + ); + + $("#halApiList > li:last > div.collapsible-body > ul.collection.with-header").append( + $.map( data.halApi, function( apiName, idx ) { + var colorClass = data.coveredHalApi.indexOf(apiName) > -1 ? "green" : "red" + return '
  • ' + apiName + '
  • '; + }).join("") + ); + $("#halApiList").collapsible('open', index); + }); + $('#dataTableLoading').hide("slow"); + }); + }, + complete: function() { + $("#halApiList").empty(); + $('#dataTableLoading').show("slow"); + } // Callback for Modal close + } + ); }); + function halApiListTemplate() { + return '
  • ' + + '
    ' + + 'report API Information' + + '
    ' + + '
    ' + + '
      ' + + '
    ' + + '
    ' + + '
  • '; + } + // refresh the page to see the selected test types (pre-/post-submit) function refresh() { if($(this).hasClass('disabled')) return; @@ -221,6 +280,44 @@ + + + + <%@ include file="footer.jsp" %> -- cgit v1.2.3