2 * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 var app = angular.module('ValidationResults');
20 'ValidationResultsController',
21 function($scope, restAPISvc, generalValidationResultsSvc,
22 $window, appContext, $location, $modal, $rootScope) {
24 $scope.getBlueprintLayers = generalValidationResultsSvc.getBlueprintLayers;
25 $scope.mapResult = generalValidationResultsSvc.mapResult;
26 $scope.filterWithLayer = generalValidationResultsSvc.filterWithLayer;
27 $scope.filterWithResult = generalValidationResultsSvc.filterWithResult;
28 $scope.filterWithTimestamp = generalValidationResultsSvc.filterWithTimestamp;
32 function initialize() {
33 $scope.loadingResults = true;
34 $scope.validationDbTestResults = [];
36 var searchObject = $location.search();
37 var submissionId = searchObject.submissionId;
38 var blueprintName = searchObject.blueprintName;
39 var version = searchObject.version;
40 var lab = searchObject.lab;
41 var allLayers = searchObject.allLayers;
42 var layer = searchObject.layer;
43 var optional = searchObject.optional;
44 var outcome = searchObject.outcome;
45 var timestamp = searchObject.timestamp;
46 var date = searchObject.date;
49 reqUrl = "/api/v1/results/getbysubmissionid/"
51 } else if (outcome !== undefined && !layer) {
52 reqUrl = "/api/v1/results/getlastrun/" + lab + "/"
53 + blueprintName + "/" + version + "/"
54 + allLayers + "/" + optional + "/"
56 } else if (outcome !== undefined) {
59 reqUrl = "/api/v1/results/getlastrunoflayers/"
60 + lab + "/" + blueprintName + "/" + version
61 + "/" + layers + "/" + optional + "/"
63 } else if (timestamp) {
64 reqUrl = "/api/v1/results/getbytimestamp/" + lab
65 + "/" + blueprintName + "/" + version + "/"
68 reqUrl = "/api/v1/results/getbasedondate/" + lab
69 + "/" + blueprintName + "/" + version + "/"
72 reqUrl = "/api/v1/results/getmostrecent/"
73 + blueprintName + "/" + version + "/" + lab;
78 function(resultData) {
80 $scope.loadingResults = false;
81 if (!Array.isArray(resultData)) {
82 $scope.validationDbTestResults
85 $scope.validationDbTestResults = resultData;
88 confirm("No data was found");
89 $scope.loadingResults = false;
92 $scope.descending = true;
95 $scope.dateTimeSort = function(validationDbTestResult) {
96 return new Date(validationDbTestResult.dateStorage)
100 $scope.descendingOrder = function() {
101 $scope.descending = true;
104 $scope.ascendingOrder = function() {
105 $scope.descending = false;
108 $scope.refreshValidationResults = function() {
112 $scope.getTestSuiteResults = function(
113 validationDbTestResult) {
114 if (!generalValidationResultsSvc
115 .mapResult(validationDbTestResult)) {
118 var scope = $rootScope.$new();
119 scope.params = validationDbTestResult;
123 templateUrl : 'app/BluvalUI/ValidationResults/TestSuiteResults/TestSuiteResultsModal.html',
124 controller : 'TestSuiteResultsController'