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
7559e41a
Commit
7559e41a
authored
Aug 12, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated open pool controller
parent
64b7b7d9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
31 deletions
+98
-31
EmployeeController.java
.../java/com/nisum/myteam/controller/EmployeeController.java
+1
-1
OpenPoolController.js
src/main/webapp/WEB-INF/controllers/OpenPoolController.js
+90
-28
custom-theme.css
src/main/webapp/WEB-INF/css/custom-theme.css
+3
-1
showOpenPool.html
src/main/webapp/WEB-INF/templates/showOpenPool.html
+4
-1
No files found.
src/main/java/com/nisum/myteam/controller/EmployeeController.java
View file @
7559e41a
...
@@ -231,7 +231,7 @@ public class EmployeeController {
...
@@ -231,7 +231,7 @@ public class EmployeeController {
List
<
Employee
>
employeesList
=
new
ArrayList
<>();
List
<
Employee
>
employeesList
=
new
ArrayList
<>();
if
(
empService
.
getActiveEmployees
()
!=
null
)
{
if
(
empService
.
getActiveEmployees
()
!=
null
)
{
employeesList
=
empService
.
getActiveEmployees
().
stream
()
employeesList
=
empService
.
getActiveEmployees
().
stream
()
.
sorted
((
o1
,
o2
)
->
o1
.
getEmployeeName
().
compareTo
(
o2
.
getEmployeeName
()))
.
sorted
((
o1
,
o2
)
->
o1
.
getEmployeeName
().
trim
().
compareTo
(
o2
.
getEmployeeName
().
trim
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
return
new
ResponseEntity
<>(
employeesList
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
employeesList
,
HttpStatus
.
OK
);
...
...
src/main/webapp/WEB-INF/controllers/OpenPoolController.js
View file @
7559e41a
...
@@ -151,8 +151,6 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
...
@@ -151,8 +151,6 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
var
newIndex
=
$scope
.
gridOptions
.
data
.
indexOf
(
allRows
[
i
].
entity
)
var
newIndex
=
$scope
.
gridOptions
.
data
.
indexOf
(
allRows
[
i
].
entity
)
if
(
newIndex
==
$scope
.
previousRowIndex
){
if
(
newIndex
==
$scope
.
previousRowIndex
){
allRows
[
i
].
entity
.
billableStatus
=
$scope
.
previousRow
.
billableStatus
;
allRows
[
i
].
entity
.
billableStatus
=
$scope
.
previousRow
.
billableStatus
;
allRows
[
i
].
entity
.
billingStartDate
=
$scope
.
previousRow
.
billingStartDate
;
allRows
[
i
].
entity
.
billingEndDate
=
$scope
.
previousRow
.
billingEndDate
;
$scope
.
previousRow
=
angular
.
copy
(
row
.
entity
);
$scope
.
previousRow
=
angular
.
copy
(
row
.
entity
);
}
}
}
}
...
@@ -162,32 +160,96 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
...
@@ -162,32 +160,96 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
$scope
.
gridOptions
.
data
[
index
].
editrow
=
false
;
$scope
.
gridOptions
.
data
[
index
].
editrow
=
false
;
row
.
billableStatus
=
$scope
.
parentData
.
billableStatus
;
row
.
billableStatus
=
$scope
.
parentData
.
billableStatus
;
};
};
// $scope.saveRow = function (row,action) {
$scope
.
DataUpdate
=
function
()
{
// var index = $scope.gridOptions.data.indexOf(row);
var
data
=
$scope
.
parentData
;
// $scope.gridOptions.data[index].editrow = false;
$scope
.
previousData
=
{
// $scope.employeeModel = {
Billabilitystatus
:
data
.
billableStatus
,
// 'employeeName': row.employeeName,
},
// 'employeeId': row.employeeId,
$scope
.
currentData
=
{
// 'designation': row.designation
Billabilitystatus
:
$scope
.
empBillableStatus
,
// };
}
// $scope.newBillingStartDate = row.billingStartDate;
var
predata
=
JSON
.
stringify
(
$scope
.
previousData
);
// $scope.endDate = row.billingEndDate;
var
curdata
=
JSON
.
stringify
(
$scope
.
currentData
);
// $scope.employeeRole = row.resourceRole;
if
(
predata
==
curdata
)
{
// $scope.empBillableStatus = row.billableStatus;
return
false
;
// $scope.empAllocationStatus = row.status;
}
// $scope.aliasResourceName = row.onBehalfOf;
return
true
;
// $scope.id = row.id;
}
// if(action == 'Update'){
$scope
.
saveRow
=
function
(
row
,
action
)
{
// $scope.validateFields(action,row);
var
index
=
$scope
.
gridOptions
.
data
.
indexOf
(
row
);
// if($scope.alertMsg != ""){
$scope
.
gridOptions
.
data
[
index
].
editrow
=
false
;
// row.billingStartDate = $scope.parentData.newBillingStartDate;
$scope
.
employeeName
=
row
.
employeeName
;
// row.billingEndDate = $scope.parentData.endDate;
$scope
.
projectId
=
row
.
projectId
;
// row.resourceRole = $scope.parentData.role;
$scope
.
employeeId
=
row
.
employeeId
;
// row.billableStatus = $scope.parentData.billableStatus;
$scope
.
designation
=
row
.
designation
;
// }
$scope
.
billingStartDate
=
row
.
billingStartDate
;
// $scope.previousRow = angular.copy(row);
$scope
.
billingEndDate
=
row
.
billingEndDate
;
// }
$scope
.
employeeRole
=
row
.
resourceRole
;
// }
$scope
.
empBillableStatus
=
row
.
billableStatus
;
$scope
.
empAllocationStatus
=
row
.
status
;
$scope
.
id
=
row
.
id
;
var
record
=
{
"id"
:
$scope
.
id
,
"employeeId"
:
$scope
.
employeeId
,
"projectId"
:
$scope
.
projectId
,
"billableStatus"
:
$scope
.
empBillableStatus
,
"billingEndDate"
:
$scope
.
billingEndDate
,
"resourceRole"
:
$scope
.
employeeRole
,
"billingStartDate"
:
$scope
.
billingStartDate
,
"status"
:
$scope
.
empAllocationStatus
};
if
(
action
==
'Update'
){
if
(
$scope
.
DataUpdate
()
!=
true
)
{
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
title
:
'Attention'
,
textContent
:
'There is no data change to Update'
,
ok
:
'ok'
}))
}
else
{
updateOpenPoolRecord
(
record
,
action
,
row
);
}
$scope
.
previousRow
=
angular
.
copy
(
row
);
}
}
function
updateOpenPoolRecord
(
record
,
action
,
row
){
var
urlRequest
=
""
;
var
loginEmpId
=
myFactory
.
getEmpId
();
urlRequest
=
appConfig
.
appUri
+
"resources?loginEmpId="
+
loginEmpId
;
var
req
=
{
method
:
'PUT'
,
url
:
urlRequest
,
headers
:
{
"Content-type"
:
"application/json"
},
data
:
record
}
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
$scope
.
result
=
"Success"
;
if
(
response
.
data
.
message
==
"Resource updated successfully"
){
$timeout
(
function
()
{
getOpenPoolRecords
();
},
500
);
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
textContent
:
response
.
data
.
message
,
ok
:
'ok'
})).
then
(
function
()
{
$scope
.
myForm
.
$setPristine
();
})
}
else
{
$scope
.
alertMsg
=
response
.
data
.
message
;
if
(
$scope
.
alertMsg
&&
$scope
.
alertMsg
!=
""
){
row
.
billableStatus
=
$scope
.
parentData
.
billableStatus
;
}
$scope
.
previousRow
=
angular
.
copy
(
row
);
}
},
function
myError
(
response
){
$scope
.
result
=
"Error"
;
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
textContent
:
"Something Went Wrong !!!"
,
ok
:
'ok'
})).
then
(
function
()
{
$scope
.
myForm
.
$setPristine
();
})
row
.
billableStatus
=
$scope
.
parentData
.
billableStatus
;
});
}
...
...
src/main/webapp/WEB-INF/css/custom-theme.css
View file @
7559e41a
...
@@ -657,6 +657,9 @@ cursor: pointer;
...
@@ -657,6 +657,9 @@ cursor: pointer;
.manage-employee-efforts
{
.manage-employee-efforts
{
height
:
calc
(
100vh
-
260px
)
!important
;
height
:
calc
(
100vh
-
260px
)
!important
;
}
}
.manage-open-pool
{
height
:
calc
(
100vh
-
230px
)
!important
;
}
.md-datepicker-input-mask
{
.md-datepicker-input-mask
{
height
:
0px
;
height
:
0px
;
}
}
...
@@ -687,7 +690,6 @@ cursor: pointer;
...
@@ -687,7 +690,6 @@ cursor: pointer;
.substatus-dropdown
md-datepicker
{
.substatus-dropdown
md-datepicker
{
padding
:
0
;
padding
:
0
;
}
}
.substatus-dropdown
>
md-select
{
.substatus-dropdown
>
md-select
{
margin
:
0
;
margin
:
0
;
}
}
...
...
src/main/webapp/WEB-INF/templates/showOpenPool.html
View file @
7559e41a
...
@@ -15,11 +15,14 @@
...
@@ -15,11 +15,14 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"col-lg-12"
>
<div
id=
"gridTest"
ui-grid=
"gridOptions"
ui-grid-pagination
ui-grid-exporter
<div
id=
"gridTest"
ui-grid=
"gridOptions"
ui-grid-pagination
ui-grid-exporter
class=
"myGrid
grid-full-view
"
>
class=
"myGrid
manage-open-pool
"
>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
data available
</div>
data available
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
role=
"alert"
class=
"alertMsg"
>
<span
style=
"color: red; "
>
{{alertMsg}}
</span>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
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