Commit 38550d04 authored by Prayas Jain's avatar Prayas Jain

Added validations in manage project screen and added filters in different screens

parent 69fa85cc
...@@ -46,10 +46,9 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -46,10 +46,9 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
$scope.getAccountDetails(); $scope.getAccountDetails();
} }
$scope.getAccountDetails = function(){ $scope.getAccountDetails = function(){
var empId = myFactory.getEmpId();
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "accountsByLoginId?loginId="+empId url : appConfig.appUri + "accounts"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.records.length > 10){ if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true; $scope.gridOptions.enablePaginationControls = true;
......
...@@ -25,7 +25,7 @@ myApp.controller("allocationChangeReportController",function($scope,exportUiGrid ...@@ -25,7 +25,7 @@ myApp.controller("allocationChangeReportController",function($scope,exportUiGrid
{name : 'prevBillingStatus', displayName: 'Prev Billability', enableColumnMenu: false, enableSorting: false, enableFiltering:false, width:150}, {name : 'prevBillingStatus', displayName: 'Prev Billability', enableColumnMenu: false, enableSorting: false, enableFiltering:false, width:150},
{name : 'prevBillingStartDate', displayName: 'Prev Billing Start Date',cellFilter: 'date:"dd-MMM-yyyy"', enableColumnMenu: false, enableSorting: false, enableFiltering:false, width:180}, {name : 'prevBillingStartDate', displayName: 'Prev Billing Start Date',cellFilter: 'date:"dd-MMM-yyyy"', enableColumnMenu: false, enableSorting: false, enableFiltering:false, width:180},
{name : 'prevBillingEndDate', displayName: 'Prev Billing End Date',cellFilter: 'date:"dd-MMM-yyyy"', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:180}, {name : 'prevBillingEndDate', displayName: 'Prev Billing End Date',cellFilter: 'date:"dd-MMM-yyyy"', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:180},
{name : 'currentAccountName', displayName: 'Current Client', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:120}, {name : 'currentAccountName', displayName: 'Current Client', enableColumnMenu: false, enableSorting: false, enableFiltering:true,width:120},
{field : 'currentProjectName',displayName: 'Current Project', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:150}, {field : 'currentProjectName',displayName: 'Current Project', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:150},
{name : 'currentBillingStatus', displayName: 'Current Billability', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:150}, {name : 'currentBillingStatus', displayName: 'Current Billability', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:150},
{name : 'currentBillingStartDate', displayName: 'Current Billing Start Date',cellFilter: 'date:"dd-MMM-yyyy"', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:200}, {name : 'currentBillingStartDate', displayName: 'Current Billing Start Date',cellFilter: 'date:"dd-MMM-yyyy"', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:200},
......
...@@ -31,9 +31,9 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -31,9 +31,9 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
columnDefs : [ columnDefs : [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: false, enableSorting: false,enableFiltering:true, width:100,cellTemplate: getEmpDetTemplate}, {field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: false, enableSorting: false,enableFiltering:true, width:100,cellTemplate: getEmpDetTemplate},
{field : 'employeeName',displayName: 'Employee Name ', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:200}, {field : 'employeeName',displayName: 'Employee Name ', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:200},
{field : 'accountName',displayName: 'Client', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100}, {field : 'accountName',displayName: 'Client', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:100},
{field : 'domain',displayName: 'Domain', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100}, {field : 'domain',displayName: 'Domain', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false,enableFiltering:false,width:150}, {field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false,enableFiltering:true,width:150},
{field : 'billingStartDate',displayName: 'Billing Start Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150}, {field : 'billingStartDate',displayName: 'Billing Start Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'billingEndDate',displayName: 'Billing End Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150}, {field : 'billingEndDate',displayName: 'Billing End Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'empStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:80}, {field : 'empStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:80},
......
...@@ -107,11 +107,9 @@ myApp.controller("domainController", ...@@ -107,11 +107,9 @@ myApp.controller("domainController",
} }
$scope.getDomains = function() { $scope.getDomains = function() {
var empId = myFactory.getEmpId();
$http({ $http({
method : "GET", method : "GET",
//url : appConfig.appUri + "domains" url : appConfig.appUri + "domains"
url : appConfig.appUri + "domainsByLoginId?loginId="+empId
}) })
.then( .then(
function mySuccess(response) { function mySuccess(response) {
......
...@@ -31,7 +31,7 @@ myApp.controller("assignEmployeeEffortrsController",function($scope,exportUiGrid ...@@ -31,7 +31,7 @@ myApp.controller("assignEmployeeEffortrsController",function($scope,exportUiGrid
{name : 'totalHoursSpentInWeek', displayName: 'Total Hours(HH:MM)', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width :230}, {name : 'totalHoursSpentInWeek', displayName: 'Total Hours(HH:MM)', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width :230},
{field : 'projectName',displayName: 'Project Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true}, {field : 'projectName',displayName: 'Project Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{name : 'accountName', displayName: 'Account', enableColumnMenu: false, enableSorting: false, enableFiltering:false}, {name : 'accountName', displayName: 'Account', enableColumnMenu: false, enableSorting: false, enableFiltering:false},
{name : 'functionalOrg', displayName: 'Functional Org', enableColumnMenu: false, enableSorting: false, enableFiltering:false} {name : 'functionalOrg', displayName: 'Functional Org', enableColumnMenu: false, enableSorting: false, enableFiltering:true}
], ],
enableGridMenu: true, enableGridMenu: true,
enableSelectAll: true, enableSelectAll: true,
......
...@@ -87,11 +87,9 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -87,11 +87,9 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
}); });
}; };
function getAllAccounts(){ function getAllAccounts(){
var empId = myFactory.getEmpId();
$http({ $http({
method : "GET", method : "GET",
//url : appConfig.appUri + "accounts" url : appConfig.appUri + "accounts"
url : appConfig.appUri + "accountsByLoginId?loginId="+empId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
var accounts = response.data.records; var accounts = response.data.records;
myFactory.setAccounts(accounts); myFactory.setAccounts(accounts);
......
...@@ -491,6 +491,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -491,6 +491,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
} }
$scope.selectedTab = 0; $scope.selectedTab = 0;
$scope.templateTitle = 'View'; $scope.templateTitle = 'View';
$scope.alertMsg = '';
document.getElementsByClassName("md-tab")[1].style.visibility = "hidden" ; document.getElementsByClassName("md-tab")[1].style.visibility = "hidden" ;
document.getElementsByClassName("md-tab")[2].style.visibility = "hidden" ; document.getElementsByClassName("md-tab")[2].style.visibility = "hidden" ;
$scope.isSecondTab = !$scope.isSecondTab; $scope.isSecondTab = !$scope.isSecondTab;
...@@ -803,11 +804,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -803,11 +804,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
} }
$scope.moveToBench = function (row) { $scope.moveToBench = function (row) {
let role; row.resourceRole == 'Individual Contributor' ? row.resourceRole = 'Employee' : row.resourceRole;
if(row.resourceRole == 'Individual Contributor'){ var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":row.resourceRole,"billingStartDate":row.billingStartDate};
role = 'Employee';
}
var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":role,"billingStartDate":row.billingStartDate};
var urlRequest = ""; var urlRequest = "";
var loginEmpId = myFactory.getEmpId(); var loginEmpId = myFactory.getEmpId();
urlRequest = appConfig.appUri+ "resources/moveToOpenPool?loginEmpId="+loginEmpId; urlRequest = appConfig.appUri+ "resources/moveToOpenPool?loginEmpId="+loginEmpId;
...@@ -825,24 +823,35 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -825,24 +823,35 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$timeout(function () { $timeout(function () {
getProjectDetails($scope.projectId, $scope.status); getProjectDetails($scope.projectId, $scope.status);
}, 500); }, 500);
}
$mdDialog.show($mdDialog.alert({ $mdDialog.show($mdDialog.alert({
skipHide: true, skipHide: true,
textContent: response.data.message , textContent: response.data.message ,
ok: 'ok' ok: 'ok'
})).then(function () { })).then(function () {
$scope.myForm.$setPristine(); $scope.myForm.$setPristine();
}) })
}, function myError(response){ }else{
$scope.alertMsg=response.data.message;
if($scope.alertMsg && $scope.alertMsg != ""){
row.billingStartDate = $scope.parentData.newBillingStartDate;
row.billingEndDate = $scope.parentData.endDate;
row.resourceRole = $scope.parentData.role;
row.billableStatus = $scope.parentData.billableStatus;
}
$scope.previousRow = angular.copy(row);
}
}, function myError(response){
$scope.result = "Error"; $scope.result = "Error";
}); });
} }
$scope.changeAllocationStatusToEngaged = function (row) { $scope.changeAllocationStatusToEngaged = function (row) {
if(row.billableStatus == "Reserved"){ if(row.billableStatus == "Reserved"){
$scope.alertMsg = 'Please Update Your Billability Status From Reserved and then Move to Engage'; $scope.alertMsg = 'Please Update Your Billability Status From Reserved and then Move to Engage';
}else { }else {
row.resourceRole == 'Individual Contributor' ? row.resourceRole = 'Employee' : row.resourceRole;
$scope.alertMsg =''; $scope.alertMsg ='';
var loginEmpId = myFactory.getEmpId(); var loginEmpId = myFactory.getEmpId();
var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":row.resourceRole,"billingStartDate":row.billingStartDate,"status":"Engaged"}; var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":row.resourceRole,"billingStartDate":row.billingStartDate,"status":"Engaged"};
...@@ -861,15 +870,25 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -861,15 +870,25 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$timeout(function () { $timeout(function () {
getProjectDetails($scope.projectId, $scope.status); getProjectDetails($scope.projectId, $scope.status);
}, 500); }, 500);
}
$mdDialog.show($mdDialog.alert({ $mdDialog.show($mdDialog.alert({
skipHide: true, skipHide: true,
textContent: response.data.message , textContent: response.data.message ,
ok: 'ok' ok: 'ok'
})).then(function () { })).then(function () {
$scope.myForm.$setPristine(); $scope.myForm.$setPristine();
}) })
}, function myError(response){ }else{
$scope.alertMsg=response.data.message;
if($scope.alertMsg && $scope.alertMsg != ""){
row.billingStartDate = $scope.parentData.newBillingStartDate;
row.billingEndDate = $scope.parentData.endDate;
row.resourceRole = $scope.parentData.role;
row.billableStatus = $scope.parentData.billableStatus;
}
$scope.previousRow = angular.copy(row);
}
}, function myError(response){
$scope.result = "Error"; $scope.result = "Error";
}); });
} }
...@@ -1500,6 +1519,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -1500,6 +1519,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope.alertMsg = "Please select a Allocation Status"; $scope.alertMsg = "Please select a Allocation Status";
angular.element(document.getElementById('empAllocationStatus')).focus(); angular.element(document.getElementById('empAllocationStatus')).focus();
} }
else if($scope.endDate < $scope.newBillingStartDate){
$scope.alertMsg = "Billling Start date should not exceed Billing end date";
}
/* else if(employeeModel != undefined && projectModel != undefined && action == "Add" && getExistingRecordProjectStatus(employeeModel.employeeId, projectModel.projectName)){ /* else if(employeeModel != undefined && projectModel != undefined && action == "Add" && getExistingRecordProjectStatus(employeeModel.employeeId, projectModel.projectName)){
$scope.alertMsg = "Employee is already assigned to the selected project"; $scope.alertMsg = "Employee is already assigned to the selected project";
return false; return false;
...@@ -1621,7 +1643,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -1621,7 +1643,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
} }
else { else {
$mdDialog.show($mdDialog.confirm({ $mdDialog.show($mdDialog.confirm({
skipHide: true, skipHide: true,
textContent: 'Are you sure you want to cancel this?', textContent: 'Are you sure you want to cancel this?',
ok: 'ok', ok: 'ok',
cancel: 'cancel' cancel: 'cancel'
......
...@@ -14,7 +14,7 @@ myApp.controller("reservedReportsController",function($scope,exportUiGridService ...@@ -14,7 +14,7 @@ myApp.controller("reservedReportsController",function($scope,exportUiGridService
return 'red'; return 'red';
} }
}}, }},
{name : 'accountName', displayName: 'Client', enableColumnMenu: false, enableSorting: false, enableFiltering:false}, {name : 'accountName', displayName: 'Client', enableColumnMenu: false, enableSorting: false, enableFiltering:true},
{field : 'projectName',displayName: 'Project Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true}, {field : 'projectName',displayName: 'Project Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{name : 'billingStartDate', displayName: 'Reserved Start Date', enableColumnMenu: false,cellFilter: 'date:"dd-MMM-yyyy"', enableSorting: false, enableFiltering:false}, {name : 'billingStartDate', displayName: 'Reserved Start Date', enableColumnMenu: false,cellFilter: 'date:"dd-MMM-yyyy"', enableSorting: false, enableFiltering:false},
{name : 'billingEndDate', displayName: 'Reserved End Date', enableColumnMenu: false,cellFilter: 'date:"dd-MMM-yyyy"', enableSorting: false, enableFiltering:false} {name : 'billingEndDate', displayName: 'Reserved End Date', enableColumnMenu: false,cellFilter: 'date:"dd-MMM-yyyy"', enableSorting: false, enableFiltering:false}
......
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