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
64b7b7d9
Commit
64b7b7d9
authored
Aug 07, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added edit and save icon in open pool screen
parent
47f8b553
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
5 deletions
+97
-5
OpenPoolController.js
src/main/webapp/WEB-INF/controllers/OpenPoolController.js
+97
-3
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+0
-2
No files found.
src/main/webapp/WEB-INF/controllers/OpenPoolController.js
View file @
64b7b7d9
myApp
.
controller
(
"openPoolController"
,
function
(
$scope
,
$http
,
myFactory
,
$mdDialog
,
appConfig
,
exportUiGridService
)
{
myApp
.
controller
(
"openPoolController"
,
function
(
$scope
,
$http
,
myFactory
,
$mdDialog
,
appConfig
,
exportUiGridService
)
{
$scope
.
records
=
[];
$scope
.
records
=
[];
var
today
=
new
Date
();
var
today
=
new
Date
();
var
getCellTemplate
=
'<p class="col-lg-12"><i ng-show="!row.entity.editrow" class="fa fa-pencil-square-o fa-2x" data-placement="center" title="Edit" onmouseenter="$(this).tooltip(
\'
show
\'
)" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.onEdit(row)"></i>'
+
'<i ng-show="row.entity.editrow" class="fa fa-save fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Save" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.saveRow(row.entity,
\'
Update
\'
)"></i>'
+
' <i ng-show="row.entity.editrow" id="cancelEdit" class="fa fa-times fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Cancel" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.cancelEdit(row.entity)"></i></p>'
;
$scope
.
gridOptions
=
{
$scope
.
gridOptions
=
{
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSize
:
10
,
paginationPageSize
:
10
,
...
@@ -12,8 +16,15 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
...
@@ -12,8 +16,15 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
{
field
:
'employeeName'
,
displayName
:
'Employee Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
width
:
'*'
},
{
field
:
'employeeName'
,
displayName
:
'Employee Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
width
:
'*'
},
{
field
:
'resourceRole'
,
displayName
:
'Role'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
width
:
'*'
},
{
field
:
'resourceRole'
,
displayName
:
'Role'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
width
:
'*'
},
{
field
:
'designation'
,
displayName
:
'Designation'
,
enableColumnMenu
:
false
,
enableFiltering
:
false
,
width
:
'*'
},
{
field
:
'designation'
,
displayName
:
'Designation'
,
enableColumnMenu
:
false
,
enableFiltering
:
false
,
width
:
'*'
},
{
field
:
'billableStatus'
,
displayName
:
'Billability'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
width
:
'*'
},
{
field
:
'billableStatus'
,
displayName
:
'Billability'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
width
:
'*'
,
cellTemplate
:
'<div class="ui-grid-cell-contents" ng-if="!row.entity.editrow">{{COL_FIELD}}</div><div ng-if="row.entity.editrow" class="grid-Dropdown"><md-select ng-model="MODEL_COL_FIELD" name="empBillableStatus" append-to-body="true">'
{
field
:
'billingStartDate'
,
displayName
:
'Start Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
width
:
'*'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
}
+
'<md-optgroup label="billable statuses "><md-option ng-value="billableStatus " ng-repeat="billableStatus in col.colDef.editDropdownOptionsArray">{{billableStatus}}</md-option>'
+
'</md-optgroup></md-select></div>'
,
editDropdownOptionsArray
:
[
'Trainee'
,
'Non-Billable'
]
},
{
field
:
'billingStartDate'
,
displayName
:
'Start Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
width
:
'*'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
},
{
name
:
'Actions'
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
'*'
}
],
],
enableGridMenu
:
true
,
enableGridMenu
:
true
,
enableSelectAll
:
true
,
enableSelectAll
:
true
,
...
@@ -97,4 +108,87 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
...
@@ -97,4 +108,87 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
function
ProgressController
(
$scope
,
dataToPass
)
{
function
ProgressController
(
$scope
,
dataToPass
)
{
$scope
.
progressText
=
dataToPass
;
$scope
.
progressText
=
dataToPass
;
}
}
$scope
.
parentData
=
{
"id"
:
""
,
"employeeId"
:
""
,
"employeeName"
:
""
,
"role"
:
""
,
"designation"
:
""
,
"billableStatus"
:
""
,
"billingStartDate"
:
""
};
$scope
.
onEdit
=
function
(
rowd
)
{
var
row
=
rowd
.
entity
;
var
index
=
$scope
.
gridOptions
.
data
.
indexOf
(
row
);
if
(
$scope
.
previousRow
){
$scope
.
rowCompare
(
rowd
);
}
$scope
.
previousRow
=
angular
.
copy
(
row
);
$scope
.
previousRowIndex
=
index
;
$scope
.
gridOptions
.
enableCellEdit
=
true
;
for
(
var
i
=
0
;
i
<
$scope
.
gridOptions
.
data
.
length
;
i
++
){
if
(
i
==
index
){
$scope
.
gridOptions
.
data
[
i
].
editrow
=
!
$scope
.
gridOptions
.
data
[
i
].
editrow
;
}
else
{
$scope
.
gridOptions
.
data
[
i
].
editrow
=
false
;
}
}
$scope
.
parentData
.
employeeId
=
row
.
employeeId
;
$scope
.
parentData
.
employeeName
=
row
.
employeeName
;
$scope
.
parentData
.
id
=
row
.
id
;
$scope
.
parentData
.
role
=
row
.
resourceRole
;
$scope
.
parentData
.
designation
=
row
.
designation
;
$scope
.
parentData
.
billableStatus
=
row
.
billableStatus
;
$scope
.
parentData
.
billingStartDate
=
new
Date
(
row
.
billingStartDate
);
};
$scope
.
rowCompare
=
function
(
row
)
{
var
allRows
=
row
.
grid
.
rows
;
for
(
var
i
=
0
;
i
<
allRows
.
length
;
i
++
)
{
var
newIndex
=
$scope
.
gridOptions
.
data
.
indexOf
(
allRows
[
i
].
entity
)
if
(
newIndex
==
$scope
.
previousRowIndex
){
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
.
cancelEdit
=
function
(
row
)
{
var
index
=
$scope
.
gridOptions
.
data
.
indexOf
(
row
);
$scope
.
gridOptions
.
data
[
index
].
editrow
=
false
;
row
.
billableStatus
=
$scope
.
parentData
.
billableStatus
;
};
// $scope.saveRow = function (row,action) {
// var index = $scope.gridOptions.data.indexOf(row);
// $scope.gridOptions.data[index].editrow = false;
// $scope.employeeModel = {
// 'employeeName': row.employeeName,
// 'employeeId': row.employeeId,
// 'designation': row.designation
// };
// $scope.newBillingStartDate = row.billingStartDate;
// $scope.endDate = row.billingEndDate;
// $scope.employeeRole = row.resourceRole;
// $scope.empBillableStatus = row.billableStatus;
// $scope.empAllocationStatus = row.status;
// $scope.aliasResourceName = row.onBehalfOf;
// $scope.id = row.id;
// if(action == 'Update'){
// $scope.validateFields(action,row);
// if($scope.alertMsg != ""){
// row.billingStartDate = $scope.parentData.newBillingStartDate;
// row.billingEndDate = $scope.parentData.endDate;
// row.resourceRole = $scope.parentData.role;
// row.billableStatus = $scope.parentData.billableStatus;
// }
// $scope.previousRow = angular.copy(row);
// }
// }
});
});
\ No newline at end of file
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
64b7b7d9
...
@@ -815,8 +815,6 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
...
@@ -815,8 +815,6 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
previousRow
=
angular
.
copy
(
row
.
entity
);
$scope
.
previousRow
=
angular
.
copy
(
row
.
entity
);
}
}
}
}
}
}
$scope
.
moveToBench
=
function
(
row
)
{
$scope
.
moveToBench
=
function
(
row
)
{
...
...
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