Commit 9a8d3141 authored by Prayas Jain's avatar Prayas Jain

ADDED FILTER IN MANAGE PROJECTS

parent 7847d4ec
...@@ -94,6 +94,8 @@ public class EmployeeService implements IEmployeeService { ...@@ -94,6 +94,8 @@ public class EmployeeService implements IEmployeeService {
if (employeeReq.getEmpStatus().equalsIgnoreCase(MyTeamUtils.IN_ACTIVE_SPACE)) { if (employeeReq.getEmpStatus().equalsIgnoreCase(MyTeamUtils.IN_ACTIVE_SPACE)) {
update.set("endDate", employeeReq.getEndDate()); update.set("endDate", employeeReq.getEndDate());
update.set("empSubStatus", null);
} }
// update employee location // update employee location
if (employeeReq.getEmpLocation() != null && !employeeReq.getEmpLocation().equals("")) { if (employeeReq.getEmpLocation() != null && !employeeReq.getEmpLocation().equals("")) {
......
...@@ -92,7 +92,12 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -92,7 +92,12 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
} }
$scope.getProjects = function () { $scope.getProjects = function (type) {
$scope.status="Active";
$mdDialog.hide();
if(type == "onload"){
showProgressDialog("Fetching data please wait...");
}
var role = myFactory.getEmpRole(); var role = myFactory.getEmpRole();
var empId = myFactory.getEmpId(); var empId = myFactory.getEmpId();
//var deliveryLeadEmpId = ((role == "Delivery Lead") ? empId : undefined); //var deliveryLeadEmpId = ((role == "Delivery Lead") ? empId : undefined);
...@@ -100,19 +105,63 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -100,19 +105,63 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
method: "GET", method: "GET",
url: appConfig.appUri + "projects/employeeId/"+empId url: appConfig.appUri + "projects/employeeId/"+empId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$mdDialog.hide();
$scope.status="Active";
$scope.activeProjectsArray=[];
$scope.completedProjectsArray=[];
$scope.allProjectsArray = response.data.records;
angular.forEach(response.data.records, function(project) {
if(project.status == 'Active'){
$scope.activeProjectsArray.push(project);
} else if(project.status == 'Completed'){
$scope.completedProjectsArray.push(project);
} else{
}
});
$scope.gridOptions.data = $scope.activeProjectsArray;
if(response.data.records.length > 10){ if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true; $scope.gridOptions.enablePaginationControls = true;
} }
else{ else{
$scope.gridOptions.enablePaginationControls = false; $scope.gridOptions.enablePaginationControls = false;
} }
$scope.gridOptions.data = response.data.records;
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
}); });
}; };
$scope.getProjectDetails = function (projectStatus){
if(projectStatus == 'all'){
$scope.status = projectStatus;
$scope.gridOptions.data=$scope.allProjectsArray;
}else if (projectStatus == 'Completed'){
$scope.status=projectStatus;
$scope.gridOptions.data=$scope.completedProjectsArray;
}else if (projectStatus == 'Active'){
$scope.status=projectStatus;
$scope.gridOptions.data=$scope.activeProjectsArray;
}else{
}
}
function showProgressDialog(msg){
$('#home').addClass('md-scroll-mask');
$mdDialog.show({
templateUrl: 'templates/progressDialog.html',
controller: ProgressController,
parent: angular.element(document.body),
clickOutsideToClose:false,
locals: {dataToPass:msg}
});
}
function ProgressController($scope, dataToPass) {
$scope.progressText = dataToPass;
}
$scope.getManagerDetails = function () { $scope.getManagerDetails = function () {
$http({ $http({
method: "GET", method: "GET",
......
...@@ -16,7 +16,7 @@ function($mdDateLocaleProvider) { ...@@ -16,7 +16,7 @@ function($mdDateLocaleProvider) {
//TODO: Replace this appUri with the domain name created //TODO: Replace this appUri with the domain name created
myApp.constant('appConfig', { myApp.constant('appConfig', {
appName: "MyTime", appName: "MyTime",
appUri: "http://10.3.45.11:8080/myTeam/", appUri: "http://localhost:8080/myTeam/",
version:"1.0", version:"1.0",
empStartId:16001, empStartId:16001,
empEndId:99999, empEndId:99999,
...@@ -41,8 +41,9 @@ myApp.factory('myFactory', function() { ...@@ -41,8 +41,9 @@ myApp.factory('myFactory', function() {
var accounts=""; var accounts="";
var functionalgroups=""; var functionalgroups="";
var employeeStatus=""; var employeeStatus="";
var employeeSubStatus="";
var employementTypes=""; var employementTypes="";
var domians=""; var domains="";
function setEmpId(id) { function setEmpId(id) {
empId = id; empId = id;
} }
...@@ -134,6 +135,12 @@ myApp.factory('myFactory', function() { ...@@ -134,6 +135,12 @@ myApp.factory('myFactory', function() {
function getEmployeeStatus() { function getEmployeeStatus() {
return employeeStatus; return employeeStatus;
} }
function setEmployeeSubStatus(employeeSubStatus1) {
employeeSubStatus = employeeSubStatus1;
}
function getEmployeeSubStatus() {
return employeeSubStatus;
}
function setEmployementTypes(employementTypes1) { function setEmployementTypes(employementTypes1) {
employementTypes = employementTypes1; employementTypes = employementTypes1;
} }
...@@ -252,6 +259,8 @@ myApp.factory('myFactory', function() { ...@@ -252,6 +259,8 @@ myApp.factory('myFactory', function() {
getFunctionalgroups : getFunctionalgroups, getFunctionalgroups : getFunctionalgroups,
setEmployeeStatus : setEmployeeStatus, setEmployeeStatus : setEmployeeStatus,
getEmployeeStatus : getEmployeeStatus, getEmployeeStatus : getEmployeeStatus,
setEmployeeSubStatus : setEmployeeSubStatus,
getEmployeeSubStatus : getEmployeeSubStatus,
setEmployementTypes: setEmployementTypes, setEmployementTypes: setEmployementTypes,
getEmployementTypes : getEmployementTypes, getEmployementTypes : getEmployementTypes,
setRoles: setRoles, setRoles: setRoles,
......
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
</div> </div>
<div class="col-lg-7 col-xs-6"> <div class="col-lg-7 col-xs-6">
<p> <p>
{{profile.empStatus}} {{profile.empStatus}} {{profile.empSubStatus ? "(" : "" }} {{profile.empSubStatus ? profile.empSubStatus : "" }} {{profile.empSubStatus ? ")" : "" }}
</p> </p>
</div> </div>
</div> </div>
......
<div class="md-padding" id="popupContainer" ng-controller="projectController" <div class="md-padding" id="popupContainer" ng-controller="projectController"
ng-init="getProjects();getManagerDetails();"> ng-init="getProjects('onload');getManagerDetails();">
<div class="container-fluid mainDivHeaderClass"> <div class="container-fluid mainDivHeaderClass">
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-6">
<h1 class="no-padding">Manage Projects <h1 class="no-padding">Manage Projects</h1>
<span class="right"> </div>
<md-button class="add-btn md-raised md-primary" <div class="col-lg-6 add-emp no-padding">
<span>
<input type="radio" ng-model="status" value="Active" ng-click="getProjectDetails(status)"> Active
<input type="radio" ng-model="status" value="Completed" ng-click="getProjectDetails(status)"> Completed
<input type="radio" ng-model="status" value="all" ng-click="getProjectDetails(status)"> All
</span>
<label class="" for="submitBtn"> </label>
<md-button
class="md-raised md-primary"
ng-click="addProject('Assign', parentData)"> <i ng-click="addProject('Assign', parentData)"> <i
class="fa fa-plus-circle fa-1x"></i> Add class="fa fa-plus-circle fa-2x"></i> Add Project</md-button>
Project</md-button>
<i class="fa fa-refresh" aria-hidden="true" ng-click="refreshPage()"></i> <i class="fa fa-refresh" aria-hidden="true" ng-click="refreshPage()"></i>
</span>
</h1>
</div> </div>
<!-- <div class="col-lg-12"> <!-- <div class="col-lg-12">
<p align="center" class="col-xs-11" <p align="center" class="col-xs-11"
style="vertical-align: middle; font-weight: bold; font-size: 30px;">Manage Projects</p> style="vertical-align: middle; font-weight: bold; font-size: 30px;">Manage Projects</p>
<p align="right" class="col-xs-1" <p align="right" class="col-xs-1"
...@@ -25,6 +30,8 @@ ...@@ -25,6 +30,8 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div> </div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
......
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