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
5e0fcd53
Commit
5e0fcd53
authored
Jul 23, 2018
by
rammula-nisum-com
Committed by
rbonthala-nisum-com
Jul 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MT-78 and MT-82 (#35)
parent
37015667
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
516 additions
and
0 deletions
+516
-0
DomainController.js
src/main/webapp/WEB-INF/controllers/DomainController.js
+386
-0
LoginController.js
src/main/webapp/WEB-INF/controllers/LoginController.js
+1
-0
domains.html
src/main/webapp/WEB-INF/templates/domains.html
+39
-0
index.html
src/main/webapp/WEB-INF/templates/index.html
+1
-0
newDomain.html
src/main/webapp/WEB-INF/templates/newDomain.html
+89
-0
No files found.
src/main/webapp/WEB-INF/controllers/DomainController.js
0 → 100644
View file @
5e0fcd53
myApp
.
controller
(
"domainController"
,
function
(
$scope
,
myFactory
,
exportUiGridService
,
$mdDialog
,
$http
,
appConfig
,
$timeout
,
$window
,
$mdSelect
)
{
$scope
.
records
=
[];
$scope
.
empSearchId
=
""
;
$scope
.
parentData
=
{
"domainId"
:
""
,
"domainName"
:
""
,
"account"
:
""
,
"deliveryManagers"
:
""
,
"status"
:
""
,
"action"
:
""
};
$window
.
addEventListener
(
'click'
,
function
(
e
)
{
if
(
e
.
target
.
type
!==
'search'
)
{
$mdSelect
.
hide
();
}
});
var
getCellTemplate
=
'<p class="col-lg-12"><i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Edit" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.getRowData(row,
\'
Update
\'
)"></i>'
+
' <i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.getRowData(row,
\'
Delete
\'
)"></i></p>'
;
$scope
.
gridOptions
=
{
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSize
:
10
,
pageNumber
:
1
,
pageSize
:
10
,
enableFiltering
:
true
,
columnDefs
:
[
{
field
:
'domainId'
,
displayName
:
'Domain ID'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
120
,
},
{
field
:
'domainName'
,
displayName
:
'Domain'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
field
:
'accountName'
,
displayName
:
'Account '
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
field
:
'deliveryManagers'
,
displayName
:
'Delivery Leads'
,
cellTemplate
:
'<div ng-repeat= "deliveryManager in row.entity[col.field]">{{deliveryManager.employeeName}}<span ng-hide="$last">,</span></div>'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
field
:
'status'
,
displayName
:
'Status '
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
name
:
'Actions'
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
130
}
]
};
$scope
.
getRowData
=
function
(
row
,
action
)
{
$scope
.
parentData
.
id
=
row
.
entity
.
id
;
$scope
.
parentData
.
domainId
=
row
.
entity
.
domainId
;
$scope
.
parentData
.
domainName
=
row
.
entity
.
domainName
;
$scope
.
parentData
.
account
=
row
.
entity
.
accountName
;
$scope
.
parentData
.
deliveryManagers
=
row
.
entity
.
deliveryManagers
;
if
(
action
==
"Update"
)
$scope
.
addDomain
(
action
,
$scope
.
parentData
);
else
if
(
action
==
"Delete"
)
$scope
.
deleteDomain
(
row
);
}
$scope
.
records
=
[];
$scope
.
alertMsg
=
""
;
$scope
.
gridOptions
.
data
=
$scope
.
records
;
$scope
.
getEmployeesToTeam
=
function
()
{
$http
(
{
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"/projectTeam/getEmployeesToTeam"
})
.
then
(
function
mySuccess
(
response
)
{
$scope
.
employees
=
response
.
data
;
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
$scope
.
gridOptions
.
data
=
[];
});
};
function
showAlert
(
message
)
{
$mdDialog
.
show
(
$mdDialog
.
alert
().
parent
(
angular
.
element
(
document
.
querySelector
(
'#popupContainer'
)))
.
clickOutsideToClose
(
true
).
textContent
(
message
)
.
ariaLabel
(
'Alert Dialog'
).
ok
(
'Ok'
));
}
$scope
.
getDomains
=
function
()
{
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"/domains"
})
.
then
(
function
mySuccess
(
response
)
{
console
.
log
(
response
.
data
);
$scope
.
gridOptions
.
data
=
response
.
data
;
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
});
};
function
refreshPage
()
{
$scope
.
getDomains
();
}
$scope
.
addDomain
=
function
(
action
,
userData
)
{
$
(
'#home'
).
addClass
(
'md-scroll-mask'
);
userData
.
action
=
action
;
$mdDialog
.
show
(
{
controller
:
AddDomainController
,
templateUrl
:
'templates/newDomain.html'
,
parent
:
angular
.
element
(
document
.
body
),
clickOutsideToClose
:
true
,
locals
:
{
dataToPass
:
userData
,
gridOptionsData
:
$scope
.
gridOptions
.
data
,
employees
:
$scope
.
employees
},
})
.
then
(
function
(
result
)
{
if
(
result
==
"Add"
)
{
showAlert
(
'Domain created successfully'
);
}
else
if
(
result
==
"Update"
)
{
showAlert
(
'Domain updated successfully'
);
}
else
if
(
result
==
"Cancelled"
)
console
.
log
(
result
);
else
showAlert
(
'Domain assigning/updation failed!!!'
);
});
};
$scope
.
deleteDomain
=
function
(
row
)
{
$
(
'#home'
).
addClass
(
'md-scroll-mask'
);
var
confirm
=
$mdDialog
.
confirm
().
clickOutsideToClose
(
true
).
textContent
(
'Are you sure want to Inactive this Domain?'
).
ok
(
'Ok'
).
cancel
(
'Cancel'
);
$mdDialog
.
show
(
confirm
).
then
(
function
()
{
deleteDomainRow
(
row
.
entity
.
domainId
);
showAlert
(
"Domain Inactived successfully"
);
},
function
()
{
console
.
log
(
"Cancelled dialog"
);
});
};
function
deleteDomainRow
(
domainId
)
{
var
req
=
{
method
:
'DELETE'
,
url
:
appConfig
.
appUri
+
"/domains?domainId="
+
domainId
}
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
refreshPage
();
},
function
myError
(
response
)
{
$scope
.
result
=
"Error"
;
});
}
function
updateGrid
(
action
,
result
)
{
if
(
$scope
.
alertMsg
==
""
)
{
if
(
result
==
"Success"
)
{
if
(
action
==
"Add"
)
{
refreshPage
();
}
else
if
(
action
==
"Update"
)
{
refreshPage
();
}
$mdDialog
.
hide
(
action
);
}
else
{
$mdDialog
.
hide
(
"Error"
);
}
}
}
function
AddDomainController
(
$scope
,
$mdDialog
,
dataToPass
,
gridOptionsData
,
employees
)
{
console
.
log
(
"employees"
,
employees
);
$scope
.
searchTerm
=
""
;
$scope
.
updateSearch
=
function
(
e
)
{
e
.
stopPropagation
();
}
$scope
.
searchFilter
=
function
(
obj
)
{
var
re
=
new
RegExp
(
$scope
.
searchTerm
,
'i'
);
return
!
$scope
.
searchTerm
||
re
.
test
(
obj
.
employeeName
);
};
$scope
.
clearSearchTerm
=
function
()
{
$scope
.
searchTerm
=
''
;
};
$
(
'input'
).
on
(
'keydown'
,
function
(
ev
)
{
ev
.
stopPropagation
();
});
$scope
.
employeeList
=
employees
;
$scope
.
employeeNamesArray
=
[];
$scope
.
employeeModel
;
$scope
.
templateTitle
=
dataToPass
.
action
;
$scope
.
accounts
=
myFactory
.
getAccounts
();
$scope
.
getSelectedText
=
function
()
{
if
(
$scope
.
employeeModel
!==
undefined
)
{
return
null
;
}
else
{
return
"Please select a Delivery Head"
;
}
}
$scope
.
getAccountText
=
function
()
{
if
(
$scope
.
account
!==
undefined
)
{
return
$scope
.
account
.
accountName
;
}
else
{
return
"Please select account"
;
}
};
$scope
.
cancel
=
function
()
{
$mdDialog
.
hide
(
'Cancelled'
);
};
$scope
.
deliveryHeads
=
function
()
{
var
length
=
$scope
.
employeeModel
.
length
;
console
.
log
(
length
);
for
(
i
=
0
;
i
<
length
;
i
++
)
{
$scope
.
employeeNamesArray
[
i
]
=
$scope
.
employeeModel
[
i
].
employeeId
;
}
return
$scope
.
employeeNamesArray
;
}
$scope
.
removeSelectedLead
=
function
(
item
)
{
var
index
=
$scope
.
employeeModel
.
indexOf
(
item
);
console
.
log
(
index
);
$scope
.
employeeNamesArray
.
splice
(
index
,
1
);
$scope
.
employeeModel
.
splice
(
index
,
1
);
console
.
log
(
$scope
.
employeeNamesArray
);
}
function
updatingGridBasedOnStatus
(
status
,
response
,
result
)
{
if
(
response
==
"Saved Succesfully"
)
{
updateGrid
(
"Add"
,
result
);
}
else
if
(
response
==
"Updated Succesfully"
)
{
updateGrid
(
"Update"
,
result
);
}
else
if
(
response
==
"Domain already exists"
)
{
$scope
.
alertMsg
=
"Domain already exist,Please enter new matching"
;
}
}
$scope
.
addOrUpdateDomain
=
function
(
record
)
{
$http
({
method
:
"POST"
,
url
:
appConfig
.
appUri
+
"/domains"
,
headers
:
{
"Content-type"
:
"application/json"
},
data
:
record
})
.
then
(
function
mySuccess
(
response
)
{
$scope
.
result
=
"Success"
;
console
.
log
(
response
);
updatingGridBasedOnStatus
(
dataToPass
.
action
,
response
.
data
,
$scope
.
result
);
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
});
}
if
(
dataToPass
.
action
==
"Assign"
)
{
$scope
.
domainName
=
""
;
$scope
.
accountName
=
""
;
$scope
.
deliveryManagers
=
""
;
}
else
if
(
dataToPass
.
action
==
"Update"
)
{
$scope
.
id
=
dataToPass
.
id
;
$scope
.
domainId
=
dataToPass
.
domainId
;
$scope
.
domainName
=
dataToPass
.
domainName
;
$scope
.
account
=
{};
$scope
.
account
.
accountName
=
dataToPass
.
account
;
$scope
.
employeeModel
=
dataToPass
.
deliveryManagers
;
}
$scope
.
validateFields
=
function
(
action
){
var
domainId
=
$scope
.
domainId
;
var
AccountName
=
$scope
.
account
;
var
domainName
=
$scope
.
domainName
;
var
deliveryManagers
=
$scope
.
employeeModel
;
if
(
action
==
"Add"
){
if
(
AccountName
==
undefined
){
$scope
.
alertMsg
=
"Please select a Account"
;
document
.
getElementById
(
'account'
).
focus
();
}
else
if
(
domainName
==
undefined
){
$scope
.
alertMsg
=
"Please enter a DomainName"
;
document
.
getElementById
(
'domainName'
).
focus
();
}
else
if
(
deliveryManagers
==
undefined
){
$scope
.
alertMsg
=
"Please select a deliveryManagers"
;
document
.
getElementById
(
'selectDeliveryLeads'
).
focus
();
}
else
{
$scope
.
alertMsg
=
""
;
var
record
=
{
"domainName"
:
$scope
.
domainName
,
"accountName"
:
$scope
.
account
.
accountName
,
"deliveryManagers"
:
$scope
.
deliveryHeads
()
};
$scope
.
addOrUpdateDomain
(
record
);
}
}
else
{
$scope
.
alertMsg
=
""
;
var
AccountName1
=
$scope
.
account
.
accountName
;
var
domainName1
=
$scope
.
domainName
;
var
deliveryManagers1
=
$scope
.
deliveryHeads
();
if
(
AccountName
==
undefined
){
$scope
.
alertMsg
=
"Please select a Account"
;
document
.
getElementById
(
'account'
).
focus
();
}
else
if
(
domainName
==
""
||
undefined
)
{
$scope
.
alertMsg
=
"Please enter a DomainName"
;
document
.
getElementById
(
'domainName'
).
focus
();
}
else
if
(
deliveryManagers
.
length
<=
0
){
$scope
.
alertMsg
=
"Please select a deliveryManagers"
;
document
.
getElementById
(
'selectDeliveryLeads'
).
focus
();
}
else
{
$scope
.
alertMsg
=
""
;
var
record
=
{
"domainName"
:
$scope
.
domainName
,
"accountName"
:
$scope
.
account
.
accountName
,
"deliveryManagers"
:
$scope
.
deliveryHeads
(),
"id"
:
dataToPass
.
id
,
"domainId"
:
dataToPass
.
domainId
};
$scope
.
addOrUpdateDomain
(
record
);
}
}
};
}
});
\ No newline at end of file
src/main/webapp/WEB-INF/controllers/LoginController.js
View file @
5e0fcd53
...
...
@@ -293,6 +293,7 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
menuItems
.
push
({
"menu"
:
"Manage Accounts"
,
"icon"
:
"fa fa-user-plus fa-2x"
,
"path"
:
"templates/accounts.html"
});
menuItems
.
push
({
"menu"
:
"Manage Employees"
,
"icon"
:
"fa fa-user-plus fa-2x"
,
"path"
:
"templates/roles.html"
});
menuItems
.
push
({
"menu"
:
"Manage Team"
,
"icon"
:
"fa fa-sitemap fa-2x"
,
"path"
:
"templates/projectDetails.html"
});
menuItems
.
push
({
"menu"
:
"Manage Domains"
,
"icon"
:
"fa fa-handshake-o"
,
"path"
:
"templates/domains.html"
});
menuItems
.
push
({
"menu"
:
"Manage Projects"
,
"icon"
:
"fa fa-tasks fa-2x"
,
"path"
:
"templates/projects.html"
});
menuItems
.
push
({
"menu"
:
"Manage Visa"
,
"icon"
:
"fa fa-tasks fa-2x"
,
"path"
:
"templates/visaList.html"
});
menuItems
.
push
({
"menu"
:
"Manage Travels"
,
"icon"
:
"fa fa-tasks fa-2x"
,
"path"
:
"templates/onsiteTravelsList.html"
});
...
...
src/main/webapp/WEB-INF/templates/domains.html
0 → 100644
View file @
5e0fcd53
<div
class=
"md-padding"
style=
"width: 100%; padding: 3px 0px 0px 0px;"
id=
"popupContainer"
ng-controller=
"domainController"
ng-init=
"getDomains();getEmployeesToTeam();"
>
<div
class=
"container-fluid mainDivHeaderClass"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<p
align=
"center"
class=
"col-xs-11"
style=
"vertical-align: middle; font-weight: bold; font-size: 30px;"
>
Manage
Domains
</p>
<p
align=
"right"
class=
"col-xs-1"
style=
"vertical-align: middle; font-weight: bold; font-size: 1.5em; margin-top: 8px; cursor: pointer;"
>
<i
class=
"fa fa-refresh"
aria-hidden=
"true"
ng-click=
"refreshPage()"
></i>
</p>
</div>
<div
class=
"clearfix"
></div>
</div>
</div>
<div
class=
"row col-lg-12"
style=
"height: 15px;"
></div>
<div
class=
"row col-lg-12"
>
<div
class=
"col-lg-8"
>
<md-button
class=
"md-raised md-primary"
style=
"width:142px;background: cadetblue; margin: 0% 0% 0% 124%;"
ng-click=
"addDomain('Add', parentData)"
>
<i
class=
"fa fa-plus-circle fa-2x"
style=
"margin-top: 5px; font-size: 1.5em; float: left"
></i>
Add
Domain
</md-button>
</div>
</div>
<div
class=
"row col-lg-12"
style=
"margin-left: 0px; margin-top: 10px"
>
<div
id=
"gridTest"
ui-grid=
"gridOptions"
ui-grid-pagination
class=
"myGrid"
style=
"width: 99%; height: 370px; margin-left: 0px;"
>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
data available
</div>
</div>
</div>
<div
class=
"row col-lg-12"
style=
"height: 15px;"
></div>
</div>
\ No newline at end of file
src/main/webapp/WEB-INF/templates/index.html
View file @
5e0fcd53
...
...
@@ -78,6 +78,7 @@
<script
src=
"controllers/ExportDataController.js"
></script>
<script
src=
"controllers/ChartsController.js"
></script>
<script
src=
"controllers/TestController2.js"
></script>
<script
src=
"controllers/DomainController.js"
></script>
</head>
<body>
<ng-include
src=
"'templates/login.html'"
id=
"home"
></ng-include>
...
...
src/main/webapp/WEB-INF/templates/newDomain.html
0 → 100644
View file @
5e0fcd53
<md-dialog
aria-label=
"Role Template"
style=
"width:520px;height:450px;"
>
<form
ng-cloak
name=
"myForm"
>
<md-toolbar>
<div
class=
"md-toolbar-tools"
style=
"background: cadetblue;"
>
<h2>
{{templateTitle}} Domain
</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>
<md-dialog-content>
<div
class=
"md-dialog-content"
>
<div
class=
"form-group"
>
<div
class=
"row"
>
<table
width=
"450px"
>
<tr>
<td
colspan=
"4"
><b>
Domain ID
</b></td>
<td
colspan=
"8"
><input
type=
"text"
class=
"form-control ng-pristine ng-untouched ng-valid ng-empty"
id=
"domainId"
name=
"domainId"
ng-model=
"domainId"
placeholder=
"Domain Id Auto Generates"
ng-blur=
""
ng-disabled=
"true"
disabled=
"disabled"
aria-invalid=
"false"
style=
""
></td>
</tr>
<tr>
<td
colspan=
"4"
><b>
Account
</b></td>
<td
colspan=
"8"
><md-select
ng-model=
"account"
md-selected-text=
"getAccountText()"
id=
"account"
>
<md-optgroup
label=
"account"
>
<md-option
ng-value=
"account1"
ng-repeat=
"account1 in accounts"
>
{{account1.accountName}}
</md-option>
</md-optgroup>
</md-select></td>
</tr>
<tr>
<td
colspan=
"4"
><b>
Domain Name
</b></td>
<td
colspan=
"8"
><input
type=
"text"
class=
"form-control"
id=
"domainName"
name=
"domainName"
ng-model=
"domainName"
placeholder=
"Domain Name"
ng-disabled=
"false"
/></td>
</tr>
<tr>
<td
colspan=
"4"
><b>
Delivery Head
</b></td>
<td
colspan=
"8"
id=
"lead"
>
<div
class=
"leads-data"
ng-show=
"employeeModel.length > 0"
>
<div
ng-repeat=
"item in employeeModel"
>
<p>
{{item.employeeName}}
<span
ng-click=
"removeSelectedLead(item)"
class=
"glyphicon glyphicon-remove"
></span>
</p>
</div>
</div>
<div
style=
"display: block; float: left; width: 100%;"
>
<md-select
class=
"lead-search"
ng-model=
"employeeModel"
data-md-container-class=
"selectHeader"
md-selected-text=
"getSelectedText()"
id=
"selectDeliveryLeads"
multiple
>
<md-select-header
class=
"selectHeaderChild header-spacing"
layout=
"column"
>
<input
ng-model=
"searchTerm"
type=
"search"
ng-keydown=
"updateSearch($event)"
ng-model-options=
"{debounce: {'default': 500, 'blur': 0}}"
placeholder=
"Please Search for a lead"
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
class=
"optionScroll"
label=
"Employee"
>
<md-option
ng-value=
"employee"
ng-repeat=
"employee in employeeList | filter:searchFilter"
>
{{employee.employeeName}}
</md-option>
</md-optgroup>
</md-select>
</div>
</td>
</tr>
</table>
<div
role=
"alert"
>
<span
class=
"error"
style=
"color: red;"
>
{{alertMsg}}
</span>
</div>
</div>
</div>
</div>
</md-dialog-content>
<md-dialog-actions
layout=
"row"
>
<md-button
class=
"md-raised"
data-ng-click=
"validateFields(templateTitle)"
style=
"width:120px;background: cadetblue;color:white;"
>
{{templateTitle}}
</md-button>
<md-button
class=
"md-raised"
ng-click=
"cancel()"
style=
"width:120px;background: cadetblue;color:white;"
>
Cancel
</md-button>
</md-dialog-actions>
</form>
</md-dialog>
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