aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/controller
diff options
context:
space:
mode:
authorBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2019-06-12 15:55:45 +0200
committerWojciech Sliwka <wojciech.sliwka@nokia.com>2019-07-08 07:01:14 +0000
commit89b0566dcf587d36f713d301b27009ce1d3bbec6 (patch)
treea7e90f305ef6936d7d48b3fafd6e3289696855c6 /vid-app-common/src/main/webapp/app/vid/scripts/controller
parent5fdd07ac5c8b0a229b437aed258710a29801c31a (diff)
Adapting GUI for error report managing
Change-Id: Idb3f5750596334990b030bfdf2f6551ad4d1c8e3 Issue-ID: VID-488 Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/controller')
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js21
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js18
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js35
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js29
4 files changed, 97 insertions, 6 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
index 0705812f7..62ef1a4f2 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
@@ -22,8 +22,8 @@
(function () {
'use strict';
- appDS2.controller("ServiceModelController", function ($scope, $http, $location, COMPONENT, VIDCONFIGURATION, FIELD, DataService, vidService,
- PropertyService, UtilityService, AsdcService,$timeout) {
+ appDS2.controller("ServiceModelController",function ($uibModal, $scope, $http, $location, COMPONENT, VIDCONFIGURATION, FIELD, DataService, vidService,
+ PropertyService, UtilityService, AsdcService, $timeout, featureFlags) {
$scope.popup = {};
var defaultViewPerPage = 10;
@@ -132,7 +132,24 @@
$scope.currentPage++;
};
+ $scope.showReportWindow = function() {
+ const modalWindow = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/report-modal/report-modal.html',
+ controller: 'reportModalController',
+ controllerAs: 'vm',
+ resolve: {
+ errorMsg: function () {
+ return $scope.status;
+ }
+ }
+ });
+
+ };
+
+ $scope.isShowErrorReport = function() {
+ return featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_CREATE_ERROR_REPORTS);
+ };
$scope.createType = COMPONENT.A_LA_CARTE;
$scope.deployService = function(service) {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
index 16ec01dfd..191251860 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
@@ -24,6 +24,20 @@
appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "$uibModal", "VIDCONFIGURATION", "UtilityService", "vidService", "AaiService", "MsoService", "OwningEntityService", "AsdcService","featureFlags", "$q", "_",
function (COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, $uibModal, VIDCONFIGURATION, UtilityService, vidService, AaiService, MsoService, OwningEntityService, AsdcService, featureFlags, $q, _) {
+ $scope.showReportWindow = function() {
+
+ const modalWindow = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/report-modal/report-modal.html',
+ controller: 'reportModalController',
+ controllerAs: 'vm',
+ resolve: {
+ errorMsg: function () {
+ return $scope.errorMsg;
+ }
+ }
+ });
+ };
+
$scope.showVnfDetails = function (vnf) {
console.log("showVnfDetails");
DataService.setVnfInstanceId(COMPONENT.VNF_INSTANCE_ID);
@@ -728,6 +742,10 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
return featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_SHOW_VERIFY_SERVICE);
}
+ $scope.isShowErrorReport = function() {
+ return featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_CREATE_ERROR_REPORTS);
+ }
+
$scope.isEnableVerifyService = function () {
//Button should only be enabled when the service type is A la carte
if (DataService.getALaCarte()) {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js
index 57bf54bb6..15627835e 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js
@@ -21,15 +21,46 @@
"use strict";
var creationDialogController = function (COMPONENT, FIELD, PARAMETER, $scope, $http, $timeout, $log,
- CreationService, UtilityService, DataService, VIDCONFIGURATION, $location) {
+ CreationService, UtilityService, DataService, VIDCONFIGURATION, $location, $uibModal, featureFlags) {
$scope.isDialogVisible = false;
+ $scope.isServiceError = false;
$scope.summaryControl = {};
$scope.userProvidedControl = {};
+
var callbackFunction = undefined;
var componentId = undefined;
+ $scope.showReportWindow = function() {
+
+ let errorMsg;
+
+ if($scope.error !== undefined && $scope.error != null) {
+ errorMsg = $scope.error;
+ } else {
+ errorMsg = "";
+ }
+
+ const modalWindow = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/report-modal/report-modal.html',
+ controller: 'reportModalController',
+ controllerAs: 'vm',
+ resolve: {
+ errorMsg: function () {
+ return errorMsg;
+ }
+ }
+ });
+
+ $scope.isDialogVisible = false;
+ $scope.popup.isVisible = false;
+ };
+
+ $scope.isShowErrorReport = function() {
+ return featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_CREATE_ERROR_REPORTS);
+ };
+
$scope.shouldShowOldPopup = function () {
return !DataService.getShouldIncludeInAsyncInstantiationFlow();
};
@@ -68,6 +99,7 @@ var creationDialogController = function (COMPONENT, FIELD, PARAMETER, $scope, $h
CreationService.initializeComponent(request.componentId);
CreationService.setHttpErrorHandler(function (response) {
+ $scope.isServiceError = true;
showError(FIELD.ERROR.SYSTEM_FAILURE, UtilityService
.getHttpErrorMessage(response));
});
@@ -373,4 +405,5 @@ var creationDialogController = function (COMPONENT, FIELD, PARAMETER, $scope, $h
appDS2.controller("creationDialogController", ["COMPONENT", "FIELD", "PARAMETER", "$scope", "$http",
"$timeout", "$log", "CreationService", "UtilityService", "DataService", "VIDCONFIGURATION", "$location",
+ "$uibModal", "featureFlags",
creationDialogController]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js
index 9bb439fe3..a5c038830 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js
@@ -63,8 +63,8 @@
* "$scope.popup".
*/
-var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $window, $log,
- MsoService, PropertyService, UtilityService, TestEnvironmentsService) {
+var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $window, $log, $uibModal,
+ MsoService, PropertyService, UtilityService, TestEnvironmentsService, DataService) {
$scope.isViewVisible = false;
$scope.progressBarControl = {};
@@ -72,6 +72,29 @@ var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $w
var getRequestStatusFunc = getOrchestrationRequestStatus; //default
var _this = this;
+ $scope.showReportWindow = function() {
+ let requestInfo = {};
+ requestInfo.requestId = _this.requestId;
+ requestInfo.serviceUuid = $scope.instanceId;
+
+ const modalWindow = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/report-modal/report-modal.html',
+ controller: 'reportModalInstanceController',
+ controllerAs: 'vm',
+ resolve: {
+ errorMsg: function () {
+ return $scope.log;
+ },
+ requestInfo: function () {
+ return requestInfo;
+ }
+ }
+ });
+
+ $scope.isViewVisible = false;
+ $scope.popup.isVisible = false;
+ };
+
$scope.$on("createInstance", function(event, request) {
init(request, COMPONENT.MSO_CREATE_REQ, getOrchestrationRequestStatus );
MsoService.createInstance(request, handleInitialResponse);
@@ -318,5 +341,5 @@ var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $w
}
appDS2.controller("msoCommitController", [ "COMPONENT", "FIELD", "$scope", "$http", "$timeout",
- "$window", "$log", "MsoService", "PropertyService", "UtilityService", "TestEnvironmentsService",
+ "$window", "$log", "$uibModal", "MsoService", "PropertyService", "UtilityService", "TestEnvironmentsService", "DataService",
msoCommitController ]);