Commit 465732ba authored by Prayas Jain's avatar Prayas Jain

Updated_Project_Page

parent 773f36fc
......@@ -48,7 +48,7 @@ public class EmployeeController {
public ResponseEntity<?> createEmployee( @RequestBody Employee employeeReq,
@PathVariable(value = "empId") String loginEmpId, HttpServletRequest request) throws MyTeamException {
if (!empService.isEmployeeExistsById(loginEmpId)) {
if (empService.isEmployeeExistsById(loginEmpId)) {
Employee employeePersisted = empService.createEmployee(employeeReq, loginEmpId);
ResponseDetails createRespDetails = new ResponseDetails(new Date(), 901, "Employee has been created",
......
......@@ -382,8 +382,8 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
}
$http(req).then(function mySuccess(response) {
$scope.result = "Success";
if(response.data =='Account already exist'){
$scope.alertMsg=response.data;
if(response.data.message =='An Account is already existed'){
$scope.alertMsg=response.data.message;
}else{
$scope.alertMsg="";
}
......
......@@ -22,7 +22,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
enableFiltering: true,
columnDefs : [
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true,enableFiltering: true, width:120,cellClass: 'grid-align'},
{field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: true, enableSorting: true,enableFiltering: true,cellClass: 'grid-align',width:130},
{field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: true, enableSorting: true,enableFiltering: true,cellClass: 'grid-align',width:180},
{field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false,cellClass: 'grid-align'},
{field : 'empStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:80},
{field : 'empSubStatus',displayName: 'Sub Status', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:120,cellClass:function(grid,row,col){
......@@ -40,7 +40,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
return 'red';
}
}},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false,enableFiltering: true,cellClass: 'grid-align', width:140},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false,enableFiltering: true,cellClass: 'grid-align', width:180},
{field : 'baseTechnology',displayName: 'Skill', enableColumnMenu: false, enableSorting: false,enableFiltering: false,cellClass: 'grid-align'},
{field : 'designation',displayName: 'Designation', enableColumnMenu: false, enableSorting: true,enableFiltering: false,cellClass: 'grid-align'},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false,enableFiltering: false, width:100,cellClass: 'grid-align'}
......@@ -673,6 +673,11 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}
$http(req).then(function mySuccess(response) {
$scope.result = "Success";
if(response.data.message == "An Employee is already existed by the Id"){
$scope.alertMsg=response.data.message;
}else{
$scope.alertMsg="";
}
}, function myError(response){
$scope.result = "Error";
});
......
......@@ -194,7 +194,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
$scope.showOrHidePV="Show";
}
};
var getCellActiveTemplate='<div ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
//var getCellActiveTemplate='<div ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
$scope.gridOptionsProjectAllocatons = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
......@@ -208,7 +208,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
{field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'projectStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150},
{field : 'projectEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"' ,minWidth : 100,width: 150},
{field : 'status',displayName: 'Active', enableColumnMenu: false,cellTemplate:getCellActiveTemplate,enableSorting: false,minWidth : 100,width: 150}
{field : 'resourceStatus',displayName: 'Status', enableColumnMenu: false,enableSorting: false,minWidth : 100,width: 150}
]
};
......
......@@ -369,7 +369,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
var loginEmpId = myFactory.getEmpId();
urlRequest = appConfig.appUri+ "resources?loginEmpId="+loginEmpId;
var req = {
method : 'POST',
method : 'DELETE',
url : urlRequest,
headers : {
"Content-type" : "application/json"
......@@ -688,18 +688,18 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.parentData.employeeName = row.entity.employeeName;
$scope.parentData.emailId = row.entity.emailId;
$scope.parentData.id = row.entity.id;
$scope.parentData.role = row.entity.role;
$scope.parentData.shift = row.entity.shift;
$scope.parentData.role = row.entity.resourceRole;
//$scope.parentData.shift = row.entity.shift;
$scope.parentData.projectId = row.entity.projectId;
$scope.parentData.projectName = row.entity.projectName;
$scope.parentData.experience = row.entity.experience;
//$scope.parentData.experience = row.entity.experience;
$scope.parentData.designation = row.entity.designation;
$scope.parentData.billableStatus = row.entity.billableStatus;
$scope.parentData.shift = row.entity.shift;
$scope.parentData.mobileNumber = row.entity.mobileNumber;
//$scope.parentData.shift = row.entity.shift;
//$scope.parentData.mobileNumber = row.entity.mobileNumber;
$scope.parentData.employeeModel = {}
$scope.parentData.newBillingStartDate = row.entity.billingStartDate;
$scope.parentData.startDate = new Date(row.entity.startDate);
//$scope.parentData.startDate = new Date(row.entity.startDate);
$scope.parentData.endDate = new Date(row.entity.billingEndDate);
console.log($scope.parentData)
if(action == "UpdateTeam"){
......@@ -759,15 +759,15 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
// $scope.employeeModel.employeeName = userData.employeeName;
// $scope.employeeModel.emailId = userData.emailId;
$scope.empBillableStatus = userData.billableStatus;
if(userData.resourceRole == "Individual Contributor"){
if(userData.role == "Individual Contributor"){
$scope.employeeRole = "Employee";
}else{
$scope.employeeRole = "Lead";
}
//$scope.employeeRole = userData.role;
$scope.employeeShift = userData.shift;
//$scope.employeeShift = userData.shift;
$scope.newBillingStartDate = new Date(userData.newBillingStartDate);
$scope.startDate = new Date(userData.startDate);
//$scope.startDate = new Date(userData.startDate);
$scope.endDate = new Date(userData.endDate);
//$scope.addTab();
//$('#home').addClass('md-scroll-mask');
......@@ -1170,6 +1170,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}
$scope.validateFields = function (action) {
console.log(new Date($scope.parentData.newBillingStartDate));
console.log($scope.newBillingStartDate);
var project = $scope.projectId;
var projectName = $scope.projectName;
var account = $scope.account;
......@@ -1204,10 +1206,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
return false;
}
else if(!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate))){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date";
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between project start date and end date";
}
else if (!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date";
else if (!(($scope.newBillingStartDate >= $scope.parentData.newBillingStartDate) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between previous Billing start date and end date";
}else if($scope.endDate > new Date(dataToPass.projectEndDate)){
$scope.alertMsg = "End date should not exceed project end date";
}
......@@ -1356,27 +1358,29 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
};
$scope.DataUpdate = function () {
var data = $scope.parentData;
if (data.resourceRole == "Individual Contributor") {
if (data.role == "Individual Contributor") {
var roleselected = "Employee";
} else {
roleselected = data.role;
}
$scope.previousData = {
Role: roleselected,
Shift: data.shift,
//Shift: data.shift,
Billabilitystatus: data.billableStatus,
newBilligStartDate: new Date(data.newBillingStartDate),
Startdate: data.startDate,
//Startdate: data.startDate,
Enddate: data.endDate
},
$scope.currentData = {
Role: $scope.employeeRole,
Shift: $scope.employeeShift,
// Shift: $scope.employeeShift,
Billabilitystatus: $scope.empBillableStatus,
newBilligStartDate: $scope.newBillingStartDate,
Startdate: $scope.startDate,
//Startdate: $scope.startDate,
Enddate: $scope.endDate
}
console.log($scope.previousData)
console.log($scope.currentData)
var predata = JSON.stringify($scope.previousData);
var curdata = JSON.stringify($scope.currentData);
if (predata == curdata) {
......@@ -1513,13 +1517,13 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$http(req).then(function mySuccess(response) {
$scope.result = "Success";
var titleOfModel = "Attention";
if(response.data.records!=null){
$scope.objectId = response.data.records;
if(response.data.message == "Resource has been created"){
//$scope.objectId = response.data.records;
titleOfModel = "";
$timeout(function(){
updateGrid(action,record);
$timeout(function () {
getProjectDetails($scope.projectId, $scope.status);
removeTab('Add');
},500);
}, 500);
$mdDialog.show($mdDialog.alert({
skipHide: true,
......@@ -1573,7 +1577,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}
$http(req).then(function mySuccess(response) {
$scope.result = "Success";
if(response.data.message == "TeamMate updated successfuly"){
if(response.data.message == "Resource updated successfully"){
$timeout(function () {
getProjectDetails($scope.projectId, $scope.status);
removeTab('Add');
......
......@@ -27,11 +27,11 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog
pageSize:10,
columnDefs : [
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true, width:120},
{field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false},
{field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: false, enableSorting: true},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false},
//{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: false, width:100},
{field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false},
{field : 'mobileNumber',displayName: 'Mobile No', enableColumnMenu: false, enableSorting: false}
{field : 'mobileNo',displayName: 'Mobile No', enableColumnMenu: false, enableSorting: false}
// {name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, width:100}
]
};
......
......@@ -498,7 +498,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$scope.objectId = response.data.id;
$http({
method : "GET",
url : appConfig.appUri + "billing/project/" + record.projectId + "? employeeId=" +record.employeeId
url : appConfig.appUri + "resources/billing/project/" + record.projectId + "? employeeId=" +record.employeeId
}).then(function mySuccess(response) {
$scope.gridOptions.data = response.data;
......@@ -623,7 +623,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
};
$http({
method : "GET",
url : appConfig.appUri + "billing/project/" + dataToPass.projectId + "? employeeId=" +dataToPass.employeeId
url : appConfig.appUri + "resources/billing/project/" + dataToPass.projectId + "? employeeId=" +dataToPass.employeeId
}).then(function mySuccess(response) {
$scope.gridOptions.data = response.data;
}, function myError(response) {
......
......@@ -358,7 +358,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.isDisabled = true;
$http({
method : "GET",
url : appConfig.appUri + "getUnAssignedEmployees"
url : appConfig.appUri + "resources/unAssignedEmployees"
}).then(function mySuccess(response) {
//$scope.teamdetails=response.data;
//$scope.gridOptions.data.push(response.data);
......
......@@ -72,7 +72,7 @@
ng-value="status" ng-repeat="status in empStatuses">{{status}}</md-option>
</md-optgroup> </md-select></td>
</tr>
<tr ng-show="empStatus == 'Active'">
<tr ng-show="empStatus == 'Active' && templateTitle != 'Add' " >
<td colspan="4"><b>Select Sub Status :</b></td>
<td colspan="8"><md-select ng-model="empSubStatus" name ="empSubStatus"
ng-model ="empSubStatus" placeholder ="Select a Sub Status Type" id="empSubStatus">
......
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