Commit 0a4ebbcf authored by vsunke-nisum-com's avatar vsunke-nisum-com Committed by rbonthala-nisum-com

MT-79 (#21)

parent a7204af0
myApp.controller("projectController",function($scope, myFactory,exportUiGridService, $mdDialog, $http, appConfig, $timeout,$window){ myApp.controller("projectController", function ($scope, myFactory, exportUiGridService, $mdDialog, $http, appConfig, $timeout, $window, $mdSelect, $element) {
$scope.records = []; $scope.records = [];
$scope.empSearchId = ""; $scope.empSearchId = "";
$scope.parentData = { $scope.parentData = {
"projectId": "", "projectId": "",
"projectName": "", "projectName": "",
"account": "", "account": "",
"managerId":"", "managerId": "",
"managerName": "", "managerName": "",
"status": "", "status": "",
"action":"" "action": ""
}; };
$scope.managers = []; $scope.managers = [];
var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-book fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'View\')"></i>'+
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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>'+ //code added
'&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>'; $window.addEventListener('click', function (e) {
if (e.target.type !== 'search') {
$mdSelect.hide();
}
});
//code added
var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-book fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Edit" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'View\')" ></i>' +
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="View" onmouseenter="$(this).tooltip(\'show\')" 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;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>';
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10, paginationPageSizes: [10, 20, 30, 40, 50, 100],
paginationPageSize: 10,
pageNumber: 1, pageNumber: 1,
pageSize:10, pageSize: 10,
enableFiltering: true, enableFiltering: true,
columnDefs : [ columnDefs: [
{field : 'projectId',displayName: 'Project ID', enableColumnMenu: false, enableSorting: false,enableFiltering:false, width:120}, { field: 'projectId', displayName: 'Project ID', enableColumnMenu: false, enableSorting: false, enableFiltering: false, width: 120, },
{field : 'projectName',displayName: 'Project ', enableColumnMenu: false, enableSorting: true,enableFiltering:true}, { field: 'projectName', displayName: 'Project ', enableColumnMenu: false, enableSorting: true, enableFiltering: true },
{field : 'account',displayName: 'Account ', enableColumnMenu: false, enableSorting: true,enableFiltering:true}, { field: 'account', displayName: 'Account ', enableColumnMenu: false, enableSorting: true, enableFiltering: true },
//{field : 'managerId',displayName: 'Manager ID ', enableColumnMenu: false, enableSorting: false}, //{field : 'managerId',displayName: 'Manager ID ', enableColumnMenu: false, enableSorting: false},
{field : 'managerName',displayName: 'Manager Name ', enableColumnMenu: false, enableSorting: true,enableFiltering:true}, { field: 'managerIds', displayName: 'Manager Name ', cellTemplate: '<div ng-repeat= "item in row.entity[col.field]">{{item}}<span ng-hide="$last">,</span></div>', enableColumnMenu: false, enableSorting: true, enableFiltering: true },
{field : 'status',displayName: 'Status ', enableColumnMenu: false, enableSorting: true,enableFiltering:false}, { field: 'status', displayName: 'Status ', enableColumnMenu: false, enableSorting: true, enableFiltering: false },
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:130} { name: 'Actions', displayName: 'Actions', cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, enableFiltering: false, width: 130 }
] ]
}; };
$scope.gridOptions.data = $scope.records; $scope.gridOptions.data = $scope.records;
$scope.getRowData = function(row, action){
$scope.getRowData = function (row, action) {
$scope.parentData.projectId = row.entity.projectId; $scope.parentData.projectId = row.entity.projectId;
$scope.parentData.projectName = row.entity.projectName; $scope.parentData.projectName = row.entity.projectName;
$scope.parentData.account = row.entity.account; $scope.parentData.account = row.entity.account;
$scope.parentData.managerId = row.entity.managerId; $scope.parentData.managerId = row.entity.managerId;
$scope.parentData.managerName = row.entity.managerName; $scope.parentData.managerName = row.entity.managerName;
$scope.parentData.domain= row.entity.domain; $scope.parentData.domain = row.entity.domain;
$scope.parentData.status = row.entity.status; $scope.parentData.status = row.entity.status;
if(action == "Update") if (action == "Update")
$scope.addProject(action, $scope.parentData); $scope.addProject(action, $scope.parentData);
else if(action == "Delete") else if (action == "Delete")
$scope.deleteRole(row); $scope.deleteRole(row);
else if(action == "View") else if (action == "View")
$scope.viewTeamDetails(action, $scope.parentData); $scope.viewTeamDetails(action, $scope.parentData);
} }
$scope.refreshPage = function () {
$scope.refreshPage = function(){
$scope.empSearchId = ""; $scope.empSearchId = "";
$scope.getProjects(); $scope.getProjects();
$scope.getManagerDetails(); $scope.getManagerDetails();
} }
$scope.getProjects = function(){ $scope.getProjects = function () {
$http({ $http({
method : "GET", method: "GET",
url : appConfig.appUri + "project/getProjects" url: appConfig.appUri + "project/getProjects"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$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!!!");
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
}); });
}; };
$scope.getManagerDetails = function(){ $scope.getManagerDetails = function () {
$http({ $http({
method : "GET", method: "GET",
url : appConfig.appUri + "/user/getManagers" url: appConfig.appUri + "/user/getManagers"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.managers=response.data; $scope.managers = response.data;
}, 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.validateEmpId = function(){ $scope.validateEmpId = function () {
var searchId = $scope.empSearchId; var searchId = $scope.empSearchId;
if(searchId !="" && isNaN(searchId)){ if (searchId != "" && isNaN(searchId)) {
showAlert('Please enter only digits'); showAlert('Please enter only digits');
$scope.empSearchId = ""; $scope.empSearchId = "";
document.getElementById('empSearchId').focus(); document.getElementById('empSearchId').focus();
}else if(searchId != "" && (searchId.length < 5 || searchId.length > 5)){ } else if (searchId != "" && (searchId.length < 5 || searchId.length > 5)) {
showAlert('Employee ID should be 5 digits'); showAlert('Employee ID should be 5 digits');
$scope.empSearchId = ""; $scope.empSearchId = "";
document.getElementById('empSearchId').focus(); document.getElementById('empSearchId').focus();
}else if(searchId != "" && !checkEmpIdRange(searchId)){ } else if (searchId != "" && !checkEmpIdRange(searchId)) {
showAlert('Employee ID should be in between '+appConfig.empStartId+' - '+appConfig.empEndId); showAlert('Employee ID should be in between ' + appConfig.empStartId + ' - ' + appConfig.empEndId);
$scope.empSearchId = ""; $scope.empSearchId = "";
document.getElementById('empSearchId').focus(); document.getElementById('empSearchId').focus();
} }
}; };
function checkEmpIdRange(searchId){ function checkEmpIdRange(searchId) {
return parseInt(searchId) >= appConfig.empStartId && parseInt(searchId) <= appConfig.empEndId; return parseInt(searchId) >= appConfig.empStartId && parseInt(searchId) <= appConfig.empEndId;
} }
$scope.getEmployeeRole = function(type){ $scope.getEmployeeRole = function (type) {
var searchId = $scope.empSearchId; var searchId = $scope.empSearchId;
if(searchId =="" && searchId.length == 0){ if (searchId == "" && searchId.length == 0) {
showAlert('Employee ID is mandatory'); showAlert('Employee ID is mandatory');
$scope.empSearchId = ""; $scope.empSearchId = "";
document.getElementById('empSearchId').focus(); document.getElementById('empSearchId').focus();
}else if(searchId != "" && !checkEmpIdRange(searchId)){ } else if (searchId != "" && !checkEmpIdRange(searchId)) {
showAlert('Employee ID should be in between '+appConfig.empStartId+' - '+appConfig.empEndId); showAlert('Employee ID should be in between ' + appConfig.empStartId + ' - ' + appConfig.empEndId);
$scope.empSearchId = ""; $scope.empSearchId = "";
document.getElementById('empSearchId').focus(); document.getElementById('empSearchId').focus();
}else{ } else {
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
getEmployeeRoleData(searchId); getEmployeeRoleData(searchId);
} }
}; };
function getEmployeeRoleData(empId){ function getEmployeeRoleData(empId) {
$http({ $http({
method : "GET", method: "GET",
url : appConfig.appUri + "user/getEmployeeRoleData?empId=" + empId url: appConfig.appUri + "user/getEmployeeRoleData?empId=" + empId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data != "" && response.data.length !=0){ if (response.data != "" && response.data.length != 0) {
$scope.gridOptions.data.push(response.data); $scope.gridOptions.data.push(response.data);
} }
}, function myError(response) { }, function myError(response) {
...@@ -138,192 +152,180 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ ...@@ -138,192 +152,180 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
'Alert Dialog').ok('Ok')); 'Alert Dialog').ok('Ok'));
} }
$scope.addProject = function(action, userData){ $scope.addProject = function (action, userData) {
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddProjectController, controller: AddProjectController,
templateUrl: 'templates/newProject.html', templateUrl: 'templates/newProject.html',
parent: angular.element(document.body), parent: angular.element(document.body),
clickOutsideToClose:true, clickOutsideToClose: true,
locals:{dataToPass: userData,gridOptionsData: $scope.gridOptions.data, managers: $scope.managers}, locals: { dataToPass: userData, gridOptionsData: $scope.gridOptions.data, managers: $scope.managers },
}) })
.then(function(result) { .then(function (result) {
if(result == "Assign"){ $scope.refreshPage();showAlert('Project created successfully');} if (result == "Assign") { $scope.refreshPage(); showAlert('Project created successfully'); }
else if(result == "Update"){ $scope.refreshPage(); showAlert('Project updated successfully');} else if (result == "Update") { $scope.refreshPage(); showAlert('Project updated successfully'); }
else if(result == "Cancelled") console.log(result); else if (result == "Cancelled") console.log(result);
else showAlert('Project assigning/updation failed!!!'); else showAlert('Project assigning/updation failed!!!');
}); });
}; };
$scope.viewTeamDetails = function(action, userData){ $scope.viewTeamDetails = function (action, userData) {
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddProjectController, controller: AddProjectController,
templateUrl: 'templates/projectTeamDetails.html', templateUrl: 'templates/projectTeamDetails.html',
parent: angular.element(document.body), parent: angular.element(document.body),
clickOutsideToClose:true, clickOutsideToClose: true,
preserveScope: true, locals: { dataToPass: userData, gridOptionsData: $scope.gridOptions.data, managers: $scope.managers },
locals:{dataToPass: userData,gridOptionsData: $scope.gridOptions.data, managers: $scope.managers},
}) })
.then(function(result) { .then(function (result) {
if(result == "Assign") showAlert('Manager assigned successfully'); if (result == "Assign") showAlert('Manager assigned successfully');
else if(result == "Update") showAlert('Manager updated successfully'); else if (result == "Update") showAlert('Manager updated successfully');
else if(result == "Cancelled") console.log(result); else if (result == "Cancelled") console.log(result);
else showAlert('Manager assigning/updation failed!!!'); else showAlert('Manager assigning/updation failed!!!');
}); });
}; };
$scope.getUnAssignedEmployees = function (action, userData) {
$scope.getUnAssignedEmployees = function(action, userData){
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddProjectController, controller: AddProjectController,
templateUrl: 'templates/projectNotAssignedDetails.html', templateUrl: 'templates/projectNotAssignedDetails.html',
parent: angular.element(document.body), parent: angular.element(document.body),
clickOutsideToClose:true, clickOutsideToClose: true,
locals:{dataToPass: userData,gridOptionsData: $scope.gridOptions.data, managers: $scope.managers}, locals: { dataToPass: userData, gridOptionsData: $scope.gridOptions.data, managers: $scope.managers },
}) })
.then(function(result) { .then(function (result) {
if(result == "Assign") showAlert('Manager assigned successfully'); if (result == "Assign") showAlert('Manager assigned successfully');
else if(result == "Update") showAlert('Manager updated successfully'); else if (result == "Update") showAlert('Manager updated successfully');
else if(result == "Cancelled") console.log(result); else if (result == "Cancelled") console.log(result);
else showAlert('Manager assigning/updation failed!!!'); else showAlert('Manager assigning/updation failed!!!');
}); });
}; };
$scope.getAllocatedEmployees = function(action, userData){ $scope.getAllocatedEmployees = function (action, userData) {
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddProjectController, controller: AddProjectController,
templateUrl: 'templates/projectAssignedDetails.html', templateUrl: 'templates/projectAssignedDetails.html',
parent: angular.element(document.body), parent: angular.element(document.body),
clickOutsideToClose:true, clickOutsideToClose: true,
locals:{dataToPass: userData,gridOptionsData: $scope.gridOptions.data, managers: $scope.managers,employees:$scope.employees}, locals: { dataToPass: userData, gridOptionsData: $scope.gridOptions.data, managers: $scope.managers },
}) })
.then(function(result) { .then(function (result) {
console.log("result",result); if (result == "Assign") showAlert('Manager assigned successfully');
if(result == "Assign") showAlert('Manager assigned successfully'); else if (result == "Update") showAlert('Manager updated successfully');
else if(result == "Update") showAlert('Manager updated successfully'); else if (result == "Cancelled") console.log(result);
else if(result == "Cancelled") console.log(result);
else showAlert('Manager assigning/updation failed!!!'); else showAlert('Manager assigning/updation failed!!!');
}); });
}; };
$scope.cancel = function() { $scope.cancel = function () {
$mdDialog.hide(); $mdDialog.hide();
}; };
$scope.deleteRole = function(row){
$scope.deleteRole = function (row) {
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
var confirm = $mdDialog.confirm() var confirm = $mdDialog.confirm()
.clickOutsideToClose(true) .clickOutsideToClose(true)
.textContent('Are you sure you want to delete this project?') .textContent('Are you sure you want to delete this project?')
.ok('Ok') .ok('Ok')
.cancel('Cancel'); .cancel('Cancel');
$mdDialog.show(confirm).then(function() { $mdDialog.show(confirm).then(function () {
deleteUserRole(row.entity.projectId); deleteUserRole(row.entity.projectId);
$timeout(function(){updateGridAfterDelete(row)},500); $timeout(function () { updateGridAfterDelete(row) }, 500);
}, function() { }, function () {
console.log("Cancelled dialog"); console.log("Cancelled dialog");
}); });
}; };
function deleteUserRole(projectId){ function deleteUserRole(projectId) {
var req = { var req = {
method : 'DELETE', method: 'DELETE',
url : appConfig.appUri+ "project/deleteProject?projectId="+projectId url: appConfig.appUri + "project/deleteProject?projectId=" + projectId
} }
$http(req).then(function mySuccess(response) { $http(req).then(function mySuccess(response) {
$scope.result = response.data; $scope.result = response.data;
console.log($scope.result); console.log($scope.result);
}, function myError(response){ }, function myError(response) {
$scope.result = "Error"; $scope.result = "Error";
}); });
} }
function updateGridAfterDelete(row){ function updateGridAfterDelete(row) {
if($scope.result == "Success" || $scope.result == ""){ if ($scope.result == "Success" || $scope.result == "") {
var index = $scope.gridOptions.data.indexOf(row.entity); var index = $scope.gridOptions.data.indexOf(row.entity);
$scope.gridOptions.data.splice(index, 1); $scope.gridOptions.data.splice(index, 1);
showAlert('Project deleted successfully'); showAlert('Project deleted successfully');
}else if($scope.result == "Error"){ } else if ($scope.result == "Error") {
showAlert('Something went wrong while deleting the role.') showAlert('Something went wrong while deleting the role.')
} }
} }
function AddProjectController($scope, $mdDialog, dataToPass,gridOptionsData, managers, $window, $mdSelect) { function AddProjectController($scope, $mdDialog, dataToPass, gridOptionsData, managers) {
$scope.templateTitle = dataToPass.action; $scope.templateTitle = dataToPass.action;
$scope.alertMsg = ""; $scope.alertMsg = "";
$scope.isDisabled = false; $scope.isDisabled = false;
$scope.result = ""; $scope.result = "";
$scope.managerDetails = managers; $scope.managerDetails = managers;
$scope.employee; $scope.managersSelectedList = [];
$scope.projectModel; $scope.employeeInTeam = [];
$scope.isSecondTab = false; // code added
$scope.prjctStses=["Active","Completed","On Hold","Proposed"];
$scope.billableStatuses = ["Billable","Shadow","Non-Billable","Reserved"];
$scope.accounts=myFactory.getAccounts();
$scope.selectedTab = 0;
$scope.addTab = function () {
if($scope.isSecondTab === false){
$scope.templateTitle = "Add";
document.getElementsByClassName("md-tab")[1].style.visibility = "visible" ;
$scope.isSecondTab = true;
$scope.selectedTab = 1;
}
$scope.searchTerm = "";
$scope.updateSearch = function (e) {
e.stopPropagation();
}
$scope.searchFilter = function (obj) {
var re = new RegExp($scope.searchTerm, 'i');
return !$scope.searchTerm || re.test(obj.employeeName);
}; };
// code added
var removeTab = function (action) { $scope.prjctStses = ["Active", "Completed", "On Hold", "Proposed"];
if(action == "Add"){ $scope.clearSearchTerm = function () {
if($scope.isSecondTab === true){ console.log($scope.managersSelectedList);
$('.md-select-value')[0].childNodes[0].innerHTML = null
$('.md-select-value')[1].childNodes[0].innerHTML = null
$('.md-datepicker-input')[0].value = null;
$('.md-datepicker-input')[1].value = null;
$('.md-datepicker-input')[2].value = null;
$scope.employeeModel = {};
}
// $("#lead .lead-search .md-select-value span .md-text").css({
//  'border': '1px solid #000',
//  'padding': '1px',
// }).append('<span class="glyphicon glyphicon-remove" style="margin-left: 5px;"></span>');
// $(".leads-data").text($("#lead .lead-search .md-select-value span .md-text").text().append('<span class="glyphicon glyphicon-remove" style="margin-left: 5px;"></span>'));
} }
$scope.selectedTab = 0;
document.getElementsByClassName("md-tab")[1].style.visibility = "hidden" ;
$scope.isSecondTab = !$scope.isSecondTab;
$scope.removeSelectedLead = function (item) {
var index = $scope.managersSelectedList.indexOf(item);
$scope.managersSelectedList.splice(index, 1);
}
}; $scope.closeSelectBox = function () {
$window.addEventListener('click',function(e){
$mdSelect.hide(); $mdSelect.hide();
}) }
$scope.getEmployeeDetails = function(){
$http({
method : "GET",
url : appConfig.appUri + "projectTeam/getEmployeesToTeam"
}).then(function mySuccess(response) {
$scope.employeeList =response.data;
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
}); getSelectedLead = function () {
}; $scope.managersSelectedList.forEach(function (manager) {
if (!$scope.employeeInTeam.includes(manager.employeeId))
$scope.employeeInTeam.push(manager.employeeId);
})
return $scope.employeeInTeam;
}
if(dataToPass.action == "Assign"){ $scope.accounts = myFactory.getAccounts();
if (dataToPass.action == "Assign") {
$scope.projectId = ""; $scope.projectId = "";
$scope.projectName = ""; $scope.projectName = "";
$scope.managerId = ""; $scope.managerId = "";
$scope.managerName = ""; $scope.managerName = "";
$scope.isDisabled = false; $scope.isDisabled = false;
}else if(dataToPass.action == "Update"){ } else if (dataToPass.action == "Update") {
$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;
var accounts1=myFactory.getAccounts(); var accounts1 = myFactory.getAccounts();
for (var i = 0; i < accounts1.length; i++) { for (var i = 0; i < accounts1.length; i++) {
if (accounts1[i].accountName=dataToPass.account) { if (accounts1[i].accountName = dataToPass.account) {
$scope.account = accounts1[i]; $scope.account = accounts1[i];
} }
} }
...@@ -336,112 +338,90 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ ...@@ -336,112 +338,90 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
}; };
$scope.managerDetails = managers; $scope.managerDetails = managers;
$scope.isDisabled = true; $scope.isDisabled = true;
} else if (dataToPass.action == "View") {
}
else if(dataToPass.action == "View"){
$scope.projectId = dataToPass.projectId; $scope.projectId = dataToPass.projectId;
$scope.account = dataToPass.account;
$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.projectStatus = dataToPass.status; $scope.projectStatus = dataToPass.status;
$scope.domain = dataToPass.domain; 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>';
$scope.managerModel = {
'employeeName': dataToPass.managerName,
'employeeId': dataToPass.managerId
};
$scope.projectModel = {
'projectName': dataToPass.projectName,
'projectId': dataToPass.projectId
};
var employeeModel = $scope.employeeModel;
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>';
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes: [10, 20, 30, 40, 50, 100],
paginationPageSize : 10, paginationPageSize: 10,
pageNumber: 1, pageNumber: 1,
pageSize:10, pageSize: 10,
columnDefs : [ columnDefs: [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width:100}, { field: 'employeeId', displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width: 100 },
{field : 'employeeName',displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false}, { field: 'employeeName', displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false },
{field : 'emailId',displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false}, { field: 'emailId', displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false },
{field : 'experience',displayName: 'Exp', enableColumnMenu: true, enableSorting: true,width:80}, { field: 'experience', displayName: 'Exp', enableColumnMenu: true, enableSorting: true, width: 80 },
{field : 'designation',displayName: 'Designation ', enableColumnMenu: false, enableSorting: false}, { field: 'designation', displayName: 'Designation ', enableColumnMenu: false, enableSorting: false },
{field : 'active',displayName: 'Status ', enableColumnMenu: false, enableSorting: false,cellTemplate: getCellActiveTemplate}, { field: 'active', displayName: 'Status ', enableColumnMenu: false, enableSorting: false, cellTemplate: getCellActiveTemplate },
{field : 'billableStatus',displayName: 'Billability ', enableColumnMenu: false, enableSorting: false}, { field: 'billableStatus', displayName: 'Billability ', enableColumnMenu: false, enableSorting: false },
] ]
}; };
$scope.isDisabled = true; $scope.isDisabled = true;
$http({ $http({
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) {
$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!!!");
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
}); });
} else if (dataToPass.action == "UnAssigned") {
document.addEventListener("DOMSubtreeModified", function(e) {
if(document.getElementsByClassName("md-tab")[1] && (document.getElementsByClassName("md-tab")[1].style.visibility === "")){
document.getElementsByClassName("md-tab")[1].style.visibility = "hidden" ;
}
}, false);
}else if(dataToPass.action == "UnAssigned"){
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes: [10, 20, 30, 40, 50, 100],
paginationPageSize : 10, paginationPageSize: 10,
pageNumber: 1, pageNumber: 1,
pageSize:10, pageSize: 10,
columnDefs : [ columnDefs: [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width:100}, { field: 'employeeId', displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width: 100 },
{field : 'employeeName',displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false}, { field: 'employeeName', displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false },
{field : 'emailId',displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false}, { field: 'emailId', displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false },
] ]
}; };
$scope.isDisabled = true; $scope.isDisabled = true;
$http({ $http({
method : "GET", method: "GET",
url : appConfig.appUri + "/projectTeam/getUnAssignedEmployees" url: appConfig.appUri + "/projectTeam/getUnAssignedEmployees"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$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!!!");
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
}); });
}else if(dataToPass.action == "allocated"){ } else if (dataToPass.action == "allocated") {
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes: [10, 20, 30, 40, 50, 100],
paginationPageSize : 10, paginationPageSize: 10,
pageNumber: 1, pageNumber: 1,
pageSize:10, pageSize: 10,
columnDefs : [ columnDefs: [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width:100}, { field: 'employeeId', displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width: 100 },
{field : 'employeeName',displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false}, { field: 'employeeName', displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false },
{field : 'emailId',displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false}, { field: 'emailId', displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false },
{field : 'projectName',displayName: 'Project ', enableColumnMenu: false, enableSorting: false}, { field: 'projectName', displayName: 'Project ', enableColumnMenu: false, enableSorting: false },
{field : 'managerName',displayName: 'Manager ', enableColumnMenu: false, enableSorting: false}, { field: 'managerName', displayName: 'Manager ', enableColumnMenu: false, enableSorting: false },
{field : 'experience',displayName: 'Exp', enableColumnMenu: true, enableSorting: true,width:50}, { field: 'experience', displayName: 'Exp', enableColumnMenu: true, enableSorting: true, width: 50 },
{field : 'designation',displayName: 'Designation ', enableColumnMenu: false, enableSorting: false}, { field: 'designation', displayName: 'Designation ', enableColumnMenu: false, enableSorting: false },
{field : 'billableStatus',displayName: 'Billability ', enableColumnMenu: false, enableSorting: false}, { field: 'billableStatus', displayName: 'Billability ', enableColumnMenu: false, enableSorting: false },
], ],
enableGridMenu: true, enableGridMenu: true,
enableSelectAll: true, enableSelectAll: true,
exporterMenuExcel:false, exporterMenuExcel: false,
exporterMenuCsv:false, exporterMenuCsv: false,
exporterCsvFilename: 'Allocated.csv', exporterCsvFilename: 'Allocated.csv',
exporterExcelFilename:'AllocatedResources', exporterExcelFilename: 'AllocatedResources',
exporterPdfDefaultStyle: {fontSize: 9}, exporterPdfDefaultStyle: { fontSize: 9 },
exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, exporterPdfTableStyle: { margin: [30, 30, 30, 30] },
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, exporterPdfTableHeaderStyle: { fontSize: 10, bold: true, italics: true, color: 'red' },
exporterPdfHeader: { text: "Allocated Resources", style: 'headerStyle' }, exporterPdfHeader: { text: "Allocated Resources", style: 'headerStyle' },
exporterPdfFooter: function ( currentPage, pageCount ) { exporterPdfFooter: function (currentPage, pageCount) {
return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' };
}, },
exporterPdfCustomFormatter: function ( docDefinition ) { exporterPdfCustomFormatter: function (docDefinition) {
docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; docDefinition.styles.headerStyle = { fontSize: 22, bold: true };
docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; docDefinition.styles.footerStyle = { fontSize: 10, bold: true };
return docDefinition; return docDefinition;
...@@ -450,7 +430,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ ...@@ -450,7 +430,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
exporterPdfPageSize: 'LETTER', exporterPdfPageSize: 'LETTER',
exporterPdfMaxGridWidth: 500, exporterPdfMaxGridWidth: 500,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){ onRegisterApi: function (gridApi) {
$scope.gridApi = gridApi; $scope.gridApi = gridApi;
}, },
gridMenuCustomItems: [{ gridMenuCustomItems: [{
...@@ -470,10 +450,9 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ ...@@ -470,10 +450,9 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
] ]
}; };
$scope.isDisabled = true; $scope.isDisabled = true;
$http({ $http({
method : "GET", method: "GET",
url : appConfig.appUri + "/projectTeam/getProjectAllocations" url: appConfig.appUri + "/projectTeam/getProjectAllocations"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
}, function myError(response) { }, function myError(response) {
...@@ -481,14 +460,14 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ ...@@ -481,14 +460,14 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
}); });
} }
$scope.getManagers = function(){ $scope.getManagers = function () {
if ($scope.managerModel !== undefined) { if ($scope.managerModel !== undefined) {
return $scope.managerModel.employeeName; return $scope.managerModel.employeeName;
} else { } else {
return "Please select a manager"; return "Please select a manager";
} }
}; };
$scope.getProjectStatus = function(){ $scope.getProjectStatus = function () {
if ($scope.projectStatus !== undefined) { if ($scope.projectStatus !== undefined) {
return $scope.projectStatus; return $scope.projectStatus;
} else { } else {
...@@ -498,280 +477,158 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ ...@@ -498,280 +477,158 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
$scope.getAccountText = function(){ $scope.getAccountText = function () {
if ($scope.account !== undefined) { if ($scope.account !== undefined) {
return $scope.account.accountName; return $scope.account.accountName;
} else { } else {
return "Please select account"; return "Please select account";
} }
}; };
$scope.getDomainText = function(){ $scope.getDomainText = function () {
if ($scope.domain !== undefined) { if ($scope.domain !== undefined) {
return $scope.domain; return $scope.domain;
} else { } else {
return "Please select domain"; return "Please select domain";
} }
}; };
$scope.validateEmpId = function(){ $scope.validateEmpId = function () {
var searchId = $scope.empId; var searchId = $scope.empId;
if(searchId != "" && isNaN(searchId)){ if (searchId != "" && isNaN(searchId)) {
$scope.alertMsg = "Please enter only digits"; $scope.alertMsg = "Please enter only digits";
document.getElementById('empId').focus(); document.getElementById('empId').focus();
}else if(searchId != "" && ((searchId.length >0 && searchId.length <5) || searchId.length>5)){ } else if (searchId != "" && ((searchId.length > 0 && searchId.length < 5) || searchId.length > 5)) {
$scope.alertMsg = "Employee ID should be 5 digits"; $scope.alertMsg = "Employee ID should be 5 digits";
document.getElementById('empId').focus(); document.getElementById('empId').focus();
}else if(searchId != "" && !checkRoleEmpIdRange(searchId)){ } else if (searchId != "" && !checkRoleEmpIdRange(searchId)) {
$scope.alertMsg = 'Employee ID should be in between '+appConfig.empStartId+' - '+appConfig.empEndId; $scope.alertMsg = 'Employee ID should be in between ' + appConfig.empStartId + ' - ' + appConfig.empEndId;
document.getElementById('empId').focus(); document.getElementById('empId').focus();
}else if(searchId != "" && checkRoleExistence(searchId)){ } else if (searchId != "" && checkRoleExistence(searchId)) {
$scope.alertMsg = 'Employee ID is already assigned a role'; $scope.alertMsg = 'Employee ID is already assigned a role';
document.getElementById('empId').focus(); document.getElementById('empId').focus();
}else{ } else {
$scope.alertMsg = ""; $scope.alertMsg = "";
} }
}; };
function checkRoleEmpIdRange(searchId){ function checkRoleEmpIdRange(searchId) {
return parseInt(searchId) >= appConfig.empStartId && parseInt(searchId) <= appConfig.empEndId; return parseInt(searchId) >= appConfig.empStartId && parseInt(searchId) <= appConfig.empEndId;
} }
function checkRoleExistence(searchId){ function checkRoleExistence(searchId) {
for(var i in gridOptionsData){ for (var i in gridOptionsData) {
if(gridOptionsData[i].employeeId == searchId){ if (gridOptionsData[i].employeeId == searchId) {
return true; return true;
} }
} }
return false; return false;
} }
$scope.validateEmailId = function(){ $scope.validateEmailId = function () {
var emailId = $scope.empEmail; var emailId = $scope.empEmail;
if(emailId != "" && !validateEmail(emailId)){ if (emailId != "" && !validateEmail(emailId)) {
$scope.alertMsg = "Please enter a valid nisum email id"; $scope.alertMsg = "Please enter a valid nisum email id";
document.getElementById('empEmail').focus(); document.getElementById('empEmail').focus();
}else{ } else {
$scope.alertMsg = ""; $scope.alertMsg = "";
} }
} }
function validateEmail(emailId){ function validateEmail(emailId) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if(re.test(emailId)){ if (re.test(emailId)) {
if(emailId.indexOf("@nisum.com", emailId.length - "@nisum.com".length) !== -1){ if (emailId.indexOf("@nisum.com", emailId.length - "@nisum.com".length) !== -1) {
return true; return true;
} }
} }
return false; return false;
} }
$scope.getSelected = function () {
$scope.currentBillabilityDateChange = function(){ return null;
$scope.startDate = $scope.newBillingStartDate ;
} }
$scope.validateFields = function () {
$scope.validateFields = function(action){
var project = $scope.projectId; var project = $scope.projectId;
var projectName = $scope.projectName; var projectName = $scope.projectName;
var managerModel = $scope.managerModel; var managerModel = $scope.managerModel;
var account = $scope.account; //          if(project == ""){
var managerId=$scope.managerId; //              $scope.alertMsg = "Project ID is mandatory";
var managerName=$scope.managerName; //              document.getElementById('projectId').focus();
//          }else
var employeeModel = $scope.employeeModel; if (projectName == "") {
var projectModel = $scope.projectModel;
var domain = $scope.domain;
var newBillingStartDate = $scope.newBillingStartDate
if(action === "Add"){
if(employeeModel == undefined){
$scope.alertMsg = "Please select a employee";
angular.element(document.getElementById('selectEmp')).focus();
}
else if($scope.empBillableStatus == undefined){
$scope.alertMsg = "Please select a billable status";
angular.element(document.getElementById('empBillableStatus')).focus();
}else if($scope.startDate == undefined) {
$scope.alertMsg = "Please select Start Date";
angular.element(document.getElementById('startDate')).focus();
}else if($scope.endDate == undefined) {
$scope.alertMsg = "Please select End Date";
angular.element(document.getElementById('endDate')).focus();
}else if($scope.newBillingStartDate == undefined){
$scope.alertMsg = "Please select new Billing StartDate";
angular.element(document.getElementById('newBillingStartDate')).focus();
}
else if($scope.newBillingStartDate > $scope.endDate){
$scope.alertMsg = "Assignment End Date should be less than Current Billability Start Date ";
}
else if(employeeModel != undefined && projectModel != undefined
&& getExistingRecordProjectStatus(employeeModel.employeeId, projectModel.projectName)){
$scope.alertMsg = "Employee is already assigned to the selected project";
return false;
}else {
$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,"newBillingStartDate":newBillingStartDate};
addRecord(record,action);
$timeout(function(){
updateGrid('Add',record);
removeTab('Add');
$mdDialog.show($mdDialog.alert({
skipHide: true,
textContent: 'Employee Added',
ok: 'ok'
}));
},500);
}
}
else{
// if(project == ""){
// $scope.alertMsg = "Project ID is mandatory";
// document.getElementById('projectId').focus();
// }else
if(projectName == ""){
$scope.alertMsg = "Project Name is mandatory"; $scope.alertMsg = "Project Name is mandatory";
document.getElementById('projectName').focus(); document.getElementById('projectName').focus();
}else if(account == undefined || account == ""){ } else if (account == undefined || account == "") {
$scope.alertMsg = "Account is mandatory"; $scope.alertMsg = "Account is mandatory";
document.getElementById('account').focus(); document.getElementById('account').focus();
}else if(domain == undefined || domain == ""){ } else if (domain == undefined || domain == "") {
$scope.alertMsg = "Domain is mandatory"; $scope.alertMsg = "Domain is mandatory";
document.getElementById('domain').focus(); document.getElementById('domain').focus();
} }
else if(managerModel == undefined){ // else if(managerModel == undefined){
$scope.alertMsg = "Please select a manager"; //  $scope.alertMsg = "Please select a Lead";
} // }
else{ else {
$scope.alertMsg = ""; $scope.alertMsg = "";
var record = {"projectId":$scope.projectId, "projectName": $scope.projectName, "managerId": $scope.managerModel.employeeId, "managerName": $scope.managerModel.employeeName, "status": $scope.projectStatus,"account": $scope.account.accountName,"domain": $scope.domain}; console.log(getSelectedLead());
var record = { "projectId": $scope.projectId, "projectName": $scope.projectName, "managerIds": getSelectedLead(), "status": $scope.projectStatus, "account": $scope.account.accountName, "domain": $scope.domain };
addOrUpdateProject(record, $scope.templateTitle); addOrUpdateProject(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500); $timeout(function () { updateGrid($scope.templateTitle, record) }, 500);
} }
}
};
$scope.cancelDialog = function() {
$mdDialog.hide('Cancelled');
}; };
$scope.cancelTab = function() { $scope.cancel = function () {
removeTab("cancel");
};
$scope.cancel = function() {
$mdDialog.hide('Cancelled'); $mdDialog.hide('Cancelled');
}; };
$scope.getEmployeeSelected = function(){
if ($scope.employeeModel !== undefined) { function updateGrid(action, record) {
$scope.employee=$scope.employeeModel; if ($scope.alertMsg == "") {
return $scope.employeeModel.employeeName; if ($scope.result == "Success") {
} else { if (action == "Assign") {
return "Please select a employee";
}
};
// $scope.getProjectSelected = function(){
// if ($scope.projectModel !== undefined) {
// $scope.project=$scope.projectModel;
// return $scope.projectModel.projectName;
// } else {
// return "Please select a project";
// }
// };
$scope.getSelectedBillableStatus = function(){
if ($scope.empBillableStatus !== undefined) {
return $scope.empBillableStatus;
} else {
return "Please select a billable status";
}
};
function updateGrid(action, record){
if($scope.alertMsg == ""){
if($scope.result == "Success"){
if(action == "Assign"){
gridOptionsData.push(record); gridOptionsData.push(record);
$mdDialog.hide(action); } else if (action == "Update") {
}else if(action == "Update"){
var existingRecord = getRowEntity($scope.projectId); var existingRecord = getRowEntity($scope.projectId);
var index = gridOptionsData.indexOf(existingRecord); var index = gridOptionsData.indexOf(existingRecord);
gridOptionsData[index] = record; gridOptionsData[index] = record;
$mdDialog.hide(action);
}
else if(action == "Add"){
$scope.gridOptions.data.push(record);
} }
// $mdDialog.hide(action); $mdDialog.hide(action);
}else{ } else {
$mdDialog.hide("Error"); $mdDialog.hide("Error");
} }
} }
} }
function addRecord(record, action){
var urlRequest = "";
urlRequest = appConfig.appUri+ "projectTeam/addEmployeeToTeam";
var req = {
method : 'POST',
url : urlRequest,
headers : {
"Content-type" : "application/json"
},
data : record
}
$http(req).then(function mySuccess(response) {
$scope.result = "Success";
$scope.objectId = response.data.id;
}, function myError(response){
$scope.result = "Error";
});
}
function addOrUpdateProject(record, action){ function addOrUpdateProject(record, action) {
var urlRequest = ""; var urlRequest = "";
if(action == "Assign"){ if (action == "Assign") {
urlRequest = appConfig.appUri+ "project/addProject"; urlRequest = appConfig.appUri + "project/addProject";
}else if(action == "Update"){ } else if (action == "Update") {
urlRequest = appConfig.appUri+ "project/updateProject"; urlRequest = appConfig.appUri + "project/updateProject";
} }
var req = { var req = {
method : 'POST', method: 'POST',
url : urlRequest, url: urlRequest,
headers : { headers: {
"Content-type" : "application/json" "Content-type": "application/json"
}, },
data : record data: record
} }
$http(req).then(function mySuccess(response) { $http(req).then(function mySuccess(response) {
$scope.result = "Success"; $scope.result = "Success";
}, function myError(response){ }, function myError(response) {
$scope.result = "Error"; $scope.result = "Error";
}); });
} }
function getRowEntity(empId){ function getRowEntity(empId) {
for(var i=0;i<gridOptionsData.length;i++){ for (var i = 0; i < gridOptionsData.length; i++) {
var record = gridOptionsData[i]; var record = gridOptionsData[i];
if(record.projectId == empId){ if (record.projectId == empId) {
return record; return record;
} }
} }
} }
function getExistingRecordProjectStatus(empId, projectName){
for(var i=0;i<$scope.gridOptions.data.length;i++){
var record = $scope.gridOptions.data[i];
if(record.employeeId == empId){
if(record.active == true && record.projectName == projectName)
return true;
}
}
return false;
}
} }
}); });
#header { #header {
width: 100%;     width: 100%;
height: 8%;     height: 8%;
background-color: darkslategray;     background-color: darkslategray;
} }
#sidebar-left { #sidebar-left {
float: left;     float: left;
width: 20%;     width: 20%;
height: 87.5%;     height: 87.5%;
} }
#main { #main {
float: left;     float: left;
width: 80%;     width: 80%;
height: 87.5%;     height: 87.5%;
background-color: floralwhite;     background-color: floralwhite;
margin-left:-7px;     margin-left:-7px;
} }
#footer { #footer {
height: 8%;     height: 8%;
width: 100%;     width: 100%;
} }
.myGrid { .myGrid {
width:98.5%;     width:98.5%;
height: 300px;     height: 300px;
margin-left:5px;     margin-left:5px;
} }
#gridTest,#gridTest1 .ui-grid-cell-contents{ #gridTest,#gridTest1 .ui-grid-cell-contents{
text-align:center;     text-align:center;
} }
.watermark { .watermark {
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
...@@ -38,50 +38,50 @@ ...@@ -38,50 +38,50 @@
width: 100%; width: 100%;
text-align: center; text-align: center;
z-index: 1000; z-index: 1000;
} }
.md-button { .md-button {
text-transform: capitalize !important; text-transform: capitalize !important;
} }
.carousel-indicators li{ .carousel-indicators li{
background-color:orange;     background-color:orange;
border-color:#ff9200;     border-color:#ff9200;
} }
.carousel-indicators .active{ .carousel-indicators .active{
background-color:orange;     background-color:orange;
border-color:#ff9200;     border-color:#ff9200;
} }
md-dialog{ md-dialog{
margin-left: 15%;     margin-left: 15%;
} }
.navbar-inverse { .navbar-inverse {
background-color: darkslategray; background-color: darkslategray;
border-color: darkslategray; border-color: darkslategray;
color:#fff; color:#fff;
} }
.navbar-inverse .navbar-nav>.dropdown>a .caret { .navbar-inverse .navbar-nav>.dropdown>a .caret {
border-top-color: #fff; border-top-color: #fff;
border-bottom-color: #fff; border-bottom-color: #fff;
} }
.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {
color: #fff; color: #fff;
background-color: darkslategray; background-color: darkslategray;
} }
.mainDivHeaderClass{ .mainDivHeaderClass{
text-align: center;     text-align: center;
background: cadetblue; background: cadetblue;
color: floralwhite; color: floralwhite;
border-radius: 5px; border-radius: 5px;
} }
.dropdown-menu { .dropdown-menu {
position: absolute; position: absolute;
top: 100%; top: 100%;
left: 0; left: 0;
...@@ -99,59 +99,77 @@ md-dialog{ ...@@ -99,59 +99,77 @@ md-dialog{
-webkit-box-shadow: 0 6px 6px rgba(0,0,0,0.175); -webkit-box-shadow: 0 6px 6px rgba(0,0,0,0.175);
box-shadow: 0 6px 6px rgba(0,0,0,0.175); box-shadow: 0 6px 6px rgba(0,0,0,0.175);
background-clip: padding-box; background-clip: padding-box;
} }
.autoComplete-dropdown{ .autoComplete-dropdown{
font: inherit;     font: inherit;
border-color: #ececec;     border-color: #ececec;
border-width: 1px;     border-width: 1px;
width: 206px;     width: 206px;
cursor: pointer;     cursor: pointer;
position: absolute;     position: absolute;
z-index: 9999;     z-index: 9999;
top: 35px;     top: 35px;
overflow-y: auto;     overflow-y: auto;
max-height: 206px;     max-height: 206px;
} }
.selectHeader { .selectHeader {
Please note: All these selectors are only applied to children of elements with the 'selectdemoSelectHeader' class Please note: All these selectors are only applied to children of elements with the 'selectdemoSelectHeader' class
} }
.selectHeader .searchBoxHeader { .selectHeader .searchBoxHeader {
border: none; border: none;
outline: none; outline: none;
} }
.selectHeader .selectHeaderChild { .selectHeader .selectHeaderChild {
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.14), 0 0 0 0 rgba(0, 0, 0, 0.12);      box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.14), 0 0 0 0 rgba(0, 0, 0, 0.12);
padding-left: 10.667px;      padding-left: 10.667px;
height: 48px;      height: 48px;
cursor: pointer;      cursor: pointer;
position: relative;      position: relative;
display: flex;      display: flex;
width: auto;      width: auto;
position: fixed;      position: fixed;
z-index: 10;      z-index: 10;
background: white;      background: white;
width: 100%;      width: 100%;
} }
.optionScroll{ .optionScroll{
margin-top:50px;     margin-top:50px;
} }
.selectHeader .md-content._md { .selectHeader .md-content._md {
max-height: 240px;     max-height: 240px;
}      }
.md-dialog-container { .md-dialog-container {
z-index: 100 !important;     z-index: 100 !important;
} }   
.md-select-menu-container { .md-select-menu-container {
z-index: 100 !important;     z-index: 100 !important;
} }
/* Styles added*/
.selectdemoSelectHeader {
.md-dialog-custom-height {     /* Please note: All these selectors are only applied to children of elements with the 'selectdemoSelectHeader' class */ }
max-height: 95% !important;     .selectdemoSelectHeader .demo-header-searchbox {
}      border: none;
     outline: none;
     height: 100%;
     width: 100%;
     padding: 0; }
    .selectdemoSelectHeader .demo-select-header {
     box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.14), 0 0 0 0 rgba(0, 0, 0, 0.12);
     padding-left: 10.667px;
     height: 48px;
     cursor: pointer;
     position: relative;
     display: flex;
     align-items: center;
     width: auto; }
    .selectdemoSelectHeader md-content._md {
     max-height: 240px; }
    .leads-data{border: 1px solid #ccc; padding: 5px 10px; float: left; width: 100%;}
    .leads-data p{float: left; width: auto; background: #ccc; margin-right: 5px; padding: 2px 2px;}
    .close-mdselect{right: 9px; position: absolute; top: 17px;}
    .search-spacingleft{height: 48px !important; padding-left: 5px;}
    .header-spacing{padding-left: 0px !important;}
/* Styles added*/
\ No newline at end of file
.md-content{
height: 1100px !important;
}
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-animate.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-animate.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-sanitize.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-sanitize.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.9/angular-material.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-aria.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-aria.min.js"></script>
<script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-2.5.0.js"></script> <script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-2.5.0.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script> <script src="https://code.highcharts.com/highcharts.js"></script>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<script src="https://code.highcharts.com/modules/exporting.js"></script> <script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script> <script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script> <script src="https://code.highcharts.com/modules/data.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.9/angular-material.min.css"></link> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css"></link>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"></link> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"></link>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"></link> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"></link>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.min.css" rel="stylesheet"> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.min.css" rel="stylesheet">
......
<md-dialog aria-label="Role Template" style="width:520px;height:450px;"> <md-dialog aria-label="Role Template" style="width:520px;height:450px;">
<form ng-cloak name="myForm">
<form ng-cloak name="myForm">
<md-toolbar> <md-toolbar>
<div class="md-toolbar-tools"
style="background: cadetblue;"> <div class="md-toolbar-tools" style="background: cadetblue;">
<h2>{{templateTitle}} Project</h2> <h2>{{templateTitle}} Project</h2>
<span flex></span> <span flex></span>
<md-button class="md-icon-button" ng-click="cancel()"> <i
class="fa fa-times fa-2x" <md-button class="md-icon-button" ng-click="cancel()">
style="margin-top: 5px; font-size: 1.5em; float: left"></i> </md-button>
<i class="fa fa-times fa-2x" style="margin-top: 5px; font-size: 1.5em; float: left"></i>
</md-button>
</div> </div>
</md-toolbar> </md-toolbar>
<md-dialog-content> <md-dialog-content>
<div class="md-dialog-content"> <div class="md-dialog-content">
<div class="form-group"> <div class="form-group">
<div class="row" >
<div class="row">
<table width="450px"> <table width="450px">
<tr> <tr>
<td colspan="4"> <td colspan="4">
<b >Project ID</b></td>
<td colspan="8"><input type="text" class="form-control" id="projectId" name="projectId" <b>Project ID</b>
ng-model="projectId" placeholder="Project Id Auto Generates" ng-blur="" ng-disabled="true"/> </td>
<td colspan="8">
<input type="text" class="form-control" id="projectId" name="projectId" ng-model="projectId" placeholder="Project Id Auto Generates"
                                     ng-blur="" ng-disabled="true" />
</td> </td>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<b >Project Name</b></td>
<td colspan="8"><input type="text" class="form-control" id="projectName" name="projectName" <b>Project Name</b>
ng-model="projectName" placeholder="Project Name"/> </td>
<td colspan="8">
<input type="text" class="form-control" id="projectName" name="projectName" ng-model="projectName" placeholder="Project Name"
                                        />
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<b >Account</b></td>
<td colspan="8"><md-select ng-model="account" md-selected-text="getAccountText()" id="account"> <b>Account</b>
<md-optgroup label="account"> <md-option ng-value="account1" </td>
ng-repeat="account1 in accounts">{{account1.accountName}}</md-option> </md-optgroup> </md-select>
<td colspan="8">
<md-select ng-model="account" md-selected-text="getAccountText()" id="account">
<md-optgroup label="account">
<md-option ng-value="account1" ng-repeat="account1 in accounts">{{account1.accountName}}</md-option>
</md-optgroup>
</md-select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<b >Domain</b></td>
<td colspan="8"><md-select ng-model="domain" md-selected-text="getDomainText()" id="domain"> <b>Domain</b>
<md-optgroup label="domain"> <md-option ng-value="domain" </td>
ng-repeat="domain in account.subDomains">{{domain}}</md-option> </md-optgroup> </md-select>
<td colspan="8">
<md-select ng-model="domain" md-selected-text="getDomainText()" id="domain">
<md-optgroup label="domain">
<md-option ng-value="domain" ng-repeat="domain in account.subDomains">{{domain}}</md-option>
</md-optgroup>
</md-select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<b >Manager</b></td>
<td colspan="8"><md-select ng-model="managerModel" md-selected-text="getManagers()" > <b>Lead</b>
<md-optgroup label="managers"> <md-option ng-value="manager" </td>
ng-repeat="manager in managerDetails">{{manager.employeeName}}</md-option> </md-optgroup> </md-select>
<!-- <td colspan="8"><md-select ng-model="managerModel" md-selected-text="getManagers()" >
                                    <md-optgroup label="managers"> <md-option<< ng-value="manager"
                ng-repeat="manager in managerDetails">{{manager.employeeName}}</md-option> </md-optgroup> </md-select>
                                    </td> -->
<td id="lead">
<div class="leads-data" ng-show="managersSelectedList.length > 0">
<div ng-repeat="item in managersSelectedList">
<p> {{item.employeeName}}
<span ng-click="removeSelectedLead(item)" class="glyphicon glyphicon-remove"></span>
</p>
</div>
</div>
<md-input-container style="display: block; float: left; width: 100%;">
<label>Lead</label>
<md-select class="lead-search" ng-model="managersSelectedList" data-md-container-class="selectHeader" md-selected-text="getSelected()"
multiple>
<md-select-header class="selectHeaderChild header-spacing" layout="column">
<input ng-model="searchTerm" type="search" ng-keydown="updateSearch($event)" ng-model-options="{debounce: {'default': 500, 'blur': 0}}" placeholder="Please Search for a lead" class="demo-header-searchbox md-text search-spacingleft" />
<span class="glyphicon glyphicon-remove close-mdselect" ng-click="closeSelectBox()"></span>
</md-select-header>
<md-optgroup label="managers" class="optionScroll">
<md-option ng-value="manager" ng-repeat="manager in managerDetails | filter:searchTerm">{{manager.employeeName}}</md-option>
</md-optgroup>
</md-select>
</md-input-container>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<b >Project Status</b></td>
<td colspan="8"><md-select ng-model="projectStatus" md-selected-text="getProjectStatus()" id="projectStatus"> <b>Project Status</b>
<md-optgroup label="projectStatus"> <md-option ng-value="prjctSts" </td>
ng-repeat="prjctSts in prjctStses">{{prjctSts}}</md-option> </md-optgroup> </md-select>
<td colspan="8">
<md-select ng-model="projectStatus" md-selected-text="getProjectStatus()" id="projectStatus">
<md-optgroup label="projectStatus">
<md-option ng-value="prjctSts" ng-repeat="prjctSts in prjctStses">{{prjctSts}}</md-option>
</md-optgroup>
</md-select>
</td> </td>
</tr> </tr>
</table> </table>
<div role="alert"> <div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span> <span class="error" style="color: red;">{{alertMsg}}</span>
</div> </div>
</div> </div>
...@@ -71,9 +170,14 @@ ...@@ -71,9 +170,14 @@
</div> </div>
</md-dialog-content> </md-dialog-content>
<md-dialog-actions layout="row"> <md-button
class="md-raised" data-ng-click="validateFields()" style="width:120px;background: cadetblue;color:white;"> <md-dialog-actions layout="row">
{{templateTitle}} </md-button> <md-button class="md-raised" ng-click="cancel()" style="width:120px;background: cadetblue;color:white;">
Cancel </md-button> </md-dialog-actions> <md-button class="md-raised" data-ng-click="validateFields()" style="width:120px;background: cadetblue;color:white;">
</form> {{templateTitle}} </md-button>
<md-button class="md-raised" ng-click="cancel()" style="width:120px;background: cadetblue;color:white;">
Cancel </md-button>
</md-dialog-actions>
</form>
</md-dialog> </md-dialog>
\ No newline at end of file
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