bugs fix in update project and validations

parent 8d974640
......@@ -324,7 +324,7 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
menuItems.push({"menu" : "My Org","icon" : "fa fa-address-card-o fa-2x","path" : "templates/myOrg.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-book-o fa-2x","path" : "templates/profile.html"});
}else{
// menuItems.push({"menu" : "My Team","icon" : "fa fa-futbol-o fa-2x","path" : "templates/myTeam.html"});
menuItems.push({"menu" : "My Team","icon" : "fa fa-futbol-o fa-2x","path" : "templates/myTeam.html"});
menuItems.push({"menu" : "My Project Allocations","icon" : "fa fa-life-ring fa-2x","path" : "templates/myProjectAllocations.html"});
menuItems.push({"menu" : "My Login Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "My Org","icon" : "fa fa-address-card-o fa-2x","path" : "templates/myOrg.html"});
......
......@@ -200,7 +200,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
.then(function (result) {
if (result == "Assign") {showAlert('Manager assigned successfully');}
else if (result == "Update") showAlert('Manager updated successfully');
else if (result == "Cancelled") {console.log(result); $scope.getProjects();}
else if (result == "Cancelled") console.log(result);
else showAlert('Manager assigning/updation failed!!!');
});
};
......@@ -433,7 +433,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
});
};
function setDomain(action) {
$scope.domain = {"domainName":dataToPass.domain,"domainId":dataToPass.domainId};
$scope.domains.forEach(function(domain){
if(domain.domainId == dataToPass.domainId){
$scope.domain = domain
}
})
if($scope.domain.domainId != undefined){
getManagersAssociatedToDomain($scope.domain.domainId,action);
}
......@@ -798,6 +802,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
// ]
noDomainError();
$scope.domains = [];
$scope.managerDetails = [];
}
if(action == "Update"){
setDomain(action);
......@@ -813,7 +818,9 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
getDomainsAssoicatedToAccount($scope.account.accountId);
}
$scope.domain = undefined;
$scope.domains = [];
$scope.deliveryLeadsSelectedList = {};
$scope.managerDetails = [];
$scope.projectStatus = undefined;
}
......@@ -824,10 +831,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
if($scope.domain.domainId != undefined){
getManagersAssociatedToDomain($scope.domain.domainId);
}
else{
$scope.managerDetails = managers;
}
$scope.deliveryLeadsSelectedList = {};
$scope.managerDetails = [];
$scope.projectStatus = undefined;
}
}
......@@ -835,17 +840,19 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
if($scope.domain.domainId != undefined){
getManagersAssociatedToDomain($scope.domain.domainId);
}
else{
$scope.managerDetails = managers;
}
$scope.deliveryLeadsSelectedList = {};
$scope.managerDetails = [];
$scope.projectStatus = undefined;
}
}
function setDeliveryLead(){
$scope.deliveryLeadsSelectedList = dataToPass.deliveryLeadIds[0];
$scope.managerDetails.forEach(function(deliveryLead){
if(deliveryLead.employeeId == dataToPass.deliveryLeadIds[0].employeeId){
$scope.deliveryLeadsSelectedList = deliveryLead;
}
});
}
$scope.getAccountText = function () {
......@@ -884,9 +891,6 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
if(result != "" || result.length != 0){
$scope.managerDetails = result;
}
else{
$scope.managerDetails = managers;
}
if(action == "Update"){
setDeliveryLead();
}
......@@ -1063,8 +1067,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.cancel = function () {
var showConfirmDialog = false;
console.log(dataToPass);
if(dataToPass.action=="Update"){
if($scope.domain != undefined){
$scope.previousData={
ProjectID:dataToPass.projectId,
ProjectName:dataToPass.projectName,
......@@ -1120,6 +1124,18 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
})
}
}
else{
$mdDialog.show($mdDialog.confirm({
skipHide: true,
textContent: 'Are you sure you want to cancel this?',
ok: 'ok',
cancel:'cancel'
})).then(function(){
$mdDialog.hide('Cancelled');
})
}
}
if(dataToPass.action=="Assign"){
var totalFields = $scope.myForm.$$controls;
for (key in totalFields) {
......
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