Unverified Commit d19e7bde authored by mshaik-nisum-com's avatar mshaik-nisum-com Committed by GitHub

Merge pull request #96 from nisum-inc/BugFixes/Validations

bugs fix in update project and validations
parents 1292cc36 6a32a38d
...@@ -324,7 +324,7 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -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 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"}); menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-book-o fa-2x","path" : "templates/profile.html"});
}else{ }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 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 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"}); 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 ...@@ -200,7 +200,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
.then(function (result) { .then(function (result) {
if (result == "Assign") {showAlert('Manager assigned successfully');} if (result == "Assign") {showAlert('Manager assigned successfully');}
else if (result == "Update") showAlert('Manager updated 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!!!'); else showAlert('Manager assigning/updation failed!!!');
}); });
}; };
...@@ -433,7 +433,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -433,7 +433,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}); });
}; };
function setDomain(action) { 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){ if($scope.domain.domainId != undefined){
getManagersAssociatedToDomain($scope.domain.domainId,action); getManagersAssociatedToDomain($scope.domain.domainId,action);
} }
...@@ -798,6 +802,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -798,6 +802,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
// ] // ]
noDomainError(); noDomainError();
$scope.domains = []; $scope.domains = [];
$scope.managerDetails = [];
} }
if(action == "Update"){ if(action == "Update"){
setDomain(action); setDomain(action);
...@@ -813,7 +818,9 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -813,7 +818,9 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
getDomainsAssoicatedToAccount($scope.account.accountId); getDomainsAssoicatedToAccount($scope.account.accountId);
} }
$scope.domain = undefined; $scope.domain = undefined;
$scope.domains = [];
$scope.deliveryLeadsSelectedList = {}; $scope.deliveryLeadsSelectedList = {};
$scope.managerDetails = [];
$scope.projectStatus = undefined; $scope.projectStatus = undefined;
} }
...@@ -824,10 +831,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -824,10 +831,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
if($scope.domain.domainId != undefined){ if($scope.domain.domainId != undefined){
getManagersAssociatedToDomain($scope.domain.domainId); getManagersAssociatedToDomain($scope.domain.domainId);
} }
else{
$scope.managerDetails = managers;
}
$scope.deliveryLeadsSelectedList = {}; $scope.deliveryLeadsSelectedList = {};
$scope.managerDetails = [];
$scope.projectStatus = undefined; $scope.projectStatus = undefined;
} }
} }
...@@ -835,17 +840,19 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -835,17 +840,19 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
if($scope.domain.domainId != undefined){ if($scope.domain.domainId != undefined){
getManagersAssociatedToDomain($scope.domain.domainId); getManagersAssociatedToDomain($scope.domain.domainId);
} }
else{
$scope.managerDetails = managers;
}
$scope.deliveryLeadsSelectedList = {}; $scope.deliveryLeadsSelectedList = {};
$scope.managerDetails = [];
$scope.projectStatus = undefined; $scope.projectStatus = undefined;
} }
} }
function setDeliveryLead(){ 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 () { $scope.getAccountText = function () {
...@@ -884,9 +891,6 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -884,9 +891,6 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
if(result != "" || result.length != 0){ if(result != "" || result.length != 0){
$scope.managerDetails = result; $scope.managerDetails = result;
} }
else{
$scope.managerDetails = managers;
}
if(action == "Update"){ if(action == "Update"){
setDeliveryLead(); setDeliveryLead();
} }
...@@ -1063,8 +1067,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1063,8 +1067,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.cancel = function () { $scope.cancel = function () {
var showConfirmDialog = false; var showConfirmDialog = false;
console.log(dataToPass);
if(dataToPass.action=="Update"){ if(dataToPass.action=="Update"){
if($scope.domain != undefined){
$scope.previousData={ $scope.previousData={
ProjectID:dataToPass.projectId, ProjectID:dataToPass.projectId,
ProjectName:dataToPass.projectName, ProjectName:dataToPass.projectName,
...@@ -1120,6 +1124,18 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -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"){ if(dataToPass.action=="Assign"){
var totalFields = $scope.myForm.$$controls; var totalFields = $scope.myForm.$$controls;
for (key in totalFields) { 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