Commit 0731efc5 authored by mduppanapudi-nisum-com's avatar mduppanapudi-nisum-com Committed by rbonthala-nisum-com

Now url will be changed to myTeam, grid pagination based on records.I… (#113)

* Now url will be changed to myTeam, grid pagination based on records.In projects , employee assigned to one project cannot be assign to multiple projects

* display Delivery leads while add , update and view Team details
parent c9cf1072
server.port=8080 server.port=8080
server.context-path=/myTime/ server.context-path=/myTeam/
#Mongo DB configuration #Mongo DB configuration
spring.data.mongodb.host=10.3.45.11 spring.data.mongodb.host=10.3.45.11
......
...@@ -16,7 +16,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -16,7 +16,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 50, paginationPageSize : 10,
pageNumber: 1, pageNumber: 1,
pageSize:10, pageSize:10,
enableFiltering: true, enableFiltering: true,
...@@ -105,6 +105,12 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -105,6 +105,12 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
method : "GET", method : "GET",
url : appConfig.appUri + "user/getEmployeeByStatus?status="+$scope.status url : appConfig.appUri + "user/getEmployeeByStatus?status="+$scope.status
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.length > 10){
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "visible";
}
else{
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "hidden";
}
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
......
...@@ -114,6 +114,12 @@ myApp.controller("domainController", ...@@ -114,6 +114,12 @@ myApp.controller("domainController",
.then( .then(
function mySuccess(response) { function mySuccess(response) {
console.log(response.data); console.log(response.data);
if(response.data.length > 10){
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "visible";
}
else{
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "hidden";
}
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
}, },
function myError(response) { function myError(response) {
......
...@@ -53,6 +53,6 @@ myApp.controller("headerController",function($scope, myFactory, $compile, $mdDia ...@@ -53,6 +53,6 @@ myApp.controller("headerController",function($scope, myFactory, $compile, $mdDia
} }
function ProgressController($scope) { function ProgressController($scope) {
$scope.progressText = "Please wait!!! Logging out from My Time."; $scope.progressText = "Please wait!!! Logging out from My Team.";
} }
}); });
\ No newline at end of file
...@@ -95,6 +95,12 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -95,6 +95,12 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
method: "GET", method: "GET",
url: appConfig.appUri + "project/getProjects" url: appConfig.appUri + "project/getProjects"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.length > 10){
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "visible";
}
else{
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "hidden";
}
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
}, function myError(response) { }, function myError(response) {
...@@ -313,6 +319,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -313,6 +319,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.prjctStses=["Active","Completed","On Hold","Proposed"]; $scope.prjctStses=["Active","Completed","On Hold","Proposed"];
$scope.billableStatuses = ["Billable","Shadow","Non-Billable","Reserved"]; $scope.billableStatuses = ["Billable","Shadow","Non-Billable","Reserved"];
$scope.employeeShifts = myFactory.getShifts(); $scope.employeeShifts = myFactory.getShifts();
$scope.deliveryLeadIds = dataToPass.deliveryLeadIds;
var allAccounts = myFactory.getAccounts(); var allAccounts = myFactory.getAccounts();
function getActiveAccounts(){ function getActiveAccounts(){
var activeAccounts = []; var activeAccounts = [];
...@@ -521,6 +528,12 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -521,6 +528,12 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
method: "GET", method: "GET",
url: appConfig.appUri + "/projectTeam/getProjectDetails?projectId=" + $scope.projectId + "&status=" + $scope.status url: appConfig.appUri + "/projectTeam/getProjectDetails?projectId=" + $scope.projectId + "&status=" + $scope.status
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.length > 10){
document.getElementsByClassName("ui-grid-pager-panel")[1].style.visibility = "visible";
}
else{
document.getElementsByClassName("ui-grid-pager-panel")[1].style.visibility = "hidden";
}
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
for(i=0;i<response.data.length;i++){ for(i=0;i<response.data.length;i++){
if(response.data[i].role == 'Lead'){ if(response.data[i].role == 'Lead'){
...@@ -1038,16 +1051,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1038,16 +1051,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.alertMsg = ""; $scope.alertMsg = "";
var record = {"employeeId":employeeModel.employeeId, "employeeName":employeeModel.employeeName, "emailId": employeeModel.emailId, "designation":employeeModel.designation,"projectId":project,"projectName":projectName,"managerId":managerId,"managerName":managerName,"mobileNumber":employeeModel.mobileNumber,"active":true,"billableStatus":$scope.empBillableStatus,"startDate":$scope.startDate,"endDate":$scope.endDate,"account":account,"role":$scope.employeeRole,"newBillingStartDate":newBillingStartDate,"accountId":$scope.accountId,"domainId":$scope.domainId,"shift":$scope.employeeShift,"projectStartDate":$scope.startDate,"projectEndDate":$scope.endDate}; var record = {"employeeId":employeeModel.employeeId, "employeeName":employeeModel.employeeName, "emailId": employeeModel.emailId, "designation":employeeModel.designation,"projectId":project,"projectName":projectName,"managerId":managerId,"managerName":managerName,"mobileNumber":employeeModel.mobileNumber,"active":true,"billableStatus":$scope.empBillableStatus,"startDate":$scope.startDate,"endDate":$scope.endDate,"account":account,"role":$scope.employeeRole,"newBillingStartDate":newBillingStartDate,"accountId":$scope.accountId,"domainId":$scope.domainId,"shift":$scope.employeeShift,"projectStartDate":$scope.startDate,"projectEndDate":$scope.endDate};
if(action == "Add"){ if(action == "Add"){
addRecord(record,action); addRecord(record,action);
$timeout(function(){
updateGrid(action,record);
removeTab('Add');
$mdDialog.show($mdDialog.alert({
skipHide: true,
textContent: 'Employee Added',
ok: 'ok'
}));
},500);
}else if(action == "Update"){ }else if(action == "Update"){
updateTeamRecord(record,action); updateTeamRecord(record,action);
$timeout(function(){ $timeout(function(){
...@@ -1309,7 +1313,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1309,7 +1313,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function addRecord(record, action){ function addRecord(record, action){
var urlRequest = ""; var urlRequest = "";
urlRequest = appConfig.appUri+ "projectTeam/addEmployeeToTeam"; urlRequest = appConfig.appUri+ "projectTeam/addEmployeeToTeamWithCheck";
var req = { var req = {
method : 'POST', method : 'POST',
url : urlRequest, url : urlRequest,
...@@ -1320,7 +1324,22 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1320,7 +1324,22 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
} }
$http(req).then(function mySuccess(response) { $http(req).then(function mySuccess(response) {
$scope.result = "Success"; $scope.result = "Success";
$scope.objectId = response.data.id; var titleOfModel = "Attention";
// $scope.objectId = response.data.id;
if(response.data =="TeamMate added successfuly"){
titleOfModel = "";
$timeout(function(){
updateGrid(action,record);
removeTab('Add');
},500);
}
$mdDialog.show($mdDialog.alert({
skipHide: true,
title:titleOfModel,
textContent: response.data,
ok: 'ok'
}));
}, function myError(response){ }, function myError(response){
$scope.result = "Error"; $scope.result = "Error";
}); });
......
...@@ -13,7 +13,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -13,7 +13,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
'<p class="col-lg-4"><i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p></p>'; '<p class="col-lg-4"><i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p></p>';
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 50, paginationPageSize : 10,
pageNumber: 1, pageNumber: 1,
pageSize:10, pageSize:10,
enableFiltering: true, enableFiltering: true,
...@@ -48,6 +48,12 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -48,6 +48,12 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
method : "GET", method : "GET",
url : appConfig.appUri + "account/accounts" url : appConfig.appUri + "account/accounts"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.length > 10){
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "visible";
}
else{
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "hidden";
}
$scope.gridOptions.data=response.data; $scope.gridOptions.data=response.data;
myFactory.setAccounts(response.data); myFactory.setAccounts(response.data);
for(i=0;i<response.data.length;i++){ for(i=0;i<response.data.length;i++){
......
...@@ -404,7 +404,7 @@ angular.module('ngIdle.title', []) ...@@ -404,7 +404,7 @@ angular.module('ngIdle.title', [])
var state = { var state = {
original: null, original: null,
idle: 'Your session is expired', idle: 'Your session is expired',
timedout: 'My Time' timedout: 'My Team'
}; };
return { return {
......
...@@ -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/myTime/", appUri: "http://10.3.45.11:8080/myTeam/",
version:"1.0", version:"1.0",
empStartId:16001, empStartId:16001,
empEndId:16999, empEndId:16999,
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="description" content=""></meta> <meta name="description" content=""></meta>
<meta name="author" content=""></meta> <meta name="author" content=""></meta>
<base href="/myTime/"></base> <base href="/myTeam/"></base>
<title>My Time</title> <title>My Team</title>
<link rel="icon" type="image/png" href="images/favicon.png"> <link rel="icon" type="image/png" href="images/favicon.png">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</div> </div>
<div class="col-xs-6 text-right "> <div class="col-xs-6 text-right ">
<p> <p>
<b>Manager Name: </b><span ng-repeat="manager in managerIds">{{manager.employeeName}}<span ng-hide="$last">,</span></span> <b>Manager Name: </b><span ng-repeat="manager in deliveryLeadIds">{{manager.employeeName}}<span ng-hide="$last">,</span></span>
</p> </p>
</div> </div>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</div> </div>
<div class="col-xs-6 text-center "> <div class="col-xs-6 text-center ">
<p> <p>
<b>Manager Name: </b><span ng-repeat="manager in managerIds">{{manager.employeeName}}<span ng-hide="$last">,</span></span> <b>Manager Name: </b><span ng-repeat="manager in deliveryLeadIds">{{manager.employeeName}}<span ng-hide="$last">,</span></span>
</p> </p>
</div> </div>
</div> </div>
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
<div class="col-xs-6 text-center "> <div class="col-xs-6 text-center ">
<p> <p>
<b>Manager Name:</b> <b>Manager Name:</b>
<span ng-repeat="manager in managerIds">{{manager.employeeName}} <span ng-repeat="manager in deliveryLeadIds">{{manager.employeeName}}
<span ng-hide="$last">,</span> <span ng-hide="$last">,</span>
</span> </span>
</p> </p>
......
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