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
751568e8
Commit
751568e8
authored
Jul 31, 2018
by
Rajeshekar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MT-117[Poojitha]: Update Team mate from Manage Projects
parent
27f3db74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
233 additions
and
57 deletions
+233
-57
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+149
-56
projectTeamDetails.html
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
+84
-1
No files found.
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
751568e8
...
...
@@ -327,14 +327,22 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope
.
addTab
=
function
()
{
if
(
$scope
.
isSecondTab
===
false
){
$scope
.
templateTitle
=
"Add"
;
$scope
.
employeeRole
=
undefined
;
$scope
.
empBillableStatus
=
undefined
;
$scope
.
newBillingStartDate
=
undefined
;
$scope
.
startDate
=
undefined
;
$scope
.
endDate
=
undefined
;
$scope
.
employeeModel
=
{};
$
(
'.md-datepicker-input'
)[
0
].
value
=
null
;
$
(
'.md-datepicker-input'
)[
1
].
value
=
null
;
$
(
'.md-datepicker-input'
)[
2
].
value
=
null
;
document
.
getElementsByClassName
(
"md-tab"
)[
1
].
style
.
visibility
=
"visible"
;
document
.
getElementsByClassName
(
"md-tab"
)[
2
].
style
.
visibility
=
"hidden"
;
$scope
.
isSecondTab
=
true
;
$scope
.
selectedTab
=
1
;
$scope
.
searchTerm
=
""
;
}
};
$scope
.
searchTerm
=
""
;
}
};
var
removeTab
=
function
(
action
)
{
if
(
action
==
"Add"
){
if
(
$scope
.
isSecondTab
===
true
){
...
...
@@ -349,6 +357,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}
$scope
.
selectedTab
=
0
;
document
.
getElementsByClassName
(
"md-tab"
)[
1
].
style
.
visibility
=
"hidden"
;
document
.
getElementsByClassName
(
"md-tab"
)[
2
].
style
.
visibility
=
"hidden"
;
$scope
.
isSecondTab
=
!
$scope
.
isSecondTab
;
};
...
...
@@ -533,47 +542,110 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope
.
parentData
.
endDate
=
row
.
entity
.
endDate
;
$scope
.
parentData
.
newBillingStartDate
=
row
.
entity
.
newBillingStartDate
;
if
(
action
==
"Update"
){
if
(
action
==
"Update
Team
"
){
$scope
.
updateTeamMate
(
action
,
$scope
.
parentData
);
}
else
if
(
action
==
"Delete"
){
$scope
.
deleteRole
(
row
,
$scope
.
parentData
.
id
);
}
else
if
(
action
==
"ViewTeamDetail"
){
$scope
.
viewTeamDetail
(
action
,
$scope
.
parentData
);
}
else
if
(
action
==
"ViewBillability"
){
$scope
.
ViewBillability
(
action
,
$scope
.
parentData
);
}
if
(
action
==
"Delete"
){
console
.
log
(
"deleted"
);
$scope
.
deleteTeamMate
(
row
);
}
// else if(action == "Delete"){
// $scope.deleteRole(row,$scope.parentData.id);
// }else if(action=="ViewTeamDetail"){
//
// $scope.viewTeamDetail(action, $scope.parentData);
//
// }else if(action=="ViewBillability"){
//
// $scope.ViewBillability(action, $scope.parentData);
//
// }
}
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"
;
}
if
(
document
.
getElementsByClassName
(
"md-tab"
)[
2
]
&&
(
document
.
getElementsByClassName
(
"md-tab"
)[
2
].
style
.
visibility
===
""
)){
document
.
getElementsByClassName
(
"md-tab"
)[
2
].
style
.
visibility
=
"hidden"
;
}
},
false
);
}
$scope
.
updateTab
=
function
()
{
// if($scope.isSecondTab == false){
$scope
.
isSecondTab
=
!
$scope
.
isSecondTab
;
$scope
.
templateTitle
=
"Update"
;
document
.
getElementsByClassName
(
"md-tab"
)[
1
].
style
.
visibility
=
"hidden"
;
document
.
getElementsByClassName
(
"md-tab"
)[
2
].
style
.
visibility
=
"visible"
;
$scope
.
selectedTab
=
2
;
$scope
.
searchTerm
=
""
;
// }
};
$scope
.
updateTeamMate
=
function
(
action
,
userData
){
$
(
'#home'
).
addClass
(
'md-scroll-mask'
);
console
.
log
(
userData
);
$scope
.
updateTab
();
$scope
.
id
=
userData
.
id
;
$scope
.
employeeModel
=
{
'employeeName'
:
userData
.
employeeName
,
'employeeId'
:
userData
.
employeeId
,
'emailId'
:
userData
.
emailId
,
'designation'
:
userData
.
designation
};
// $scope.employeeModel.employeeId = userData.employeeId;
// $scope.employeeModel.employeeName = userData.employeeName;
// $scope.employeeModel.emailId = userData.emailId;
$scope
.
empBillableStatus
=
userData
.
billableStatus
;
$scope
.
employeeRole
=
userData
.
role
;
$scope
.
newBillingStartDate
=
new
Date
(
userData
.
newBillingStartDate
);
$scope
.
startDate
=
new
Date
(
userData
.
startDate
);
$scope
.
endDate
=
new
Date
(
userData
.
endDate
);
//$scope.addTab();
//$('#home').addClass('md-scroll-mask');
userData
.
action
=
action
;
$mdDialog
.
show
({
controller
:
AddProjectTeamController
,
templateUrl
:
'templates/UpdateTeamMate.html'
,
parent
:
angular
.
element
(
document
.
body
),
clickOutsideToClose
:
false
,
locals
:{
dataToPass
:
userData
,
gridOptionsData
:
$scope
.
gridOptions
.
data
,
employees
:
$scope
.
employees
},
})
.
then
(
function
(
result
)
{
if
(
result
==
"Add"
)
showAlert
(
'New Teammate assigned successfully'
);
else
if
(
result
==
"Update"
)
{
$scope
.
refreshPage
();
showAlert
(
'Teammate updated successfully'
);
}
else
if
(
result
==
"Cancelled"
)
console
.
log
(
result
);
else
showAlert
(
'Teammate assigning/updation failed!!!'
);
});
// $mdDialog.show({
// controller: AddProjectController,
// templateUrl: 'templates/UpdateTeamMate.html',
// parent: angular.element(document.body),
// clickOutsideToClose:false,
// locals:{dataToPass: userData, gridOptionsData: $scope.gridOptions.data, employees: $scope.employees},
// })
// .then(function(result) {
// console.log("result");
//// if(result == "Add") showAlert('New Teammate assigned successfully');
//// else if(result == "Update") {
//// $scope.refreshPage();
//// showAlert('Teammate updated successfully');
////
//// }
//// else if(result == "Cancelled") console.log(result);
//// else showAlert('Teammate assigning/updation failed!!!');
// });
};
$scope
.
deleteTeamMate
=
function
(
row
)
{
console
.
log
(
row
);
$scope
.
id
=
row
.
entity
.
id
;
$scope
.
employeeId
=
row
.
entity
.
employeeId
;
$scope
.
projectId
=
row
.
entity
.
projectId
;
var
record
=
{
"id"
:
$scope
.
id
,
"employeeId"
:
$scope
.
employeeId
,
"projectId"
:
$scope
.
projectId
}
$mdDialog
.
show
(
$mdDialog
.
confirm
({
skipHide
:
true
,
textContent
:
'Are you sure you want to inactivate this teamMate?'
,
ok
:
'ok'
,
cancel
:
'cancel'
})).
then
(
function
(){
deleteTeam
(
record
);
$timeout
(
function
(){
getProjectDetails
(
$scope
.
projectId
);
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
textContent
:
'Employee Inactivated'
,
ok
:
'ok'
}));
},
500
);
})
};
}
else
if
(
dataToPass
.
action
==
"UnAssigned"
)
{
$scope
.
gridOptions
=
{
...
...
@@ -889,24 +961,39 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
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
else
if
(
employeeModel
!=
undefined
&&
projectModel
!=
undefined
&&
action
==
"Add"
&&
getExistingRecordProjectStatus
(
employeeModel
.
employeeId
,
projectModel
.
projectName
)){
$scope
.
alertMsg
=
"Employee is already assigned to the selected project"
;
return
false
;
}
else
{
}
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
,
"role"
:
$scope
.
employeeRole
,
"newBillingStartDate"
:
newBillingStartDate
,
"accountId"
:
$scope
.
accountId
,
"domainId"
:
$scope
.
domainId
};
addRecord
(
record
,
action
);
$timeout
(
function
(){
updateGrid
(
'Add'
,
record
);
$scope
.
getPro
removeTab
(
'Add'
);
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
textContent
:
'Employee Added'
,
ok
:
'ok'
}));
},
500
);
if
(
action
==
"Add"
){
addRecord
(
record
,
action
);
$timeout
(
function
(){
updateGrid
(
action
,
record
);
removeTab
(
'Add'
);
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
textContent
:
'Employee Added'
,
ok
:
'ok'
}));
},
500
);
}
else
if
(
action
==
"Update"
){
updateTeamRecord
(
record
,
action
);
$timeout
(
function
(){
getProjectDetails
(
project
);
removeTab
(
'Add'
);
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
textContent
:
'Employee Updated'
,
ok
:
'ok'
}));
},
500
);
}
// addRecord(record,action);
}
...
...
@@ -928,11 +1015,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
document
.
getElementById
(
'domain'
).
focus
();
}
else
if
(
deliveryLeadsSelectedList
.
employeeName
==
undefined
||
deliveryLeadsSelectedList
.
employeeName
==
""
){
$scope
.
alertMsg
=
"Please select a Delivery Lead"
;
$scope
.
alertMsg
=
"Please select a Delivery Lead"
;
document
.
getElementById
(
'deliveryLead'
).
focus
();
}
else
if
(
projectStatus
==
undefined
){
$scope
.
alertMsg
=
"Please select a Project Status"
;
$scope
.
alertMsg
=
"Please select a Project Status"
;
document
.
getElementById
(
'projectStatus'
).
focus
();
}
else
{
...
...
@@ -979,15 +1066,21 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
};
$scope
.
getEmployeeSelected
=
function
(){
if
(
$scope
.
employeeModel
!==
undefined
)
{
$scope
.
employee
=
$scope
.
employeeModel
;
return
$scope
.
employeeModel
.
employeeName
;
if
(
$scope
.
employeeModel
!=
undefined
)
{
if
(
Object
.
keys
(
$scope
.
employeeModel
).
length
>
1
){
$scope
.
employee
=
$scope
.
employeeModel
;
return
$scope
.
employeeModel
.
employeeName
;
}
else
{
return
"Please select a employee"
;
}
}
else
{
return
"Please select a employee"
;
}
};
$scope
.
getSelectedEmpRole
=
function
(){
if
(
$scope
.
employeeRole
!=
=
undefined
)
{
if
(
$scope
.
employeeRole
!=
undefined
)
{
return
$scope
.
employeeRole
;
}
else
{
return
"Please select a employee role"
;
...
...
@@ -1002,7 +1095,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
// }
// };
$scope
.
getSelectedBillableStatus
=
function
(){
if
(
$scope
.
empBillableStatus
!=
=
undefined
)
{
if
(
$scope
.
empBillableStatus
!=
undefined
)
{
return
$scope
.
empBillableStatus
;
}
else
{
return
"Please select a billable status"
;
...
...
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
View file @
751568e8
...
...
@@ -85,6 +85,89 @@
<output>
Email Id : {{employeeModel.emailId}}
</output>
<output>
Role : {{employeeModel.role}}
</output>
<output>
Designation : {{employeeModel.designation}}
</output>
<md-select
ng-model=
"employeeRole"
md-selected-text=
"getSelectedEmpRole()"
id=
"empRole"
name=
"employeeRole"
>
<md-optgroup
label=
"employee role"
>
<md-option
ng-value=
"empRole"
ng-repeat=
"empRole in employeeRoles"
>
{{empRole}}
</md-option>
</md-optgroup>
</md-select>
<md-select
ng-model=
"empBillableStatus "
md-selected-text=
"getSelectedBillableStatus() "
id=
"empBillableStatus"
name=
"empBillableStatus"
>
<md-optgroup
label=
"billable statuses "
>
<md-option
ng-value=
"billableStatus "
ng-repeat=
"billableStatus in billableStatuses "
>
{{billableStatus}}
</md-option>
</md-optgroup>
</md-select>
<div
ng-show=
"empBillableStatus"
>
<md-datepicker
ng-model=
"newBillingStartDate"
md-placeholder=
"newBillingStartDate "
id=
"newBillingStartDate "
md-min-date=
"minDate "
md-max-date=
"maxDate "
onkeydown=
"return false "
ng-change=
"currentBillabilityDateChange()"
name=
"newBillingStartDate"
></md-datepicker>
</div>
<md-datepicker
ng-model=
"startDate "
md-placeholder=
"Start Date "
id=
"startDate "
md-min-date=
"minDate "
md-max-date=
"maxDate "
onkeydown=
"return false "
ng-disabled=
"newBillingStartDate"
name=
"startDate"
></md-datepicker>
</br>
<md-datepicker
ng-model=
"endDate "
md-placeholder=
"Projected End Date "
id=
"endDate "
md-min-date=
"minDate "
md-max-date=
"maxDate "
onkeydown=
"return false "
name=
"endDate"
></md-datepicker>
<div
role=
"alert "
>
<span
class=
"error "
style=
"color: red; "
>
{{alertMsg}}
</span>
</div>
</div>
</div>
<md-dialog-actions
layout=
"row "
>
<md-button
class=
"md-raised "
data-ng-click=
"validateFields(templateTitle) "
style=
"width:120px;background: cadetblue;color:white; "
>
Add
</md-button>
<md-button
class=
"md-raised "
ng-click=
"cancelTab() "
style=
"width:120px;background: cadetblue;color:white; "
>
Cancel
</md-button>
</md-dialog-actions>
</form>
</md-content>
</md-tab>
<md-tab
label=
"Update Team Mate"
id=
"tab3"
>
<md-content
class=
"md-padding "
>
<form
ng-cloak
name=
"myForm"
id=
"myForm"
>
<!-- <md-toolbar>
<div class="md-toolbar-tools " style="background: cadetblue; ">
<h2>Add Team Mate </h2>
<span flex></span>
<md-button class="md-icon-button " ng-click="cancel() ">
<i class="fa fa-times fa-2x " style="margin-top: 5px; font-size: 1.5em; float: left "></i>
</md-button>
</div>
</md-toolbar> -->
<div
class=
"md-dialog-content "
>
<div
class=
"form-group "
>
<div
class=
"row col-lg-12 "
style=
"margin-left: 0px; "
>
<div
class=
"row col-lg-12 col-xs-12 "
>
<div
class=
"col-xs-6 text-center "
>
<p>
<b>
Project Name:
</b>
{{projectName}}
</p>
</div>
<div
class=
"col-xs-6 text-center "
>
<p>
<b>
Manager Name:
</b><span
ng-repeat=
"manager in managerIds"
>
{{manager.employeeName}}
<span
ng-hide=
"$last"
>
,
</span></span>
</p>
</div>
</div>
<!-- <md-select ng-model="employeeModel" data-md-container-class="selectHeader" md-selected-text="getEmployeeSelected() " id="selectEmp" name="employeeModel" ng-disabled="addOrUpdateFlag">
<md-select-header class="selectHeaderChild header-spacing" layout="column">
<input ng-model="searchTerm" type="search" id="search" ng-keydown="updateSearch($event)" ng-model-options="{debounce: {'default': 500, 'blur': 0}}"
placeholder="Please search for a employee" class="searchBoxHeader demo-header-searchbox md-text search-spacingleft" />
<span class="glyphicon glyphicon-remove close-mdselect" ng-click="closeSelectBox()"></span>
</md-select-header>
<md-optgroup label="Employee " class="optionScroll">
<md-option ng-value="employee " ng-repeat="employee in employeeList | filter:searchFilter">{{employee.employeeName}}</md-option>
</md-optgroup>
</md-select> -->
<output>
Employee Name : {{employeeModel.employeeName}}
</output>
<output>
Employee Id : {{employeeModel.employeeId}}
</output>
<output>
Email Id : {{employeeModel.emailId}}
</output>
<output>
Role : {{employeeModel.role}}
</output>
<output>
Designation : {{employeeModel.designation}}
</output>
<md-select
ng-model=
"employeeRole"
md-selected-text=
"getSelectedEmpRole()"
id=
"empRole"
>
<md-optgroup
...
...
@@ -116,7 +199,7 @@
</div>
</div>
<md-dialog-actions
layout=
"row "
>
<md-button
class=
"md-raised "
data-ng-click=
"validateFields(templateTitle) "
style=
"width:120px;background: cadetblue;color:white; "
>
Add
<md-button
class=
"md-raised "
data-ng-click=
"validateFields(templateTitle) "
style=
"width:120px;background: cadetblue;color:white; "
>
Update
</md-button>
<md-button
class=
"md-raised "
ng-click=
"cancelTab() "
style=
"width:120px;background: cadetblue;color:white; "
>
Cancel
</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