Commit c2e2d5e8 authored by Prayas Jain's avatar Prayas Jain

Refactored Project

parent 9105ea95
...@@ -58,7 +58,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -58,7 +58,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
$scope.gridOptions.enablePaginationControls = false; $scope.gridOptions.enablePaginationControls = false;
} }
$scope.gridOptions.data=response.data.records; $scope.gridOptions.data=response.data.records;
myFactory.setAccounts(response.data); myFactory.setAccounts(response.data.records);
for(i=0;i<response.data.length;i++){ for(i=0;i<response.data.length;i++){
if(response.data[i].status == 'Y'){ if(response.data[i].status == 'Y'){
$scope.gridOptions.data[i].status = "Active"; $scope.gridOptions.data[i].status = "Active";
......
...@@ -90,7 +90,9 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -90,7 +90,9 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
method : "GET", method : "GET",
url : appConfig.appUri + "accounts" url : appConfig.appUri + "accounts"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
myFactory.setAccounts(response.data.records); console.log( response.data.records);
var accounts = response.data.records;
myFactory.setAccounts(accounts);
}, function myError(response) { }, function myError(response) {
......
...@@ -99,10 +99,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -99,10 +99,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.getProjects = function () { $scope.getProjects = function () {
var role = myFactory.getEmpRole(); var role = myFactory.getEmpRole();
var empId = myFactory.getEmpId(); var empId = myFactory.getEmpId();
var deliveryLeadEmpId = ((role == "Delivery Lead") ? empId : undefined); //var deliveryLeadEmpId = ((role == "Delivery Lead") ? empId : undefined);
$http({ $http({
method: "GET", method: "GET",
url: appConfig.appUri + "projects/?empId="+deliveryLeadEmpId url: appConfig.appUri + "projects/employeeId/"+empId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.length > 10){ if(response.data.length > 10){
$scope.gridOptions.enablePaginationControls = true; $scope.gridOptions.enablePaginationControls = true;
...@@ -110,7 +110,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -110,7 +110,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
else{ else{
$scope.gridOptions.enablePaginationControls = false; $scope.gridOptions.enablePaginationControls = false;
} }
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data.records;
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
...@@ -276,7 +276,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -276,7 +276,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function deleteUserRole(projectId) { function deleteUserRole(projectId) {
var req = { var req = {
method: 'DELETE', method: 'DELETE',
url: appConfig.appUri + "deleteProject?projectId=" + projectId url: appConfig.appUri + "projects/" + projectId
} }
$http(req).then(function mySuccess(response) { $http(req).then(function mySuccess(response) {
$scope.result = response.data; $scope.result = response.data;
...@@ -289,7 +289,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -289,7 +289,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function deleteTeam(record){ function deleteTeam(record){
var urlRequest = ""; var urlRequest = "";
var loginEmpId = myFactory.getEmpId(); var loginEmpId = myFactory.getEmpId();
urlRequest = appConfig.appUri+ "projectTeam/resources?loginEmpId="+loginEmpId; urlRequest = appConfig.appUri+ "resources?loginEmpId="+loginEmpId;
var req = { var req = {
method : 'POST', method : 'POST',
url : urlRequest, url : urlRequest,
...@@ -553,7 +553,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -553,7 +553,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
} }
$http({ $http({
method: "GET", method: "GET",
url: appConfig.appUri + "projectTeam/resources/project/"+ $scope.projectId + "?status=" + $scope.status url: appConfig.appUri + "resources/project/"+ $scope.projectId + "?status=" + $scope.status
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.length > 10){ if(response.data.length > 10){
$scope.gridOptions.enablePaginationControls = true; $scope.gridOptions.enablePaginationControls = true;
...@@ -750,7 +750,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -750,7 +750,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.isDisabled = true; $scope.isDisabled = true;
$http({ $http({
method: "GET", method: "GET",
url: appConfig.appUri + "projectTeam/getUnAssignedEmployees" url: appConfig.appUri + "resources/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) {
...@@ -821,7 +821,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -821,7 +821,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.isDisabled = true; $scope.isDisabled = true;
$http({ $http({
method: "GET", method: "GET",
url: appConfig.appUri + "projectTeam/resources/projects/" url: appConfig.appUri + "resources/projects"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
}, function myError(response) { }, function myError(response) {
...@@ -1437,7 +1437,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1437,7 +1437,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function addRecord(record, action){ function addRecord(record, action){
var urlRequest = ""; var urlRequest = "";
var loginEmpId = myFactory.getEmpId(); var loginEmpId = myFactory.getEmpId();
urlRequest = appConfig.appUri+ "projectTeam/addEmployeeToTeamWithCheck?loginEmpId="+loginEmpId; urlRequest = appConfig.appUri+ "addEmployeeToTeamWithCheck?loginEmpId="+loginEmpId;
var req = { var req = {
method : 'POST', method : 'POST',
url : urlRequest, url : urlRequest,
...@@ -1471,7 +1471,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1471,7 +1471,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function getProjectDetails(projectId,status){ function getProjectDetails(projectId,status){
$http({ $http({
method: "GET", method: "GET",
url: appConfig.appUri + "projectTeam/resources/project/"+ $scope.projectId + "?status=" + $scope.status url: appConfig.appUri + "resources/project/"+ $scope.projectId + "?status=" + $scope.status
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
if(status == "InActive" || status == "Both"|| dataToPass.status == "InActive"){ if(status == "InActive" || status == "Both"|| dataToPass.status == "InActive"){
...@@ -1495,7 +1495,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1495,7 +1495,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function updateTeamRecord(record, action){ function updateTeamRecord(record, action){
var urlRequest = ""; var urlRequest = "";
var loginEmpId = myFactory.getEmpId(); var loginEmpId = myFactory.getEmpId();
urlRequest = appConfig.appUri+ "projectTeam/resources?loginEmpId="+loginEmpId; urlRequest = appConfig.appUri+ "resources?loginEmpId="+loginEmpId;
var req = { var req = {
method : 'PUT', method : 'PUT',
url : urlRequest, url : urlRequest,
...@@ -1505,6 +1505,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1505,6 +1505,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
data : record data : record
} }
$http(req).then(function mySuccess(response) { $http(req).then(function mySuccess(response) {
console.log("Hi I am Here");
$scope.result = "Success"; $scope.result = "Success";
if(response.data == "TeamMate updated successfuly" || response.data.includes("Resource Successfully moved from") ){ if(response.data == "TeamMate updated successfuly" || response.data.includes("Resource Successfully moved from") ){
$timeout(function () { $timeout(function () {
...@@ -1532,10 +1533,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1532,10 +1533,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
var requestMethod = ""; var requestMethod = "";
var loginEmpId = myFactory.getEmpId(); var loginEmpId = myFactory.getEmpId();
if (action == "Assign") { if (action == "Assign") {
urlRequest = appConfig.appUri + "/projects?loginEmpId="+loginEmpId; urlRequest = appConfig.appUri + "projects?loginEmpId="+loginEmpId;
requestMethod = 'POST'; requestMethod = 'POST';
} else if (action == "Update") { } else if (action == "Update") {
urlRequest = appConfig.appUri + "/projects?loginEmpId="+loginEmpId; urlRequest = appConfig.appUri + "projects/"+record.projectId+"?loginEmpId="+loginEmpId;
requestMethod = 'PUT'; requestMethod = 'PUT';
} }
var req = { var req = {
......
...@@ -51,7 +51,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -51,7 +51,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.getProjects = function(){ $scope.getProjects = function(){
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "project/getProjects" url : appConfig.appUri + "projects/employeeId/"+myFactory.getEmpId()
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
}, function myError(response) { }, function myError(response) {
...@@ -62,7 +62,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -62,7 +62,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.getManagerDetails = function(){ $scope.getManagerDetails = function(){
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "employees/managers/" url : appConfig.appUri + "employees/managers"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.managers=response.data; $scope.managers=response.data;
}, function myError(response) { }, function myError(response) {
...@@ -292,7 +292,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -292,7 +292,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.isDisabled = true; $scope.isDisabled = true;
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "projectTeam/resources/project/"+$scope.projectId url : appConfig.appUri + "resources/project/"+$scope.projectId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
//$scope.teamdetails=response.data; //$scope.teamdetails=response.data;
//$scope.gridOptions.data.push(response.data); //$scope.gridOptions.data.push(response.data);
...@@ -327,7 +327,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -327,7 +327,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.isDisabled = true; $scope.isDisabled = true;
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "projectTeam/getUnAssignedEmployees" url : appConfig.appUri + "getUnAssignedEmployees"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
//$scope.teamdetails=response.data; //$scope.teamdetails=response.data;
//$scope.gridOptions.data.push(response.data); //$scope.gridOptions.data.push(response.data);
...@@ -402,7 +402,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -402,7 +402,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.isDisabled = true; $scope.isDisabled = true;
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "projectTeam/resources/projects/" url : appConfig.appUri + "resources/projects"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
//$scope.teamdetails=response.data; //$scope.teamdetails=response.data;
//$scope.gridOptions.data.push(response.data); //$scope.gridOptions.data.push(response.data);
......
...@@ -484,4 +484,10 @@ i.fa.fa-refresh:hover { ...@@ -484,4 +484,10 @@ i.fa.fa-refresh:hover {
} */ } */
md-toolbar._md-toolbar-transitions { md-toolbar._md-toolbar-transitions {
min-height: 50px !important; min-height: 50px !important;
}
.mandatory:after {
content: " *";
color: red;
font-size: 15px;
} }
\ 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