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.getLab = generalValidationResultsSvc.getLab;
32 function initialize() {
33 $scope.loadingResults = true;
34 $scope.validationNexusTestResults = [];
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) {
85 $scope.silos = siloData;
86 $scope.loadingResults = false;
88 .isArray(resultData)) {
89 $scope.validationNexusTestResults
92 $scope.validationNexusTestResults = resultData;
96 confirm("No data was found");
97 $scope.loadingResults = false;
100 $scope.descending = true;
103 $scope.dateTimeSort = function(validationNexusTestResult) {
104 return new Date(validationNexusTestResult.dateOfStorage)
108 $scope.descendingOrder = function() {
109 $scope.descending = true;
112 $scope.ascendingOrder = function() {
113 $scope.descending = false;
116 $scope.refreshValidationResults = function() {
120 $scope.getTestSuiteResults = function(
121 validationNexusTestResult) {
122 if (!generalValidationResultsSvc
123 .mapResult(validationNexusTestResult)) {
126 var scope = $rootScope.$new();
127 scope.params = validationNexusTestResult;
131 templateUrl : 'app/BluvalUI/ValidationResults/TestSuiteResults/TestSuiteResultsModal.html',
132 controller : 'TestSuiteResultsController'