From 978dbcf0a196acbafad72fe1e2478ec0e384f02f Mon Sep 17 00:00:00 2001 From: "Christopher Lott (cl778h)" Date: Wed, 23 Aug 2017 18:27:19 -0400 Subject: Deliver centralized role management feature Repair multiple defects also. Revise deployment to use docker-compose. Remove all zip archives. Issue: PORTAL-21, PORTAL-25, PORTAL-28, PORTAL-52, PORTAL-69, PORTAL-74, PORTAL-76, PORTAL-80, PORTAL-82 Change-Id: Ie72fec7d35ba78beb162bba6ed27b2caee340c61 Signed-off-by: Christopher Lott (cl778h) --- .../menu-details.controller.js | 178 ++++++++------------- .../functionalMenu-dialog/menu-details.modal.html | 83 ++++++---- .../functionalMenu-dialog/modal-details.modal.less | 28 ++-- .../app/views/functionalMenu/functionalMenu.less | 48 +++++- 4 files changed, 186 insertions(+), 151 deletions(-) (limited to 'ecomp-portal-FE-common/client/app/views/functionalMenu') diff --git a/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.controller.js b/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.controller.js index 69fe6e4d..a425297a 100644 --- a/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.controller.js +++ b/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.controller.js @@ -4,8 +4,8 @@ 'use strict'; (function () { class MenuDetailsModalCtrl { - constructor($scope, $log, functionalMenuService, errorMessageByCode, ECOMP_URL_REGEX,$rootScope,confirmBoxService) { - + constructor($scope, $log, functionalMenuService, errorMessageByCode, ECOMP_URL_REGEX,$rootScope,confirmBoxService,items) { + $scope.ngDialogData=items; $scope.isAllApplications = false; let newMenuModel = { name: null, @@ -21,6 +21,8 @@ functionalMenuService.getManagedRolesMenu(appid).then(rolesObj => { $log.debug("MenuDetailsModalCtrl::getAvailableRoles: Roles returned = " + JSON.stringify(rolesObj)) this.availableRoles = rolesObj; + + this.preSelectedRoles = {roles:[]}; if(($scope.ngDialogData.source==='edit') && this.isMidLevelMenuItem()){ @@ -42,8 +44,20 @@ } } } + $rootScope.$broadcast('availableRolesReady'); this.isSaving = false; + for(var i=0; i { $log.error("MenuDetailsModalCtrl::getAvailableRoles: error: " + err); }); @@ -89,6 +103,7 @@ this.formEditable = $scope.ngDialogData.source==='view' ? false : true; this.selectedRole = []; this.availableRoles = []; + this.selectedApp={}; this.menuItem = _.clone($scope.ngDialogData.menuItem); $log.info('MenuDetailsModalCtrl::getAvailableApps: Within init, about to check menuDetails for defined'); if(!angular.isUndefined(this.menuItem.menuDetails) && @@ -98,7 +113,7 @@ $log.debug("MenuDetailsModalCtrl::init: menuItem: "); $log.debug('MenuDetailsModalCtrl::init: ',this.menuItem); this.menuItem.menu.url = this.menuItem.menuDetails.url; - this.selectedApp={}; + this.selectedAppIndex=this.menuItem.menuDetails.appid; this.selectedApp.index = this.menuItem.menuDetails.appid; getAvailableRoles(this.selectedApp.index); @@ -186,17 +201,40 @@ this.isParentMenuItem = () => { return this.menuItem.menu.parentMenuId!=null ? false : true; }; + + this.isRoleSelected=()=>{ + var selectedRoleIds=[]; + for(var i=0;i { + /*var appItemobj= JSON.parse(appItem); + this.selectedApp=JSON.parse(this.selectedApp);*/ if (!appItem) { return; } + var appobj={}; + for(var i=0;i { @@ -210,7 +248,6 @@ /*if($scope.functionalMenuForm.$invalid){ return; }*/ - if(!!this.menuItem.menu.url && (angular.isUndefined(this.selectedApp) || !this.selectedApp.index>0)) { confirmBoxService.showInformation('Please select the appropriate app, or remove the url').then(isConfirmed => {}); return; @@ -227,15 +264,25 @@ if ($scope.ngDialogData.source === 'edit') { // Edit Menu Item $log.debug('MenuDetailsModalCtrl::saveChanges: Will be saving an edit menu item'); + var selectedRoleIds=[]; + for(var i=0;i { $log.debug('MenuDetailsModalCtrl::saveChanges: Menu Item saved'); - $scope.closeThisDialog(true); + // $scope.closeThisDialog(true); + $scope.$dismiss('cancel'); + }).catch(err => { if(err.status === 409){//Conflict handleConflictErrors(err); @@ -259,6 +308,12 @@ $log.debug("MenuDetailsModalCtrl::saveChanges: Edit Menu output will be: " + JSON.stringify(activeMenuItem)); } else { // New Menu Item $log.debug('MenuDetailsModalCtrl::saveChanges: Will be saving a New menu item'); + var selectedRoleIds=[]; + for(var i=0;i { $log.debug('MenuDetailsModalCtrl::saveChanges: Menu Item saved'); - $scope.closeThisDialog(true); + // $scope.closeThisDialog(true); + $scope.$dismiss('cancel'); }).catch(err => { if(err.status === 409){//Conflict handleConflictErrors(err); @@ -298,103 +354,7 @@ }); } } - MenuDetailsModalCtrl.$inject = ['$scope', '$log', 'functionalMenuService', 'errorMessageByCode', 'ECOMP_URL_REGEX','$rootScope','confirmBoxService']; + MenuDetailsModalCtrl.$inject = ['$scope', '$log', 'functionalMenuService', 'errorMessageByCode', 'ECOMP_URL_REGEX','$rootScope','confirmBoxService','items']; angular.module('ecompApp').controller('MenuDetailsModalCtrl', MenuDetailsModalCtrl); - angular.module('ecompApp').directive('dropdownMultiselect', ['functionalMenuService',function(){ - return { - restrict: 'E', - scope: { - model: '=', - options: '=', - populated_roles: '=preSelected', - dropdownTitle: '@', - source: '=' - }, - template: "
" + - "" + - "" + - "" + - "
", - controller: function ($scope) { - $scope.selectedItems = {}; - $scope.checkAll = false; - $scope.$on('availableRolesReady', function() { - init(); - }); - - function init() { - console.log('dropdownMultiselect init'); - $scope.dropdownTitle = $scope.source ==='view' ? 'View Roles' : 'Select Roles'; - console.log('$scope.populated_roles = ' + $scope.populated_roles); - } - - $scope.$watch('populated_roles', function(){ - if ($scope.populated_roles && $scope.populated_roles.length>0) { - for (var i = 0; i < $scope.populated_roles.length; i++) { - $scope.model.push($scope.populated_roles[i].roleId); - $scope.selectedItems[$scope.populated_roles[i].roleId] = true; - } - if ($scope.populated_roles.length === $scope.options.length) { - $scope.checkAll = true; - } - }else{ - deselectAll(); - } - }); - - $scope.openDropDown = function () { - - }; - - $scope.checkAllClicked = function () { - if ($scope.checkAll) { - selectAll(); - } else { - deselectAll(); - } - }; - - function selectAll() { - $scope.model = []; - $scope.selectedItems = {}; - angular.forEach($scope.options, function (option) { - $scope.model.push(option.roleId); - }); - angular.forEach($scope.model, function (id) { - $scope.selectedItems[id] = true; - }); - console.log($scope.model); - }; - - function deselectAll() { - $scope.model = []; - $scope.selectedItems = {}; - console.log($scope.model); - }; - - $scope.setSelectedItem = function (id) { - var filteredArray = []; - if ($scope.selectedItems[id] === true) { - $scope.model.push(id); - } else { - filteredArray = $scope.model.filter(function (value) { - return value != id; - }); - $scope.model = filteredArray; - $scope.checkAll = false; - } - console.log(filteredArray); - return false; - }; - - $scope.setDisable = function(source){ - return source ==='view' ? true : false; - } - } - } - }]); - -})(); \ No newline at end of file + })(); \ No newline at end of file diff --git a/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.modal.html b/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.modal.html index 7ba444eb..bae0e776 100644 --- a/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.modal.html +++ b/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.modal.html @@ -1,9 +1,18 @@
-
{{ngDialogData.title}}
+
+

{{ngDialogData.title}}

-
-
+
+ +
+
+ +
+
+ +
Parent
@@ -26,43 +35,50 @@
URL
- Not valid URL! + Not valid URL!
App
-
+
- + +
+ +
+ +
- - -
-
Roles
- - -
+ +
+
Roles
+
+ +
+
Application is disabled
-
+ -
-
+
+ +
+
+ \ No newline at end of file +
+ + + + + diff --git a/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/modal-details.modal.less b/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/modal-details.modal.less index ce434b47..c63a63e9 100644 --- a/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/modal-details.modal.less +++ b/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/modal-details.modal.less @@ -1,11 +1,11 @@ .functionalMenu-details-modal { - height: 520px; + //height: 520px; .title { //.n18r; .dGray18r; //ECOMP Dark Gray - border-bottom: @blue-active 3px solid; + // border-bottom: @blue-active 3px solid; } .span6{ @@ -23,17 +23,20 @@ padding-top: 10px; .functionalMenu-height{ height:35px; width:140%; +font-family:Omnes-ECOMP-W02, Arial; + } select { max-width: 150%; - width: 380px; + width: 70%; } -.btn{ -font-family: clearview_att_regular; - font-size: 14px !important; -} + + .multiple-select{ + width:70%; + } + .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,.125); box-shadow: inset 0 0px 0px rgba(0,0,0,.125); @@ -88,8 +91,8 @@ font-family: clearview_att_regular; .functionalMenu-properties-main { padding: 16px; - height: 306px; - overflow-y: visible; + height: 359px; + overflow: auto; input[type=checkbox][disabled]{ height:13px; } @@ -151,10 +154,15 @@ font-family: clearview_att_regular; color: @funcGreen; font-size: 9px; } + } } } - + .dialog-control{ + position: relative; + bottom: 16px; + float: right; + } } diff --git a/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu.less b/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu.less index 8452590f..8554fadc 100644 --- a/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu.less +++ b/ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu.less @@ -22,6 +22,46 @@ margin-left:0px; } + .dropdown-menu{ + + position:absolute; + top:100%; + left:0; + z-index:1000; + display:none; + float:left; + min-width:160px; + padding:5px 0; + margin:2px 0 0; + list-style:none; + font-size:14px; + background-color:#fff; + border:1px solid #ccc; + border:1px solid rgba(0,0,0,.15); + border-radius:6px; + -webkit-box-shadow:0 6px 12px rgba(0,0,0,.175); + box-shadow:0 6px 12px rgba(0,0,0,.175); + background-clip:padding-box; + + } + + .dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} + +.dropdown-menu>li>a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: 400; + line-height: 1.428571429; + color: #333; + white-space: nowrap; +} + .tree { margin:auto; width: @table-width; @@ -54,7 +94,13 @@ } } + .error-msg-txt { + color: red; + font-size: 11px; + } } - + .regenerate-functionalmenu-btn-txt { + color:black; + } } \ No newline at end of file -- cgit 1.2.3-korg