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.context-path=/myTime/
server.context-path=/myTeam/
#Mongo DB configuration
spring.data.mongodb.host=10.3.45.11
......
......@@ -16,7 +16,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 50,
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
enableFiltering: true,
......@@ -105,6 +105,12 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
method : "GET",
url : appConfig.appUri + "user/getEmployeeByStatus?status="+$scope.status
}).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;
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
......
......@@ -114,6 +114,12 @@ myApp.controller("domainController",
.then(
function mySuccess(response) {
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;
},
function myError(response) {
......
......@@ -53,6 +53,6 @@ myApp.controller("headerController",function($scope, myFactory, $compile, $mdDia
}
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
method: "GET",
url: appConfig.appUri + "project/getProjects"
}).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;
}, function myError(response) {
......@@ -313,6 +319,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.prjctStses=["Active","Completed","On Hold","Proposed"];
$scope.billableStatuses = ["Billable","Shadow","Non-Billable","Reserved"];
$scope.employeeShifts = myFactory.getShifts();
$scope.deliveryLeadIds = dataToPass.deliveryLeadIds;
var allAccounts = myFactory.getAccounts();
function getActiveAccounts(){
var activeAccounts = [];
......@@ -521,6 +528,12 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
method: "GET",
url: appConfig.appUri + "/projectTeam/getProjectDetails?projectId=" + $scope.projectId + "&status=" + $scope.status
}).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;
for(i=0;i<response.data.length;i++){
if(response.data[i].role == 'Lead'){
......@@ -1038,16 +1051,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$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};
if(action == "Add"){
addRecord(record,action);
$timeout(function(){
updateGrid(action,record);
removeTab('Add');
$mdDialog.show($mdDialog.alert({
skipHide: true,
textContent: 'Employee Added',
ok: 'ok'
}));
},500);
addRecord(record,action);
}else if(action == "Update"){
updateTeamRecord(record,action);
$timeout(function(){
......@@ -1309,7 +1313,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function addRecord(record, action){
var urlRequest = "";
urlRequest = appConfig.appUri+ "projectTeam/addEmployeeToTeam";
urlRequest = appConfig.appUri+ "projectTeam/addEmployeeToTeamWithCheck";
var req = {
method : 'POST',
url : urlRequest,
......@@ -1320,7 +1324,22 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}
$http(req).then(function mySuccess(response) {
$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){
$scope.result = "Error";
});
......
......@@ -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>';
$scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 50,
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
enableFiltering: true,
......@@ -48,6 +48,12 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
method : "GET",
url : appConfig.appUri + "account/accounts"
}).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;
myFactory.setAccounts(response.data);
for(i=0;i<response.data.length;i++){
......
......@@ -404,7 +404,7 @@ angular.module('ngIdle.title', [])
var state = {
original: null,
idle: 'Your session is expired',
timedout: 'My Time'
timedout: 'My Team'
};
return {
......
......@@ -16,7 +16,7 @@ function($mdDateLocaleProvider) {
//TODO: Replace this appUri with the domain name created
myApp.constant('appConfig', {
appName: "MyTime",
appUri: "http://10.3.45.11:8080/myTime/",
appUri: "http://10.3.45.11:8080/myTeam/",
version:"1.0",
empStartId:16001,
empEndId:16999,
......
......@@ -6,8 +6,8 @@
<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="author" content=""></meta>
<base href="/myTime/"></base>
<title>My Time</title>
<base href="/myTeam/"></base>
<title>My Team</title>
<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/angularjs/1.6.4/angular.min.js"></script>
......
......@@ -28,7 +28,7 @@
</div>
<div class="col-xs-6 text-right ">
<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>
</div>
......@@ -72,7 +72,7 @@
</div>
<div class="col-xs-6 text-center ">
<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>
</div>
</div>
......@@ -202,7 +202,7 @@
<div class="col-xs-6 text-center ">
<p>
<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>
</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