Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
f7e0f931
Commit
f7e0f931
authored
Aug 28, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Regex for project name and fixed project updation issue
parent
7f66a623
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
75 additions
and
24 deletions
+75
-24
ProjectController.java
...n/java/com/nisum/myteam/controller/ProjectController.java
+23
-12
ReportsController.java
...n/java/com/nisum/myteam/controller/ReportsController.java
+9
-0
IReportService.java
src/main/java/com/nisum/myteam/service/IReportService.java
+2
-0
ReportService.java
...ain/java/com/nisum/myteam/service/impl/ReportService.java
+9
-1
application.properties
src/main/resources/application.properties
+1
-1
ChartsController.js
src/main/webapp/WEB-INF/controllers/ChartsController.js
+24
-1
OpenPoolController.js
src/main/webapp/WEB-INF/controllers/OpenPoolController.js
+1
-1
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+3
-3
newProject.html
src/main/webapp/WEB-INF/templates/newProject.html
+3
-5
No files found.
src/main/java/com/nisum/myteam/controller/ProjectController.java
View file @
f7e0f931
...
@@ -79,21 +79,32 @@ public class ProjectController {
...
@@ -79,21 +79,32 @@ public class ProjectController {
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
if
(
projectService
.
isProjectExistsById
(
projectId
))
{
if
(
projectService
.
isProjectExistsById
(
projectId
))
{
if
(
projectService
.
isProjectExistsByName
(
project
.
getProjectName
()))
{
Project
existedProject
=
projectService
.
getProjectByProjectId
(
projectId
);
if
(!
existedProject
.
getProjectName
().
equalsIgnoreCase
(
project
.
getProjectName
()))
{
if
(!
projectService
.
isProjectExistsByName
(
project
.
getProjectName
()))
{
Project
updatedProject
=
projectService
.
updateProject
(
project
,
loginEmpId
);
Project
updatedProject
=
projectService
.
updateProject
(
project
,
loginEmpId
);
ResponseDetails
getRespDetails
=
new
ResponseDetails
(
new
Date
(),
ProjectStatus
.
UPDATE
.
getCode
(),
ResponseDetails
getRespDetails
=
new
ResponseDetails
(
new
Date
(),
ProjectStatus
.
UPDATE
.
getCode
(),
ProjectStatus
.
UPDATE
.
getMessage
(),
"Project Updation Description"
,
null
,
ProjectStatus
.
UPDATE
.
getMessage
(),
"Project Updation Description"
,
null
,
request
.
getRequestURI
(),
"Project Updation details"
,
updatedProject
);
request
.
getRequestURI
(),
"Project Updation details"
,
updatedProject
);
return
new
ResponseEntity
<
ResponseDetails
>(
getRespDetails
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<
ResponseDetails
>(
getRespDetails
,
HttpStatus
.
OK
);
}
else
{
}
ResponseDetails
getRespDetails
=
new
ResponseDetails
(
new
Date
(),
ProjectStatus
.
PROJECT_NAME_IS_NOT_EXISTS
.
getCode
(),
ResponseDetails
getRespDetails
=
new
ResponseDetails
(
new
Date
(),
ProjectStatus
.
PROJECT_NAME_IS_NOT_EXISTS
.
getCode
(),
ProjectStatus
.
PROJECT_NAME_IS_NOT_EXISTS
.
getMessage
(),
"Please provide the valid project name"
,
null
,
ProjectStatus
.
PROJECT_NAME_IS_NOT_EXISTS
.
getMessage
(),
"Please provide the valid project name"
,
null
,
request
.
getRequestURI
(),
"details"
,
project
);
request
.
getRequestURI
(),
"details"
,
project
);
return
new
ResponseEntity
<
ResponseDetails
>(
getRespDetails
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<
ResponseDetails
>(
getRespDetails
,
HttpStatus
.
OK
);
}
}
}
else
{
Project
updatedProject
=
projectService
.
updateProject
(
project
,
loginEmpId
);
ResponseDetails
getRespDetails
=
new
ResponseDetails
(
new
Date
(),
ProjectStatus
.
UPDATE
.
getCode
(),
ProjectStatus
.
UPDATE
.
getMessage
(),
"Project Updation Description"
,
null
,
request
.
getRequestURI
(),
"Project Updation details"
,
updatedProject
);
return
new
ResponseEntity
<
ResponseDetails
>(
getRespDetails
,
HttpStatus
.
OK
);
}
}
ResponseDetails
getRespDetails
=
new
ResponseDetails
(
new
Date
(),
ProjectStatus
.
PROJECTID_IS_NOT_EXISTS
.
getCode
(),
ResponseDetails
getRespDetails
=
new
ResponseDetails
(
new
Date
(),
ProjectStatus
.
PROJECTID_IS_NOT_EXISTS
.
getCode
(),
ProjectStatus
.
PROJECTID_IS_NOT_EXISTS
.
getMessage
(),
"Please provide the valid project Id"
,
null
,
ProjectStatus
.
PROJECTID_IS_NOT_EXISTS
.
getMessage
(),
"Please provide the valid project Id"
,
null
,
request
.
getRequestURI
(),
"details"
,
project
);
request
.
getRequestURI
(),
"details"
,
project
);
...
...
src/main/java/com/nisum/myteam/controller/ReportsController.java
View file @
f7e0f931
...
@@ -274,6 +274,15 @@ public class ReportsController {
...
@@ -274,6 +274,15 @@ public class ReportsController {
return
new
ResponseEntity
<>(
empList
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
empList
,
HttpStatus
.
OK
);
}
}
@RequestMapping
(
value
=
"/fetchEmployeeDetailsByFGAccountAndBillability"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
Reports
>>
getEmployeesByFGAccountAndBillability
(
@RequestParam
(
"fGroup"
)
String
fGroup
,
@RequestParam
(
"billableStatus"
)
String
billableStatus
,
@RequestParam
(
"acccount"
)
String
account
)
throws
MyTeamException
{
List
<
Reports
>
empList
=
null
;
empList
=
reportService
.
getEmployeeDetailsByFGAccountAndBillability
(
fGroup
,
billableStatus
,
account
);
return
new
ResponseEntity
<>(
empList
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/getBarChartReport"
,
@RequestMapping
(
value
=
"/getBarChartReport"
,
...
...
src/main/java/com/nisum/myteam/service/IReportService.java
View file @
f7e0f931
...
@@ -17,5 +17,7 @@ public interface IReportService {
...
@@ -17,5 +17,7 @@ public interface IReportService {
public
List
<
Reports
>
getEmployeeDetailsByAccountBillability
(
String
account
,
String
billabilityStatus
)
throws
MyTeamException
;
public
List
<
Reports
>
getEmployeeDetailsByAccountBillability
(
String
account
,
String
billabilityStatus
)
throws
MyTeamException
;
public
Project
getProjectById
(
String
employeeId
);
public
Project
getProjectById
(
String
employeeId
);
public
List
<
Reports
>
getEmployeeDetailsByFGAccountAndBillability
(
String
fGroup
,
String
billableStatus
,
String
account
);
}
}
\ No newline at end of file
src/main/java/com/nisum/myteam/service/impl/ReportService.java
View file @
f7e0f931
...
@@ -126,7 +126,7 @@ public class ReportService implements IReportService {
...
@@ -126,7 +126,7 @@ public class ReportService implements IReportService {
List
<
Employee
>
employeeList
=
new
ArrayList
<>();
List
<
Employee
>
employeeList
=
new
ArrayList
<>();
List
<
Project
>
projects
=
projectService
.
getProjectsByAccountId
(
accountService
.
getAccountByName
(
accountName
).
getAccountId
());
List
<
Project
>
projects
=
projectService
.
getProjectsByAccountId
(
accountService
.
getAccountByName
(
accountName
).
getAccountId
());
projects
.
stream
().
forEach
(
p
->
{
projects
.
stream
().
forEach
(
p
->
{
resourceService
.
getResourceByProjectId
(
p
.
getProjectId
()).
stream
().
filter
(
r
->
r
.
getBillingEndDate
().
after
(
new
Date
()
)).
resourceService
.
getResourceByProjectId
(
p
.
getProjectId
()).
stream
().
filter
(
r
->
r
esourceService
.
isAllocationActiveToday
(
r
)).
forEach
(
r
->{
forEach
(
r
->{
Employee
employee
=
employeeService
.
findByEmployeeIdAndEmpStatus
(
MyTeamUtils
.
ACTIVE
,
r
.
getEmployeeId
());
Employee
employee
=
employeeService
.
findByEmployeeIdAndEmpStatus
(
MyTeamUtils
.
ACTIVE
,
r
.
getEmployeeId
());
if
(
employee
!=
null
)
if
(
employee
!=
null
)
...
@@ -144,6 +144,8 @@ public class ReportService implements IReportService {
...
@@ -144,6 +144,8 @@ public class ReportService implements IReportService {
return
resultantEmployeeWithBillability
(
employeesByFG
,
billableStatus
);
return
resultantEmployeeWithBillability
(
employeesByFG
,
billableStatus
);
}
}
@Override
@Override
public
List
<
Reports
>
getEmployeeDetailsByAccountBillability
(
String
accountName
,
String
billabilityStatus
)
public
List
<
Reports
>
getEmployeeDetailsByAccountBillability
(
String
accountName
,
String
billabilityStatus
)
throws
MyTeamException
{
throws
MyTeamException
{
...
@@ -230,4 +232,10 @@ public class ReportService implements IReportService {
...
@@ -230,4 +232,10 @@ public class ReportService implements IReportService {
return
projectService
.
getProjectByProjectId
(
projectId
);
return
projectService
.
getProjectByProjectId
(
projectId
);
}
}
@Override
public
List
<
Reports
>
getEmployeeDetailsByFGAccountAndBillability
(
String
fGroup
,
String
billableStatus
,
String
account
)
{
List
<
Employee
>
empList
=
getEmployeesByAccAndFG
(
account
,
fGroup
);
return
resultantEmployeeWithBillability
(
empList
,
billableStatus
);
}
}
}
src/main/resources/application.properties
View file @
f7e0f931
...
@@ -71,5 +71,5 @@ email.workAnniversary.notification.subject=Happy Work Anniversary
...
@@ -71,5 +71,5 @@ email.workAnniversary.notification.subject=Happy Work Anniversary
email.workAnniversary.notification.cron
=
00 00 06 * * 1-7
email.workAnniversary.notification.cron
=
00 00 06 * * 1-7
spring.profiles.active
=
development
spring.profiles.active
=
production
message
=
this is from default configuration
message
=
this is from default configuration
\ No newline at end of file
src/main/webapp/WEB-INF/controllers/ChartsController.js
View file @
f7e0f931
...
@@ -15,7 +15,13 @@ myApp.directive('hcPieChart', function () {
...
@@ -15,7 +15,13 @@ myApp.directive('hcPieChart', function () {
getEmployeeDetails
(
scope
,
element
[
0
].
baseURI
+
'reports/getBillabilityDetailsByMonth'
,
'line'
,
element
,
" Billability Monthly Trends"
);
getEmployeeDetails
(
scope
,
element
[
0
].
baseURI
+
'reports/getBillabilityDetailsByMonth'
,
'line'
,
element
,
" Billability Monthly Trends"
);
}
}
else
{
else
{
reportTypeApiFormat
=
reportType
==
"All Functional Group"
?
reportType
.
replace
(
/
\s
/g
,
""
)
:
reportType
;
if
(
reportType
==
'I&A'
){
reportTypeApiFormat
=
'I%26A'
;
}
else
if
(
reportType
==
"All Functional Group"
){
reportTypeApiFormat
=
reportType
.
replace
(
/
\s
/g
,
""
);
}
else
{
reportTypeApiFormat
=
reportType
;
}
getEmployeeDetails
(
scope
,
element
[
0
].
baseURI
+
'reports/getBarChartReport?byType='
+
reportTypeApiFormat
,
'column'
,
element
,
"Billability For "
+
reportType
);
getEmployeeDetails
(
scope
,
element
[
0
].
baseURI
+
'reports/getBarChartReport?byType='
+
reportTypeApiFormat
,
'column'
,
element
,
"Billability For "
+
reportType
);
}
}
}
}
...
@@ -156,6 +162,23 @@ myApp.directive('hcPieChart', function () {
...
@@ -156,6 +162,23 @@ myApp.directive('hcPieChart', function () {
showAlert
(
"Something went wrong while fetching data!!!"
);
showAlert
(
"Something went wrong while fetching data!!!"
);
$scope
.
gridOptions
.
data
=
[];
$scope
.
gridOptions
.
data
=
[];
});
});
}
else
{
var
fg
=
$scope
.
reportType
==
'I&A'
?
'I%26A'
:
$scope
.
reportType
;
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"reports/fetchEmployeeDetailsByFGAccountAndBillability?fGroup="
+
fg
+
"&billableStatus="
+
seriesName
+
"&acccount="
+
category
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
gridOptions
.
data
=
response
.
data
;
if
(
response
.
data
.
length
>
10
){
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
}
else
{
$scope
.
gridOptions
.
enablePaginationControls
=
false
;
}
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
$scope
.
gridOptions
.
data
=
[];
});
}
}
};
};
...
...
src/main/webapp/WEB-INF/controllers/OpenPoolController.js
View file @
f7e0f931
...
@@ -23,7 +23,7 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
...
@@ -23,7 +23,7 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
'Non-Billable'
'Non-Billable'
]
]
},
},
{
field
:
'billingStartDate'
,
displayName
:
'Start Date'
,
enableColumnMenu
:
false
,
enableSorting
:
fals
e
,
enableFiltering
:
true
,
width
:
'*'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
},
{
field
:
'billingStartDate'
,
displayName
:
'Start Date'
,
enableColumnMenu
:
false
,
enableSorting
:
tru
e
,
enableFiltering
:
true
,
width
:
'*'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
},
{
name
:
'Actions'
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
'*'
}
{
name
:
'Actions'
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
'*'
}
],
],
enableGridMenu
:
true
,
enableGridMenu
:
true
,
...
...
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
f7e0f931
...
@@ -53,7 +53,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
...
@@ -53,7 +53,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
{
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
:
'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
:
true
,
enableFiltering
:
false
},
{
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
:
true
,
enableFiltering
:
false
},
{
field
:
'status'
,
displayName
:
'Status '
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
fals
e
,
width
:
100
},
{
field
:
'status'
,
displayName
:
'Status '
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
tru
e
,
width
:
100
},
{
name
:
'Actions'
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
120
}
{
name
:
'Actions'
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
120
}
]
]
};
};
...
@@ -2071,7 +2071,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
...
@@ -2071,7 +2071,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
data
:
record
data
:
record
}
}
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
if
(
response
.
data
.
message
==
"Project is already existed"
){
if
(
response
.
data
.
statusCode
!=
700
&&
response
.
data
.
statusCode
!=
701
){
$mdDialog
.
show
(
$mdDialog
.
alert
({
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
skipHide
:
true
,
title
:
'Attention'
,
title
:
'Attention'
,
...
@@ -2109,7 +2109,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
...
@@ -2109,7 +2109,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
return
false
;
return
false
;
}
}
function
validateTextFields
(
name
){
function
validateTextFields
(
name
){
var
pattern
=
/^
[
a-zA-Z
\s]
*$/
;
var
pattern
=
/^
[
a-zA-Z
#@.,;:'()
\/
&
\-
"!
]
+
(
[
a-zA-Z#@.,;:'()
\/
&
\-
"!
]
+
)
*$/
;
if
(
pattern
.
test
(
name
)){
if
(
pattern
.
test
(
name
)){
return
true
;
return
true
;
}
}
...
...
src/main/webapp/WEB-INF/templates/newProject.html
View file @
f7e0f931
...
@@ -105,16 +105,14 @@
...
@@ -105,16 +105,14 @@
</td>
</td>
</tr>
</tr>
</table>
</table>
<div
role=
"alert"
>
<span
class=
"error"
style=
"color: red;"
>
{{alertMsg}}
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</md-dialog-content>
</md-dialog-content>
<md-dialog-actions
layout=
"row"
>
<md-dialog-actions
layout=
"row"
>
<div
role=
"alert"
>
<span
class=
"error"
style=
"color: red; margin-right:95px"
>
{{alertMsg}}
</span>
</div>
<md-button
class=
"md-raised"
data-ng-click=
"validateProjectFields(templateTitle)"
style=
"width:120px;background: cadetblue;color:white;"
>
<md-button
class=
"md-raised"
data-ng-click=
"validateProjectFields(templateTitle)"
style=
"width:120px;background: cadetblue;color:white;"
>
<span
ng-show=
"templateTitle == 'Assign' "
>
Add
</span>
<span
ng-show=
"templateTitle != 'Assign' "
>
{{templateTitle}}
</span>
</md-button>
<span
ng-show=
"templateTitle == 'Assign' "
>
Add
</span>
<span
ng-show=
"templateTitle != 'Assign' "
>
{{templateTitle}}
</span>
</md-button>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment