Commit 0db1189f authored by vsunke-nisum-com's avatar vsunke-nisum-com Committed by rbonthala-nisum-com

MT-116 added domaincontroller.js,assignaccountcontroller.js,newaccount.html (#90)

parent 9a7a6a5c
...@@ -365,6 +365,8 @@ myApp.controller("domainController", ...@@ -365,6 +365,8 @@ myApp.controller("domainController",
} }
} }
$scope.ifEmployeeNameExists = function(empName) { $scope.ifEmployeeNameExists = function(empName) {
$scope.selectedEmployeeNames.push(manager.employeeName);
removeDuplicates($scope.selectedEmployeeNames);
return $scope.selectedEmployeeNames.includes(empName); return $scope.selectedEmployeeNames.includes(empName);
} }
$scope.validateFields = function(action){ $scope.validateFields = function(action){
...@@ -422,6 +424,11 @@ myApp.controller("domainController", ...@@ -422,6 +424,11 @@ myApp.controller("domainController",
}; };
function removeDuplicates(arr){
return arr.filter(function(item, pos) {
return arr.indexOf(item) == pos;
})
}
} }
}); });
\ No newline at end of file
...@@ -165,6 +165,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -165,6 +165,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
url : appConfig.appUri + "/projectTeam/getEmployeesToTeam" url : appConfig.appUri + "/projectTeam/getEmployeesToTeam"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.managerDetails=response.data; $scope.managerDetails=response.data;
console.log("response",response)
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
...@@ -200,6 +201,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -200,6 +201,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
} }
$scope.updateSearch = function (e) { $scope.updateSearch = function (e) {
e.stopPropagation(); e.stopPropagation();
$scope.getSelectedLead();
} }
$scope.searchFilter = function (obj) { $scope.searchFilter = function (obj) {
var stringToGoIntoTheRegex = $scope.searchTerm; var stringToGoIntoTheRegex = $scope.searchTerm;
...@@ -214,10 +216,13 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -214,10 +216,13 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
} }
$scope.getSelectedLead = function(){ $scope.getSelectedLead = function(){
$scope.managersSelectedList.forEach(function(manager){ $scope.managersSelectedList.forEach(function(manager){
if(!$scope.employeeInTeam.includes(manager.employeeId)) $scope.selectedEmployeeNames.push(manager.employeeName);
$scope.employeeInTeam.push(manager.employeeId) removeDuplicates($scope.selectedEmployeeNames);
if(!$scope.employeeInTeam.includes(manager.employeeId)){
$scope.employeeInTeam.push(manager.employeeId) ;
}
}) })
console.log($scope.employeeInTeam);
} }
$scope.getIndustryTypeSelected = function(){ $scope.getIndustryTypeSelected = function(){
if ($scope.industryType !== undefined) { if ($scope.industryType !== undefined) {
...@@ -331,6 +336,11 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -331,6 +336,11 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
} }
} }
function removeDuplicates(arr){
return arr.filter(function(item, pos) {
return arr.indexOf(item) == pos;
})
}
} }
}); });
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<td id="lead" colspan="8"> <td id="lead" colspan="8">
<div class="leads-data" ng-show="managersSelectedList.length > 0"> <div class="leads-data" ng-show="managersSelectedList.length > 0">
<div ng-repeat="item in managersSelectedList"> <div ng-repeat="item in managersSelectedList">
<p> {{item.employeeName}} <span ng-click="removeSelectedLead(item)" class="glyphicon glyphicon-remove"></span> </p> <p> {{item.employeeName}} <span ng-click="removeSelectedLead(item,$event)" class="glyphicon glyphicon-remove"></span> </p>
</div> </div>
</div> </div>
<div style="display: block; float: left; width: 100%;"> <div style="display: block; float: left; width: 100%;">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment