2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
23 var detailsDialogController = function($scope, $http, $timeout, $log,
\r
24 MsoService, DetailsService, UtilityService, COMPONENT, FIELD) {
\r
26 $scope.isDialogVisible = false;
\r
27 $scope.summaryControl = {};
\r
28 $scope.detailsControl = {};
\r
30 $scope.$on(COMPONENT.SHOW_COMPONENT_DETAILS, function(event, request) {
\r
33 $scope.isSpinnerVisible = true;
\r
34 $scope.isErrorVisible = false;
\r
35 $scope.isDialogVisible = true;
\r
36 $scope.popup.isVisible = true;
\r
38 DetailsService.initializeComponent(request.componentId);
\r
40 $scope.componentName = DetailsService.getComponentDisplayName();
\r
42 $scope.summaryControl.setList(DetailsService.getSummaryList());
\r
44 $scope.detailsControl.setList(DetailsService.getDetailsList());
\r
46 UtilityService.setHttpErrorHandler(function(response) {
\r
47 showError(FIELD.ERROR.SYSTEM_FAILURE, UtilityService
\r
48 .getHttpErrorMessage(response));
\r
51 MsoService.getOrchestrationRequests(
\r
52 DetailsService.getMsoFilterString(), handleGetResponse);
\r
55 var handleGetResponse = function(response) {
\r
56 $scope.isSpinnerVisible = false;
\r
58 $scope.log = MsoService
\r
59 .getFormattedGetOrchestrationRequestsResponse(response);
\r
61 $scope.log = MsoService.getFormattedCommonResponse(response);
\r
62 MsoService.showResponseContentError(error, showError);
\r
66 $scope.close = function() {
\r
67 $scope.isDialogVisible = false;
\r
68 $scope.popup.isVisible = false;
\r
71 var showError = function(summary, details) {
\r
72 var message = summary;
\r
73 if (UtilityService.hasContents(details)) {
\r
74 message += " (" + details + ")";
\r
76 $scope.isSpinnerVisible = false;
\r
77 $scope.isErrorVisible = true;
\r
78 $scope.error = message;
\r
82 appDS2.controller("detailsDialogController", [ "$scope", "$http", "$timeout",
\r
83 "$log", "MsoService", "DetailsService", "UtilityService", "COMPONENT", "FIELD",
\r
84 detailsDialogController ]);
\r