From 9d07033a6949af2816fa4a7b234f2f3bcf027707 Mon Sep 17 00:00:00 2001 From: thuva4 Date: Mon, 8 Jan 2018 15:11:17 +0530 Subject: Add links in prods,projects and results pages Add links for the redirection Created Result page Change-Id: I7ba80f6a8d774d6fde33280f701c1188cb5c32d9 Signed-off-by: thuva4 --- .../tests/UI/e2e/testCasesControllerSpec.js | 10 +- testapi/opnfv_testapi/ui/app.js | 5 + testapi/opnfv_testapi/ui/components/pods/pods.html | 13 ++- .../projects/project/testCases/testCases.html | 11 +- .../ui/components/projects/projects.html | 13 +-- .../ui/components/results/result/result.html | 115 +++++++++++++++++++++ .../components/results/result/resultController.js | 74 +++++++++++++ .../ui/components/results/results.html | 2 +- .../ui/components/results/resultsController.js | 5 + testapi/opnfv_testapi/ui/index.html | 1 + 10 files changed, 217 insertions(+), 32 deletions(-) create mode 100644 testapi/opnfv_testapi/ui/components/results/result/result.html create mode 100644 testapi/opnfv_testapi/ui/components/results/result/resultController.js diff --git a/testapi/opnfv_testapi/tests/UI/e2e/testCasesControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/testCasesControllerSpec.js index d6b5b9f..d509c57 100644 --- a/testapi/opnfv_testapi/tests/UI/e2e/testCasesControllerSpec.js +++ b/testapi/opnfv_testapi/tests/UI/e2e/testCasesControllerSpec.js @@ -538,14 +538,6 @@ describe('testing the test cases page for user who is in submitter group', funct expect(editOperation.isDisplayed()).toBe(true); }); - it('View Operation is visible for user ', function () { - browser.get(baseURL+"#/projects/testproject"); - var testCases = element(by.linkText('Test Cases')); - testCases.click(); - var viewOperation = element(by.css('a[class=text-info]')); - expect(viewOperation.isDisplayed()).toBe(true); - }); - it('Create the test case', function () { browser.get(baseURL+"#/projects/testproject"); var testCases = element(by.linkText('Test Cases')); @@ -635,7 +627,7 @@ describe('testing the test cases page for user who is in submitter group', funct browser.get(baseURL+"#/projects/testproject"); var testCases = element(by.linkText('Test Cases')); testCases.click(); - var viewOperation = element(by.css('a[class=text-info]')); + var viewOperation = element(by.linkText('testCase')); viewOperation.click(); var name = element(by.model('TestCaseModalCtrl.testcase.name')); var EC = browser.ExpectedConditions; diff --git a/testapi/opnfv_testapi/ui/app.js b/testapi/opnfv_testapi/ui/app.js index 2a34838..3da12b1 100644 --- a/testapi/opnfv_testapi/ui/app.js +++ b/testapi/opnfv_testapi/ui/app.js @@ -89,6 +89,11 @@ templateUrl: 'testapi-ui/components/results/results.html', controller: 'ResultsController as ctrl' }). + state('result', { + url: '/result/:_id', + templateUrl: 'testapi-ui/components/results/result/result.html', + controller: 'ResultController as ctrl' + }). state('profile', { url: '/profile', templateUrl: 'testapi-ui/components/profile/profile.html', diff --git a/testapi/opnfv_testapi/ui/components/pods/pods.html b/testapi/opnfv_testapi/ui/components/pods/pods.html index 02f4a48..e092699 100644 --- a/testapi/opnfv_testapi/ui/components/pods/pods.html +++ b/testapi/opnfv_testapi/ui/components/pods/pods.html @@ -48,11 +48,11 @@ - Bulk Select + Bulk Select Name Role Mode - Operation + Operation @@ -62,16 +62,15 @@ - {{pod.name}} + {{pod.name}} {{pod.role}} {{pod.mode}} - + - + - + - diff --git a/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCases.html b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCases.html index 34656f3..00dd0f1 100644 --- a/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCases.html +++ b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCases.html @@ -32,7 +32,7 @@ Tier Blocking CI Loop - Operations + Operations @@ -50,15 +50,12 @@ {{ ctrl.data.tier}} {{ctrl.data.blocking}} {{ctrl.data.ci_loop}} - + - + - + - diff --git a/testapi/opnfv_testapi/ui/components/projects/projects.html b/testapi/opnfv_testapi/ui/components/projects/projects.html index e8bb947..8a27a57 100644 --- a/testapi/opnfv_testapi/ui/components/projects/projects.html +++ b/testapi/opnfv_testapi/ui/components/projects/projects.html @@ -40,7 +40,7 @@ Bulk Select Name Description - Operations + Operations @@ -50,17 +50,14 @@ - {{project.name}} + {{project.name}} {{project.description}} - + - + - + - diff --git a/testapi/opnfv_testapi/ui/components/results/result/result.html b/testapi/opnfv_testapi/ui/components/results/result/result.html new file mode 100644 index 0000000..b435dce --- /dev/null +++ b/testapi/opnfv_testapi/ui/components/results/result/result.html @@ -0,0 +1,115 @@ +Result +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Id :{{ctrl.data._id}}
Pod Name:{{ctrl.data.pod_name}}
Project Name:{{ctrl.data.project_name}}
Case Name :{{ctrl.data.case_name}}
Installer :{{ctrl.data.installer}}
Version :{{ctrl.data.version}}
Scenario :{{ctrl.data.scenario}}
Build tag :{{ctrl.data['build_tag']}}
Criteria :{{ctrl.data.criteria}}
Start Date:{{ctrl.data.start_date}}
Stop Date :{{ctrl.data.stop_date}}
Trust Indicator : + +

Hide

+

Show

+
+ + + + + + + + + + + + +
Current :{{ctrl.data.trust_indicator.current}}
Histories :{{ctrl.data.trust_indicator.histories}}
+
Details : + +

Hide

+

Show

+
+ + + + + + + + + + + + + + + + + + + + +
Failures :{{ctrl.data.details.failures}}
Details :{{ctrl.data.details.errors}}
Stream :

{{ctrl.data.details.stream}}

TestsRun :

{{ctrl.data.details.testsRun}}

+
+
+
+
+ + +
\ No newline at end of file diff --git a/testapi/opnfv_testapi/ui/components/results/result/resultController.js b/testapi/opnfv_testapi/ui/components/results/result/resultController.js new file mode 100644 index 0000000..028e5d8 --- /dev/null +++ b/testapi/opnfv_testapi/ui/components/results/result/resultController.js @@ -0,0 +1,74 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +(function () { + 'use strict'; + + angular + .module('testapiApp') + .controller('ResultController', ResultController); + + ResultController.$inject = [ + '$scope', '$http', '$filter', '$state', '$window', '$uibModal', 'testapiApiUrl','raiseAlert', + 'confirmModal' + ]; + + /** + * TestAPI ResultController + * This controller is for the '/result/:_id' page where a user can browse + * through result declared in TestAPI. + */ + function ResultController($scope, $http, $filter, $state, $window, $uibModal, testapiApiUrl, + raiseAlert, confirmModal) { + var ctrl = this; + ctrl.url = testapiApiUrl + '/results'; + ctrl._id = $state.params['_id']; + ctrl.loadDetails = loadDetails + ctrl.showTrustIndicator = showTrustIndicator + ctrl.showDetails = showDetails + + /** + *Contact the testapi and retrevie the result details + */ + function loadDetails(){ + var resultUrl = ctrl.url + '/' + ctrl._id; + ctrl.showError = false; + ctrl.podsRequest = + $http.get(resultUrl).success(function (data) { + ctrl.data = data; + }).catch(function (error) { + ctrl.data = null; + ctrl.showError = true; + ctrl.error = error.statusText; + }); + } + + function showTrustIndicator(){ + if(ctrl.trust_indicator){ + ctrl.trust_indicator = false + }else{ + ctrl.trust_indicator = true + } + } + + function showDetails(){ + if(ctrl.details){ + ctrl.details = false + }else{ + ctrl.details = true + } + } + ctrl.loadDetails(); + } +})(); \ No newline at end of file diff --git a/testapi/opnfv_testapi/ui/components/results/results.html b/testapi/opnfv_testapi/ui/components/results/results.html index 0e7b8d5..7809065 100644 --- a/testapi/opnfv_testapi/ui/components/results/results.html +++ b/testapi/opnfv_testapi/ui/components/results/results.html @@ -110,7 +110,7 @@ - {{ result._id }} + {{ result._id }} {{ result.pod_name }} {{ result.project_name }} {{ result.case_name }} diff --git a/testapi/opnfv_testapi/ui/components/results/resultsController.js b/testapi/opnfv_testapi/ui/components/results/resultsController.js index e9b4443..55bf0ba 100644 --- a/testapi/opnfv_testapi/ui/components/results/resultsController.js +++ b/testapi/opnfv_testapi/ui/components/results/resultsController.js @@ -62,6 +62,7 @@ ctrl.deleteTag = deleteTag; ctrl.filterList= filterList; ctrl.testFilter = testFilter + ctrl.viewResult = viewResult; ctrl.tagArray = {} @@ -127,6 +128,10 @@ ctrl.filterList(); } + function viewResult(_id){ + $state.go('result', {'_id':_id}, {reload: true}); + } + function deleteTag(index){ delete ctrl.tagArray[index]; ctrl.filterList(); diff --git a/testapi/opnfv_testapi/ui/index.html b/testapi/opnfv_testapi/ui/index.html index 98f1ed8..5e69e87 100644 --- a/testapi/opnfv_testapi/ui/index.html +++ b/testapi/opnfv_testapi/ui/index.html @@ -48,6 +48,7 @@ + -- cgit 1.2.3-korg