From 3a2b5c60384feb490e878020bdb9c01f514d7856 Mon Sep 17 00:00:00 2001 From: "Christopher Lott (cl778h)" Date: Mon, 25 Sep 2017 15:52:24 -0400 Subject: Sonar Scans and Role Centralization; clean nl PORTAL-21: centralized user role management PORTAL-72: Address Sonar Scan code issues for ONAP - mostly on raptor PORTAL-86: ONAP - Remove internal att.com usages from tests and otherfiles PORTAL-90: Add debug statements to demo app's class; no functional change Issue: PORTAL-21 PORTAL-72 PORTAL-86 PORTAL-90 Change-Id: I72a6c812009f51446330bf42bab6d3338d053805 Signed-off-by: Christopher Lott (cl778h) --- .../scripts/DS2-controllers/admin-controller.js | 16 +- .../ds2-profile/self-profile-controller.js | 10 +- .../DS2-controllers/ds2-workflows/workflowApp.js | 5 +- .../fusion/scripts/DS2-services/modalService.js | 57 -------- .../ds2-admin/modals/role-functions-modal.html | 2 +- .../webapp/app/fusion/scripts/network/net_map.js | 6 +- .../app/fusion/scripts/view-models/header.html | 162 --------------------- .../app/fusion/scripts/view-models/left_menu.html | 27 ---- .../reportdashboard-page/src/report-dashboard.html | 19 --- .../fusion/scripts/webrtc/RTCMultiConnection.js | 25 +--- 10 files changed, 25 insertions(+), 304 deletions(-) delete mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js delete mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/header.html delete mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/left_menu.html (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts') diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-controller.js index 0c6105c8..0d95e72a 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-controller.js +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/admin-controller.js @@ -704,7 +704,7 @@ appDS2.controller('adminController', function($scope, $http,AdminService, $modal },function(error){ console.log("roleControllerDS2 failed: " + error); - reloadPageOnce(); + // reloadPageOnce(); }).finally(function() { $scope.showLoader=false; // Always execute this on both error and success }); @@ -727,7 +727,13 @@ appDS2.controller('adminController', function($scope, $http,AdminService, $modal }) $scope.roleFnInit(); - + $scope.updateRoleFunction = function(){ + $scope.role.roleFunctions=[]; + for(var i=0;i<$scope.ociavailableRoleFunctions.length;i++){ + if($scope.ociavailableRoleFunctions[i].selected) + $scope.role.roleFunctions.push($scope.ociavailableRoleFunctions[i]); + } + } $scope.saveRole = function() { var errorMsg; $scope.showLoader=true; @@ -841,6 +847,9 @@ appDS2.controller('adminController', function($scope, $http,AdminService, $modal } } }); + modalInstance.result.finally(function () { + $scope.updateRoleFunction(); + }); } $scope.addNewChildRoleFunctionModalPopup = function(data, role,info) { @@ -860,6 +869,9 @@ appDS2.controller('adminController', function($scope, $http,AdminService, $modal } } }); + modalInstance.result.finally(function () { + alert(); + }); } // remove role function associated to a role on Role Edit page diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-profile/self-profile-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-profile/self-profile-controller.js index efe2b749..2c005365 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-profile/self-profile-controller.js +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-profile/self-profile-controller.js @@ -25,8 +25,7 @@ appDS2.controller('selfProfileController', function($scope, $http, $modal, $rout $scope.pageType=2; } - $scope.sbcid=$scope.profile.sbcid; - $scope.managerAttuid=$scope.profile.managerAttuid; + /***********************************************************functions***********************************************/ $scope.getProfileDetail = function(profileIdParam){ @@ -42,8 +41,7 @@ appDS2.controller('selfProfileController', function($scope, $http, $modal, $rout $scope.ociTimeZones=JSON.parse($scope.data.timeZones); $scope.ociCountries=JSON.parse($scope.data.countries); stateList=JSON.parse($scope.data.stateList); - $scope.sbcid=$scope.profile.sbcid; - $scope.managerAttuid=$scope.profile.managerAttuid; + if($scope.ociavailableRoles) $.each($scope.ociavailableRoles, function(i, a){ @@ -100,9 +98,7 @@ appDS2.controller('selfProfileController', function($scope, $http, $modal, $rout $scope.ociTimeZones=JSON.parse($scope.data.timeZones); $scope.ociCountries=JSON.parse($scope.data.countries); stateList=JSON.parse($scope.data.stateList); - $scope.sbcid=$scope.profile.sbcid; - $scope.managerAttuid=$scope.profile.managerAttuid; - + if($scope.ociavailableRoles) $.each($scope.ociavailableRoles, function(i, a){ var availableRole = a; diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowApp.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowApp.js index a3496785..2ae2b1b3 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowApp.js +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-workflows/workflowApp.js @@ -1,5 +1,6 @@ -angular.module('att.abs.helper', []); +/*angular.module('att.abs.helper', []); angular.module('quantum', []); //angular.module('ui.bootstrap', []); appDS2=angular.module("workflowApp", ["ngRoute", 'ngMessages', 'ngCookies', 'b2b.att.tpls', 'ddh.att.tpls','ddh.att.dropdowns', 'ddh.att.switches', 'b2b.att.footer', 'b2b.att.header','gridster','ui.bootstrap']); - +*/ +var appDS2=angular.module("workflowApp", ["ngRoute", 'ngMessages','ngCookies','modalServices', 'ngCookies', 'b2b.att','gridster','ui.bootstrap','ui.bootstrap.modal']); \ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js deleted file mode 100644 index cb85ffce..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js +++ /dev/null @@ -1,57 +0,0 @@ - -angular.module("template/modalsAndAlerts/window2.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("template/modalsAndAlerts/window.html", - "
\n" + - "
sdfdsfsfd
\n" + - "
"); - }]); - -angular.module('ddh.att.modalsAndAlerts') - -.controller('modalsAndAlertsController', function ($scope, $modal, $log) { - $scope.name='eeee'; - $scope.items = ['item1', 'item2', 'item3']; - $scope.dt = new Date("March 10, 2014 00:00:00"); - $scope.helperText = "The date you selected is $date. Double tap to open calendar. Select a date to close the calendar."; - $scope.open = function (event) { - var modalInstance = $modal.open({ - templateUrl: 'template/modalsAndAlerts/modal-demo.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-long-adjust', - resolve: { - items: function () { - return $scope.items; - } - } - }); - - modalInstance.result.then(function (selectedItem) { - $scope.selected = selectedItem; - event.target.focus(); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - event.target.focus(); - }); - }; - $scope.ok = function () { - //add the ok functionality - console.log("ok"); - }; - $scope.cancel = function () { - //add the cancel functionality - console.log("cancel"); - }; -}) - -var ModalInstanceCtrl = function ($scope, $modalInstance, items) { - $scope.items = items; - $scope.selected = { - item: $scope.items[0] - }; - $scope.ok = function () { - $modalInstance.close($scope.selected.item); - }; - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; -}; diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-functions-modal.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-functions-modal.html index 48044da2..1ecf192b 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-functions-modal.html +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2-admin/modals/role-functions-modal.html @@ -18,7 +18,7 @@ {{roleFunction.name}} diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/network/net_map.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/network/net_map.js index 49599503..421e511f 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/network/net_map.js +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/network/net_map.js @@ -243,7 +243,7 @@ plotHeader = function(attributes,cssType){ plotElement = function(element) { if(element.left){ - if(!element.id.startsWith("com.att.trinity.ue")){ + if(!element.id.startsWith("ue")){ left = element.left ; var thisColor = element.bgColor; var thisElement = new joint.shapes.basic.newRect({ @@ -325,7 +325,7 @@ plotElementIcon = function(element) { left = element.left ; uetop = element.top; - if(element.id.startsWith("com.att.trinity.ue")) { + if(element.id.startsWith("ue")) { uetop = element.top - 30; } else { uetop = element.top ; @@ -368,7 +368,7 @@ plotElementIcon = function(element) { }); } - if(element.id.startsWith("com.att.trinity.ue")){ + if(element.id.startsWith("ue")){ thisElement.attr({ rect: {fill: 'white', style:{'pointer-events':'none'}}, image: { style:{'pointer-events':'none'}} diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/header.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/header.html deleted file mode 100644 index e7616d94..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/header.html +++ /dev/null @@ -1,162 +0,0 @@ -
-
-
-
-
- - -
-
-
-
-
  • - - ECOMP Portal -
  • -
    -
    - - -
    - - -
    - -
    -
    -
    -
  • - Unable to load menus -
  • -
    -
  • -
    - - -
    -
  • -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/left_menu.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/left_menu.html deleted file mode 100644 index ad4e5d91..00000000 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/left_menu.html +++ /dev/null @@ -1,27 +0,0 @@ - -
    - - - -     {{app_name}} - -
    -
    -
    -
    - - - - - -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/reportdashboard-page/src/report-dashboard.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/reportdashboard-page/src/report-dashboard.html index 8fecfb7b..ecdccb62 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/reportdashboard-page/src/report-dashboard.html +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/view-models/reportdashboard-page/src/report-dashboard.html @@ -109,25 +109,6 @@ - - - diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/webrtc/RTCMultiConnection.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/webrtc/RTCMultiConnection.js index 3ce348b6..daf64413 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/webrtc/RTCMultiConnection.js +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/webrtc/RTCMultiConnection.js @@ -5574,8 +5574,7 @@ hark: 'https://cdn.webrtc-experiment.com/hark.js', firebase: 'https://cdn.webrtc-experiment.com/firebase.js', firebaseio: 'https://webrtc-signaling.firebaseio.com/', - - muted: 'static/fusion/images/ATT_Labs_Logo.png', + getConnectionStats: 'https://cdn.webrtc-experiment.com/getConnectionStats.js', FileBufferReader: 'https://cdn.webrtc-experiment.com/FileBufferReader.js' @@ -5995,29 +5994,7 @@ username: 'ambient' }); - /* CHANGED: Fusion: These are non-att servers for testing purposes - - iceServers.push({ - url: 'stun:stun.l.google.com:19302' - }); - - iceServers.push({ - url: 'stun:stun.anyfirewall.com:3478' - }); - - iceServers.push({ - url: 'turn:turn.bistri.com:80', - credential: 'homeo', - username: 'homeo' - }); - - iceServers.push({ - url: 'turn:turn.anyfirewall.com:443?transport=tcp', - credential: 'webrtc', - username: 'webrtc' - }); - */ // CUSTOM CODE // connection.iceServers = iceServers; -- cgit 1.2.3-korg