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() {
27 $scope.resultsLayers = [];
28 $scope.resultsLayerTestSuitesNames = [];
29 $scope.selectedRobotTestResult = [];
34 $scope.submissions = data;
35 $scope.submissionsForDisplay = [];
42 + submissionData.submissionId
44 + submissionData.blueprintInstanceForValidation.blueprint.blueprintName
46 + submissionData.blueprintInstanceForValidation.version
48 + submissionData.blueprintInstanceForValidation.layer
50 + submissionData.timeslot.lab.lab
51 + " Start date and time: "
52 + submissionData.timeslot.startDateTime
55 * submissionData.blueprintInstanceForValidation.timeslot.duration
57 $scope.submissionsForDisplay
62 $scope.selectedSubmissionChange = function(
65 $scope.resultsLayers = [];
66 $scope.resultsLayerTestSuitesNames = [];
67 $scope.selectedRobotTestResult = [];
68 var id = selectedSubmission.substring(
69 selectedSubmission.indexOf("id:") + 4,
70 selectedSubmission.indexOf("blueprint") - 1);
73 "/api/results/getBySubmissionId/" + id,
75 if (data !== undefined) {
76 $scope.results = data;
82 .push(result.blueprintLayer);
85 confirm("Error when committing the submission");
90 $scope.selectedResultsLayerChange = function(selectedLayer) {
91 $scope.resultsLayerTestSuitesNames = [];
92 $scope.robotTestResults = [];
93 $scope.selectedRobotTestResult = [];
94 var selectedLayerResult = [];
95 angular.forEach($scope.results, function(result) {
96 if (result.blueprintLayer === selectedLayer) {
97 selectedLayerResult = result;
100 $scope.robotTestResults = selectedLayerResult.robotTestResults;
101 angular.forEach($scope.robotTestResults, function(
103 $scope.resultsLayerTestSuitesNames
104 .push(robotTestResult.name);
108 $scope.selectedTestSuitesNameChange = function(
109 selectedTestSuiteName) {
112 $scope.robotTestResults,
113 function(robotTestResult) {
114 if (robotTestResult.name.trim() === selectedTestSuiteName
116 $scope.selectedRobotTestResult = robotTestResult;