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('AECGetBySubmissionId');
20 'AECGetBySubmissionIdController',
21 function($scope, restAPISvc) {
25 function initialize() {
26 $scope.loading = false;
27 $scope.showResults = false;
29 $scope.resultsLayers = [];
30 $scope.resultsLayerTestSuitesNames = [];
31 $scope.selectedRobotTestResult = [];
36 $scope.submissions = data;
37 $scope.submissionsForDisplay = [];
43 if (submissionData.submissionStatus === "Completed") {
45 + submissionData.submissionId
47 + submissionData.blueprintInstanceForValidation.blueprint.blueprintName
49 + submissionData.blueprintInstanceForValidation.version
51 + submissionData.blueprintInstanceForValidation.layer
53 + submissionData.timeslot.lab.lab
54 + " Start date and time: "
55 + submissionData.timeslot.startDateTime
59 * submissionData.blueprintInstanceForValidation.timeslot.duration
61 $scope.submissionsForDisplay
67 $scope.selectedSubmissionChange = function(
70 $scope.resultsLayers = [];
71 $scope.resultsLayerTestSuitesNames = [];
72 $scope.selectedRobotTestResult = [];
73 $scope.loading = true;
74 $scope.showResults = false;
75 var id = selectedSubmission.substring(
76 selectedSubmission.indexOf("id:") + 4,
77 selectedSubmission.indexOf("blueprint") - 1);
80 "/api/results/getBySubmissionId/" + id,
82 $scope.loading = false;
83 if (data !== undefined) {
84 $scope.results = data;
90 .push(result.blueprintLayer);
92 $scope.showResults = true;
94 confirm("Error when committing the submission");
99 $scope.selectedResultsLayerChange = function(selectedLayer) {
100 $scope.resultsLayerTestSuitesNames = [];
101 $scope.robotTestResults = [];
102 $scope.selectedRobotTestResult = [];
103 var selectedLayerResult = [];
104 angular.forEach($scope.results, function(result) {
105 if (result.blueprintLayer === selectedLayer) {
106 selectedLayerResult = result;
109 $scope.robotTestResults = selectedLayerResult.robotTestResults;
110 angular.forEach($scope.robotTestResults, function(
112 $scope.resultsLayerTestSuitesNames
113 .push(robotTestResult.name);
117 $scope.selectedTestSuitesNameChange = function(
118 selectedTestSuiteName) {
121 $scope.robotTestResults,
122 function(robotTestResult) {
123 if (robotTestResult.name.trim() === selectedTestSuiteName
125 $scope.selectedRobotTestResult = robotTestResult;