2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
23 var editFWActionListController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){
24 if(message.actionListDictionaryData==null)
25 $scope.label='Add Action Name'
27 $scope.label='Edit Action Name'
28 $scope.disableCd=true;
32 PapUrlService.getPapUrl().then(function(data) {
34 papUrl = config.PAP_URL;
38 /*getting user info from session*/
40 UserInfoService.getFunctionalMenuStaticDetailSession()
41 .then(function (response) {
42 loginId = response.userid;
45 $scope.editActionList = message.actionListDictionaryData;
47 $scope.saveFWActionList = function(actionListDictionaryData) {
48 var uuu = papUrl + "/ecomp/fw_dictionary/save_ActionList.htm";
49 var postData={actionListDictionaryData: actionListDictionaryData, loginId: loginId};
54 contentType: 'application/json',
55 data: JSON.stringify(postData),
56 success : function(data){
57 $scope.$apply(function(){
58 $scope.actionListDictionaryDatas=data.actionListDictionaryDatas;});
59 if($scope.actionListDictionaryDatas == "Duplicate"){
60 Notification.error("FW ActionList Dictionary exists with Same ActionList Name.")
62 console.log($scope.actionListDictionaryDatas);
63 $modalInstance.close({actionListDictionaryDatas:$scope.actionListDictionaryDatas});
66 error : function(data){
67 alert("Error while saving.");
72 $scope.close = function() {
73 $modalInstance.close();