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",
}
}
$scope.ifEmployeeNameExists = function(empName) {
$scope.selectedEmployeeNames.push(manager.employeeName);
removeDuplicates($scope.selectedEmployeeNames);
return $scope.selectedEmployeeNames.includes(empName);
}
$scope.validateFields = function(action){
......@@ -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
......@@ -164,7 +164,8 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
method : "GET",
url : appConfig.appUri + "/projectTeam/getEmployeesToTeam"
}).then(function mySuccess(response) {
$scope.managerDetails=response.data;
$scope.managerDetails=response.data;
console.log("response",response)
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = [];
......@@ -199,7 +200,8 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
}
}
$scope.updateSearch = function (e) {
e.stopPropagation();
e.stopPropagation();
$scope.getSelectedLead();
}
$scope.searchFilter = function (obj) {
var stringToGoIntoTheRegex = $scope.searchTerm;
......@@ -214,10 +216,13 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
}
$scope.getSelectedLead = function(){
$scope.managersSelectedList.forEach(function(manager){
if(!$scope.employeeInTeam.includes(manager.employeeId))
$scope.employeeInTeam.push(manager.employeeId)
})
console.log($scope.employeeInTeam);
$scope.selectedEmployeeNames.push(manager.employeeName);
removeDuplicates($scope.selectedEmployeeNames);
if(!$scope.employeeInTeam.includes(manager.employeeId)){
$scope.employeeInTeam.push(manager.employeeId) ;
}
})
}
$scope.getIndustryTypeSelected = function(){
if ($scope.industryType !== undefined) {
......@@ -228,7 +233,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
}
};
$scope.clearSearchTerm = function() {
$scope.searchTerm = '';
$scope.searchTerm = '';
};
$element.find('input').on('keydown', function(ev) {
ev.stopPropagation();
......@@ -330,7 +335,12 @@ 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 @@
<td id="lead" colspan="8">
<div class="leads-data" ng-show="managersSelectedList.length > 0">
<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 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