2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
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 * ================================================================================
23 constructor($log, $stateParams, getAccessService,applicationsService, ngDialog) {
24 // $log.debug('GetAccessCtrl: appService param is: ' + applicationsService.goGetAccessAppName);
26 this.updateAppsList = () => {
27 getAccessService.getListOfApp().then(res=> {
29 // $log.info('GetAccessCtrl::updateAppsList: getting res');
30 var result = (typeof(res.data) != "undefined" && res.data!=null)?res.data:null;
31 // $log.info('GetAccessCtrl::updateAppsList: result',result);
32 // $log.info('GetAccessCtrl::updateAppsList: done');
34 // $log.info('GetAccessCtrl::updateAppsList source: ', source);
35 for(var i=0;i<source.length; i++){
36 var dataArr = source[i];
38 ecomp_function: dataArr.ecompFunction,
39 app_name:dataArr.appName,
40 role_name:dataArr.roleName
42 tableData.push(dataTemp);
44 this.appTable=tableData;
46 if( $stateParams.appName != null)
47 this.searchString = $stateParams.appName;
49 this.searchString = applicationsService.goGetAccessAppName;
50 // the parameter has been used; clear the value.
51 applicationsService.goGetAccessAppName = '';
53 $log.error('GetAccessCtrl:error:: ', err);
55 this.isLoadingTable = false;
59 // $log.info('GetAccessCtrl:: initializing...');
60 this.searchString = '';
61 this.getAccessTableHeaders = ['ECOMP Function', 'Application Name', 'Role Name'];
63 this.updateAppsList();
68 GetAccessCtrl.$inject = ['$log', '$stateParams', 'getAccessService', 'applicationsService', 'ngDialog'];
69 angular.module('ecompApp').controller('GetAccessCtrl', GetAccessCtrl);