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
22332416
Commit
22332416
authored
Jun 17, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Dropdown for allocation status
parent
67fdb580
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
16 deletions
+56
-16
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+38
-12
custom-theme.css
src/main/webapp/WEB-INF/css/custom-theme.css
+6
-2
projectTeamDetails.html
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
+12
-2
No files found.
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
22332416
...
...
@@ -405,6 +405,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
isSecondTab
=
false
;
$scope
.
prjctStses
=
[
"Active"
,
"Completed"
,
"On Hold"
,
"Proposed"
];
$scope
.
billableStatuses
=
[
"Billable"
,
"Shadow"
,
"Non-Billable"
,
"Reserved"
,
"Trainee"
];
$scope
.
allocationStatuses
=
[
"Engaged"
,
"Proposed"
];
$scope
.
empAllocationStatus
=
'Engaged'
;
$scope
.
employeeShifts
=
myFactory
.
getShifts
();
$scope
.
deliveryLeadIds
=
dataToPass
.
deliveryLeadIds
;
var
allAccounts
=
myFactory
.
getAccounts
();
...
...
@@ -723,12 +725,14 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
"startDate"
:
""
,
"endDate"
:
""
,
"newBillingStartDate"
:
""
,
"empAllocationStatus"
:
""
,
"empBillableStatuses"
:[]
};
$scope
.
edit
=
function
(
rowd
)
{
console
.
log
(
rowd
)
var
row
=
rowd
.
entity
;
var
index
=
$scope
.
gridOptions
.
data
.
indexOf
(
row
);
if
(
$scope
.
previousRow
){
...
...
@@ -766,6 +770,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
};
$scope
.
parentData
.
newBillingStartDate
=
row
.
billingStartDate
;
$scope
.
parentData
.
endDate
=
row
.
billingEndDate
;
$scope
.
parentData
.
empAllocationStatus
=
row
.
status
;
};
$scope
.
rowCompare
=
function
(
row
)
{
...
...
@@ -847,9 +852,10 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
endDate
=
row
.
billingEndDate
;
$scope
.
employeeRole
=
row
.
resourceRole
;
$scope
.
empBillableStatus
=
row
.
billableStatus
;
$scope
.
empAllocationStatus
=
row
.
status
;
$scope
.
id
=
row
.
id
;
if
(
action
==
'Update'
){
$scope
.
validateFields
(
action
);
$scope
.
validateFields
(
action
,
row
);
if
(
$scope
.
alertMsg
!=
""
){
row
.
billingStartDate
=
$scope
.
parentData
.
newBillingStartDate
;
row
.
billingEndDate
=
$scope
.
parentData
.
endDate
;
...
...
@@ -1366,7 +1372,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
}
$scope
.
validateFields
=
function
(
action
)
{
$scope
.
validateFields
=
function
(
action
,
row
)
{
var
project
=
$scope
.
projectId
;
var
projectName
=
$scope
.
projectName
;
...
...
@@ -1376,6 +1382,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
var
employeeModel
=
$scope
.
employeeModel
;
var
projectModel
=
$scope
.
projectModel
;
var
newBillingStartDate
=
$scope
.
newBillingStartDate
;
var
empAllocationStatus
=
$scope
.
empAllocationStatus
;
if
(
action
==
'Update'
){
$scope
.
employeeRole
==
'Lead'
?
$scope
.
employeeRole
=
'Lead'
:
$scope
.
employeeRole
=
'Employee'
;
}
...
...
@@ -1399,6 +1406,10 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
alertMsg
=
"Please select new Billing StartDate"
;
angular
.
element
(
document
.
getElementById
(
'newBillingStartDate'
)).
focus
();
}
else
if
(
$scope
.
empAllocationStatus
==
undefined
){
$scope
.
alertMsg
=
"Please select a Allocation Status"
;
angular
.
element
(
document
.
getElementById
(
'empAllocationStatus'
)).
focus
();
}
/* 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;
...
...
@@ -1415,7 +1426,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
else
{
$scope
.
id
=
$scope
.
id
?
$scope
.
id
:
$scope
.
objectId
;
$scope
.
alertMsg
=
""
;
var
record
=
{
"id"
:
$scope
.
id
,
"employeeId"
:
employeeModel
.
employeeId
,
"projectId"
:
project
,
"billableStatus"
:
$scope
.
empBillableStatus
,
"billingEndDate"
:
$scope
.
endDate
,
"resourceRole"
:
$scope
.
employeeRole
,
"billingStartDate"
:
newBillingStartDate
,
"status"
:
"Engaged"
};
var
record
=
{
"id"
:
$scope
.
id
,
"employeeId"
:
employeeModel
.
employeeId
,
"projectId"
:
project
,
"billableStatus"
:
$scope
.
empBillableStatus
,
"billingEndDate"
:
$scope
.
endDate
,
"resourceRole"
:
$scope
.
employeeRole
,
"billingStartDate"
:
newBillingStartDate
,
"status"
:
empAllocationStatus
};
if
(
action
==
"Add"
){
addRecord
(
record
,
action
);
$scope
.
myForm
.
$setPristine
();
...
...
@@ -1429,7 +1440,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}))
}
else
{
updateTeamRecord
(
record
,
action
);
updateTeamRecord
(
record
,
action
,
row
);
$scope
.
myForm
.
$setPristine
();
}
}
...
...
@@ -1672,7 +1684,13 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
return
"Please select a billable status"
;
}
};
$scope
.
getSelectedAllocationStatus
=
function
(){
if
(
$scope
.
empAllocationStatus
!=
undefined
)
{
return
$scope
.
empAllocationStatus
;
}
else
{
return
"Please select a allocation status"
;
}
};
function
updateGrid
(
action
,
record
)
{
if
(
$scope
.
alertMsg
==
""
)
{
if
(
$scope
.
result
==
"Success"
)
{
...
...
@@ -1764,7 +1782,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
gridOptions
.
data
=
[];
});
}
function
updateTeamRecord
(
record
,
action
){
function
updateTeamRecord
(
record
,
action
,
row
){
var
urlRequest
=
""
;
var
loginEmpId
=
myFactory
.
getEmpId
();
urlRequest
=
appConfig
.
appUri
+
"resources?loginEmpId="
+
loginEmpId
;
...
...
@@ -1791,15 +1809,23 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
})
}
else
{
$scope
.
alertMsg
=
response
.
data
.
message
;
if
(
$scope
.
alertMsg
&&
$scope
.
alertMsg
!=
""
){
row
.
billingStartDate
=
$scope
.
parentData
.
newBillingStartDate
;
row
.
billingEndDate
=
$scope
.
parentData
.
endDate
;
row
.
resourceRole
=
$scope
.
parentData
.
role
;
row
.
billableStatus
=
$scope
.
parentData
.
billableStatus
;
}
}
// $scope.objectId = response.data.id;
},
function
myError
(
response
){
$scope
.
result
=
"Error"
;
});
},
function
myError
(
response
){
$scope
.
result
=
"Error"
;
row
.
billingStartDate
=
$scope
.
parentData
.
newBillingStartDate
;
row
.
billingEndDate
=
$scope
.
parentData
.
endDate
;
row
.
resourceRole
=
$scope
.
parentData
.
role
;
row
.
billableStatus
=
$scope
.
parentData
.
billableStatus
;
});
}
}
function
addOrUpdateProject
(
record
,
action
)
{
var
urlRequest
=
""
;
...
...
src/main/webapp/WEB-INF/css/custom-theme.css
View file @
22332416
...
...
@@ -673,6 +673,10 @@ cursor: pointer;
.viewTeamDetails
{
width
:
100%
;
}
md-content
{
overflow
:
hidden
;
.view-team-details-grid
{
height
:
calc
(
85vh
-
243px
)
!important
;
}
.alertMsg
{
margin
:
10px
0
0
0
;
}
\ No newline at end of file
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
View file @
22332416
...
...
@@ -46,10 +46,10 @@
<input
type=
"radio"
ng-model=
"status"
value=
"Both"
ng-click=
"getTeamMates()"
>
Both
</div>
<div
id=
"gridTest"
class=
"
grid-half-view
"
ui-grid=
"gridOptions "
ui-grid-edit
ui-grid-pagination
style=
"width:99%;height:230px;margin-left:10px; "
>
<div
id=
"gridTest"
class=
"
view-team-details-grid
"
ui-grid=
"gridOptions "
ui-grid-edit
ui-grid-pagination
style=
"width:99%;height:230px;margin-left:10px; "
>
<div
class=
"watermark "
ng-show=
"!gridOptions.data.length "
>
No data available
</div>
</div>
<div
ng-if =
'templateTitle == "View"'
role=
"alert"
>
<div
ng-if =
'templateTitle == "View"'
role=
"alert"
class=
"alertMsg"
>
<span
style=
"color: red; "
>
{{alertMsg}}
</span>
</div>
</div>
...
...
@@ -171,6 +171,16 @@
onkeydown=
"return false "
name=
"endDate"
></md-datepicker>
</td>
</tr>
<tr>
<td
class=
"Employee"
>
Allocation Status
</td>
<td>
<md-select
ng-model=
"empAllocationStatus "
md-selected-text=
"getSelectedAllocationStatus() "
id=
"empAllocationStatus"
name=
"empAllocationStatus"
>
<md-optgroup
label=
"allocation statuses "
>
<md-option
ng-value=
"allocationStatus "
ng-repeat=
"allocationStatus in allocationStatuses "
>
{{allocationStatus}}
</md-option>
</md-optgroup>
</md-select>
</td>
</tr>
</table>
<div
ng-if =
'templateTitle == "Add"'
role=
"alert"
>
...
...
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