Commit 1b2ad8af authored by Prayas Jain's avatar Prayas Jain

Fixed Pagination Issue in view team screen and move to engage api

parent 276c4723
......@@ -23,6 +23,7 @@ public interface ResourceRepo
List<Resource> findByBillableStatus(String resourceAllocationStatus);
List<Resource> findByBillingStartDateGreaterThan(Date billingStartDate);
Resource findOneByEmployeeIdAndStatus(String employeeId,String status);
List<Resource> findByBillingStartDateBetween(Date fromDate,Date toDate);
//Set<Resource> findByBillableStatus(String resourceAllocationStatus);
......
......@@ -509,7 +509,7 @@ public class ResourceService implements IResourceService {
} else if (statusFlag.equals(MyTeamUtils.STATUS_PROPOSED) && resource.getStatus().equals(MyTeamUtils.STATUS_PROPOSED)){
resourceVO.setResourceStatus(MyTeamUtils.STATUS_PROPOSED);
resourcesList.add(resourceVO);
}else if (statusFlag.equals(MyTeamUtils.BOTH))
}else if (statusFlag.equals(MyTeamUtils.ALL))
resourcesList.add(resourceVO);
}
......
......@@ -607,10 +607,10 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
var employeeModel = $scope.employeeModel;
var getCellTemplate1 = '<p class="col-lg-12"><i ng-show="grid.appScope.showEditIcon(row.entity)" class="fa fa-pencil-square-o fa-2x" data-placement="center" title="Edit" onmouseenter="$(this).tooltip(\'show\')" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.edit(row)"></i>'+
'<i ng-show="row.entity.editrow" class="fa fa-save fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Save" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.saveRow(row.entity,\'Update\')"></i>'
+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.editrow" id="cancelEdit" class="fa fa-times fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Cancel" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.cancelEdit(row.entity)"></i>'
+'&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.editrow" id="cancelEdit" class="fa fa-times fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Cancel" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.cancelEdit(row.entity)"></i>'
+'<i ng-show="grid.appScope.showMoveToBenchIcon(row.entity) && !row.entity.editrow" id="moveResource" class="fa fa-arrow-circle-right fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Release" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.moveToBench(row.entity)"></i>'+
'<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="deleteResource" class="fa fa-arrow-circle-left fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Engage" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.changeAllocationStatusToEngaged(row.entity)"></i>'+
'&nbsp;&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="moveToProject" class="fa fa-trash fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.deleteProposedResource(row.entity)"></i></p>';
'<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="moveToProject" class="fa fa-arrow-circle-left fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Engage" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.changeAllocationStatusToEngaged(row.entity)"></i>'+
'&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="deleteResource" class="fa fa-trash fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.deleteProposedResource(row.entity)"></i></p>';
//'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>';
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>';
......@@ -670,12 +670,6 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
method: "GET",
url: appConfig.appUri + "resources/project/"+ $scope.projectId + "?status=" + $scope.status
}).then(function mySuccess(response) {
if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true;
}
else{
$scope.gridOptions.enablePaginationControls = false;
}
$scope.gridOptions.data = response.data.records;
for(i=0;i<response.data.records.length;i++){
if(response.data.records[i].resourceRole == 'Lead'){
......@@ -684,6 +678,13 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope.gridOptions.data[i].resourceRole = "Individual Contributor";
}
}
if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true;
}
else{
$scope.gridOptions.enablePaginationControls = false;
}
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = [];
......@@ -733,7 +734,6 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope.edit = function (rowd) {
console.log(rowd)
var row = rowd.entity;
var index = $scope.gridOptions.data.indexOf(row);
if($scope.previousRow){
......@@ -828,11 +828,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
$scope.changeAllocationStatusToEngaged = function (row) {
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"};
console.log(record);
var urlRequest = "";
var loginEmpId = myFactory.getEmpId();
//urlRequest = appConfig.appUri+ "resources/moveToOpenPool?loginEmpId="+loginEmpId;
var urlRequest = appConfig.appUri+ "resources?loginEmpId="+loginEmpId;
var req = {
method : 'PUT',
url : urlRequest,
......@@ -843,7 +841,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
$http(req).then(function mySuccess(response) {
$scope.result = "Success";
if(response.data.message == "Resource's status has been changed Successfully"){
if(response.data.message == "Resource updated successfully"){
$timeout(function () {
getProjectDetails($scope.projectId, $scope.status);
}, 500);
......@@ -1820,12 +1818,12 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
url: appConfig.appUri + "resources/project/"+ $scope.projectId + "?status=" + $scope.status
}).then(function mySuccess(response) {
$scope.gridOptions.data = response.data.records;
// if(status == "InActive" || dataToPass.status == "InActive"){
// $scope.gridOptions.columnDefs[5].visible = false;
// }
// else{
// $scope.gridOptions.columnDefs[5].visible = true;
// }
if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true;
}
else{
$scope.gridOptions.enablePaginationControls = false;
}
for(i=0;i<$scope.gridOptions.data.length;i++){
if($scope.gridOptions.data[i].resourceRole == 'Lead'){
$scope.gridOptions.data[i].resourceRole = "Lead";
......
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