Commit 33d41f29 authored by mduppanapudi-nisum-com's avatar mduppanapudi-nisum-com Committed by rbonthala-nisum-com

Ui changes as per services and bug fix (#126)

* Ui changes as per services and bug fix

* Pagination hide
parent 6a8d2de6
...@@ -12,8 +12,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -12,8 +12,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}; };
var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')"></i>'+ var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')"></i>'+
'&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>'; '&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>
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10, paginationPageSize : 10,
...@@ -103,10 +103,10 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -103,10 +103,10 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
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){ if(response.data.length > 10){
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "visible"; $scope.gridOptions.enablePaginationControls = true;
} }
else{ else{
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "hidden"; $scope.gridOptions.enablePaginationControls = false;
} }
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
}, function myError(response) { }, function myError(response) {
......
...@@ -16,7 +16,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -16,7 +16,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
var getCellTemplate = '<div class="ui-grid-cell-contents"><a href="#" ng-click="grid.appScope.getRowData(row,\'View\')">{{COL_FIELD}}</a></div>'; var getCellTemplate = '<div class="ui-grid-cell-contents"><a href="#" ng-click="grid.appScope.getRowData(row,\'View\')">{{COL_FIELD}}</a></div>';
//var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-2x" aria-hidden="true" style="font-size:1.5em;colormargin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')">{{COL_FIELD}}</i></i></p>'; //var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-2x" aria-hidden="true" style="font-size:1.5em;colormargin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')">{{COL_FIELD}}</i></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>'; // var getCellActiveTemplate='<div >COL_FIELD<p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
...@@ -27,12 +27,12 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -27,12 +27,12 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
columnDefs : [ columnDefs : [
{field : 'projectName',displayName: 'Project',cellTemplate:getCellTemplate, enableColumnMenu: true, enableSorting: true,enableFiltering:true}, {field : 'projectName',displayName: 'Project',cellTemplate:getCellTemplate, enableColumnMenu: true, enableSorting: true,enableFiltering:true},
{field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false,enableFiltering:true}, {field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false,enableFiltering:true},
{field : 'managerName',displayName: 'Manager Name', enableColumnMenu: false, enableSorting: false,enableFiltering:true}, {field : 'deliveryLeadIds',displayName: 'Delivery Lead',cellTemplate:'<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>', enableColumnMenu: false, enableSorting: false,enableFiltering:true},
{field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false,enableFiltering:false}, {field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false,enableFiltering:false},
{field : 'startDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false}, {field : 'projectStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false},
{field : 'endDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false}, {field : 'projectEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false},
{field : 'shift',displayName: 'Shift', enableColumnMenu: false, enableSorting: false,enableFiltering:false}, {field : 'shift',displayName: 'Shift', enableColumnMenu: false, enableSorting: false,enableFiltering:false},
{field : 'active',displayName: 'Active', enableColumnMenu: false,cellTemplate:getCellActiveTemplate,enableSorting: false,enableFiltering:false} {field : 'status',displayName: 'Active', enableColumnMenu: false,enableSorting: false,enableFiltering:false}
] ]
}; };
$scope.gridOptions.data = $scope.records; $scope.gridOptions.data = $scope.records;
...@@ -49,6 +49,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -49,6 +49,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
$scope.parentData.managerName = row.entity.managerName; $scope.parentData.managerName = row.entity.managerName;
$scope.parentData.experience = row.entity.experience; $scope.parentData.experience = row.entity.experience;
$scope.parentData.designation = row.entity.designation; $scope.parentData.designation = row.entity.designation;
$scope.parentData.deliveryLeadIds = row.entity.deliveryLeadIds;
if(action == "View") if(action == "View")
$scope.viewTeamDetails(action, $scope.parentData); $scope.viewTeamDetails(action, $scope.parentData);
...@@ -67,10 +68,10 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -67,10 +68,10 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
if(response.data.length > 10){ if(response.data.length > 10){
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "visible"; $scope.gridOptions.enablePaginationControls = true;
} }
else{ else{
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "hidden"; $scope.gridOptions.enablePaginationControls = false;
} }
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
...@@ -94,6 +95,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -94,6 +95,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
$mdDialog.hide(); $mdDialog.hide();
}; };
function ProjectDetailsController($scope, $mdDialog, dataToPass,gridOptionsData, managers) { function ProjectDetailsController($scope, $mdDialog, dataToPass,gridOptionsData, managers) {
console.log(dataToPass);
$scope.templateTitle = dataToPass.action; $scope.templateTitle = dataToPass.action;
$scope.alertMsg = ""; $scope.alertMsg = "";
$scope.isDisabled = false; $scope.isDisabled = false;
...@@ -104,8 +106,9 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -104,8 +106,9 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
if(dataToPass.action == "Assign"){}else if(dataToPass.action == "Update"){}else if(dataToPass.action == "View"){ if(dataToPass.action == "Assign"){}else if(dataToPass.action == "Update"){}else if(dataToPass.action == "View"){
$scope.projectId = dataToPass.projectId; $scope.projectId = dataToPass.projectId;
$scope.projectName = dataToPass.projectName; $scope.projectName = dataToPass.projectName;
$scope.managerId = dataToPass.managerId; // $scope.managerId = dataToPass.managerId;
$scope.managerName = dataToPass.managerName; // $scope.managerName = dataToPass.managerName;
$scope.deliveryLeads = dataToPass.deliveryLeadIds;
$scope.projectStatus = dataToPass.status; $scope.projectStatus = dataToPass.status;
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
...@@ -126,6 +129,12 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -126,6 +129,12 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
method : "GET", method : "GET",
url : appConfig.appUri + "/projectTeam/getProjectDetails?projectId="+$scope.projectId url : appConfig.appUri + "/projectTeam/getProjectDetails?projectId="+$scope.projectId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.length > 10){
$scope.gridOptions.enablePaginationControls = true;
}
else{
$scope.gridOptions.enablePaginationControls = false;
}
$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!!!");
......
...@@ -358,13 +358,13 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -358,13 +358,13 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.employeeRole = undefined; $scope.employeeRole = undefined;
$scope.empBillableStatus = undefined; $scope.empBillableStatus = undefined;
$scope.newBillingStartDate = undefined; $scope.newBillingStartDate = undefined;
$scope.startDate = new Date(dataToPass.projectStartDate);
$scope.endDate = new Date(dataToPass.projectEndDate);
$scope.employeeShift = undefined; $scope.employeeShift = undefined;
$scope.employeeModel = {}; $scope.employeeModel = {};
$('.md-datepicker-input')[0].value = null; $('.md-datepicker-input')[0].value = null;
$('.md-datepicker-input')[1].value = null; $('.md-datepicker-input')[1].value = null;
$('.md-datepicker-input')[2].value = null; $('.md-datepicker-input')[2].value = null;
$scope.startDate = (dataToPass.projectStartDate == null) ? null : new Date(dataToPass.projectStartDate);
$scope.endDate = (dataToPass.projectStartDate == null) ? null : new Date(dataToPass.projectEndDate);
document.getElementsByClassName("md-tab")[1].style.visibility = "visible" ; document.getElementsByClassName("md-tab")[1].style.visibility = "visible" ;
document.getElementsByClassName("md-tab")[2].style.visibility = "hidden" ; document.getElementsByClassName("md-tab")[2].style.visibility = "hidden" ;
$scope.isSecondTab = true; $scope.isSecondTab = true;
......
...@@ -50,10 +50,10 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -50,10 +50,10 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
url : appConfig.appUri + "account/accounts" url : appConfig.appUri + "account/accounts"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.length > 10){ if(response.data.length > 10){
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "visible"; $scope.gridOptions.enablePaginationControls = true;
} }
else{ else{
document.getElementsByClassName("ui-grid-pager-panel")[0].style.visibility = "hidden"; $scope.gridOptions.enablePaginationControls = false;
} }
$scope.gridOptions.data=response.data; $scope.gridOptions.data=response.data;
myFactory.setAccounts(response.data); myFactory.setAccounts(response.data);
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,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>Delivery Lead: </b><span ng-repeat="dl in deliveryLeads">{{dl.employeeName}}<span ng-hide="$last">,</span></span>
</p> </p>
</div> </div>
......
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