diff options
author | Young Gyu Park <younggyu@google.com> | 2018-04-12 17:47:04 +0900 |
---|---|---|
committer | Young Gyu Park <younggyu@google.com> | 2018-04-16 09:41:16 +0900 |
commit | a0698d6c8f7e91e5067a82a1c16884fcc534e681 (patch) | |
tree | 3f57cefdd7030e22fd1b0eea2786769f4ad2be19 /src/main/webapp | |
parent | d3fe7f44e6d49e3a423b423c44b1625c771fe995 (diff) | |
download | dashboard-a0698d6c8f7e91e5067a82a1c16884fcc534e681.tar.gz |
Implementing pagination
Test: go/vts-web-staging/show_plan_release?plan=vts&type=suite&page=1
Bug: 77456536
Change-Id: I0e9c7ad04c8c832f4229d77c2840be813869d293
Diffstat (limited to 'src/main/webapp')
-rw-r--r-- | src/main/webapp/WEB-INF/datastore-indexes.xml | 5 | ||||
-rw-r--r-- | src/main/webapp/WEB-INF/jsp/show_suite_release.jsp | 42 |
2 files changed, 45 insertions, 2 deletions
diff --git a/src/main/webapp/WEB-INF/datastore-indexes.xml b/src/main/webapp/WEB-INF/datastore-indexes.xml index 244ad38..09aabb2 100644 --- a/src/main/webapp/WEB-INF/datastore-indexes.xml +++ b/src/main/webapp/WEB-INF/datastore-indexes.xml @@ -109,6 +109,11 @@ <datastore-index kind="TestSuiteResultEntity" ancestor="false" source="manual"> <property name="suitePlan" direction="asc"/> + <property name="__key__" direction="desc"/> + </datastore-index> + + <datastore-index kind="TestSuiteResultEntity" ancestor="false" source="manual"> + <property name="suitePlan" direction="asc"/> <property name="branch" direction="asc"/> <property name="target" direction="asc"/> </datastore-index> diff --git a/src/main/webapp/WEB-INF/jsp/show_suite_release.jsp b/src/main/webapp/WEB-INF/jsp/show_suite_release.jsp index 054a461..4600517 100644 --- a/src/main/webapp/WEB-INF/jsp/show_suite_release.jsp +++ b/src/main/webapp/WEB-INF/jsp/show_suite_release.jsp @@ -42,7 +42,7 @@ <div class="col s12"> <ul data-collapsible="expandable" class="collapsible popout test-runs"> - <c:forEach var="testSuiteResultEntity" items="${testSuiteResultEntityList}"> + <c:forEach var="testSuiteResultEntity" items="${testSuiteResultEntityPagination.list}"> <li class="test-run-container"> <div test="SampleShellTest" time="1522488372555217" class="collapsible-header test-run"> <span class="test-run-metadata"> @@ -57,7 +57,7 @@ (<c:out value="${executionTime}"></c:out>s) </span> <span class="indicator right center green"> - <c:out value="${testSuiteResultEntity.passedTestCaseRatio}"></c:out>/<c:out value="${testSuiteResultEntity.passedTestCaseRatio + testSuiteResultEntity.failedTestCaseCount}"></c:out> + <c:out value="${testSuiteResultEntity.passedTestCaseCount}"></c:out>/<c:out value="${testSuiteResultEntity.passedTestCaseCount + testSuiteResultEntity.failedTestCaseCount}"></c:out> </span> <i class="material-icons expand-arrow">expand_more</i> </div> @@ -86,6 +86,44 @@ </div> </div> + <div class="row"> + <div class="col s12"> + <ul class="pagination"> + <c:choose> + <c:when test="${testSuiteResultEntityPagination.minPageRange gt testSuiteResultEntityPagination.pageSize}"> + <li class="waves-effect"> + <a href="${requestScope['javax.servlet.forward.servlet_path']}?plan=${plan}&type=${testType}&page=${testSuiteResultEntityPagination.minPageRange - 1}&nextPageToken=${testSuiteResultEntityPagination.previousPageCountToken}"> + <i class="material-icons">chevron_left</i> + </a> + </li> + </c:when> + <c:otherwise> + + </c:otherwise> + </c:choose> + <c:forEach var="pageLoop" begin="${testSuiteResultEntityPagination.minPageRange}" end="${testSuiteResultEntityPagination.maxPageRange}"> + <li class="waves-effect"> + <a href="${requestScope['javax.servlet.forward.servlet_path']}?plan=${plan}&type=${testType}&page=${pageLoop}<c:if test="${testSuiteResultEntityPagination.currentPageCountToken ne ''}">&nextPageToken=${testSuiteResultEntityPagination.currentPageCountToken}</c:if>"> + <c:out value="${pageLoop}" /> + </a> + </li> + </c:forEach> + <c:choose> + <c:when test="${testSuiteResultEntityPagination.maxPages gt testSuiteResultEntityPagination.pageSize}"> + <li class="waves-effect"> + <a href="${requestScope['javax.servlet.forward.servlet_path']}?plan=${plan}&type=${testType}&page=${testSuiteResultEntityPagination.maxPageRange + 1}&nextPageToken=${testSuiteResultEntityPagination.nextPageCountToken}"> + <i class="material-icons">chevron_right</i> + </a> + </li> + </c:when> + <c:otherwise> + + </c:otherwise> + </c:choose> + </ul> + </div> + </div> + </div> <%@ include file='footer.jsp' %> </body> |